aboutsummaryrefslogtreecommitdiff
path: root/new-luxc/source/luxc/base.lux
blob: ce872e9dac65762f1b40ec5ef4b0839f1171f12e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
(;module:
  lux
  (lux (control monad)
       (data text/format)
       [macro #+ Monad<Lux>]))

(type: #export Path Text)

(type: #export Mode
  #Release
  #Debug)

(def: #export (fail message)
  (All [a] (-> Text (Lux a)))
  (do Monad<Lux>
    [[file line col] macro;cursor
     #let [location (format file
                            "," (|> line nat-to-int %i)
                            "," (|> col nat-to-int %i))]]
    (macro;fail (format "@ " location
                        "\n" message))))