diff options
author | Eduardo Julian | 2017-11-14 23:57:15 -0400 |
---|---|---|
committer | Eduardo Julian | 2017-11-14 23:57:15 -0400 |
commit | 772ff99830d133b2e36ad1b09c66223ef1085c71 (patch) | |
tree | 66588cb41e82c1334e4a75f44ad6014a14fbc776 /new-luxc/source/luxc/lang/syntax.lux | |
parent | a3b9b19231047ec6da8decfc7d45db0598622651 (diff) |
- Modified the syntax for module definitions.
- Fixed some bugs.
Diffstat (limited to '')
-rw-r--r-- | new-luxc/source/luxc/lang/syntax.lux | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/new-luxc/source/luxc/lang/syntax.lux b/new-luxc/source/luxc/lang/syntax.lux index 2d8cb364a..9fe4939a2 100644 --- a/new-luxc/source/luxc/lang/syntax.lux +++ b/new-luxc/source/luxc/lang/syntax.lux @@ -27,7 +27,8 @@ (;module: lux (lux (control monad - ["p" parser "p/" Monad<Parser>]) + ["p" parser "p/" Monad<Parser>] + ["ex" exception #+ exception:]) (data [bool] [text] ["e" error] @@ -584,6 +585,9 @@ [tag #;Tag (p;after (l;this "#") (ident^ current-module)) +1] ) +(exception: #export End-Of-File) +(exception: #export Unrecognized-Input) + (def: (ast current-module) (-> Text Cursor (l;Lexer [Cursor Code])) (: (-> Cursor (l;Lexer [Cursor Code])) @@ -602,6 +606,11 @@ (symbol current-module where) (tag current-module where) (text where) + (do @ + [end? l;end?] + (if end? + (p;fail (End-Of-File current-module)) + (p;fail (Unrecognized-Input current-module)))) ))))) (def: #export (parse current-module [where offset source]) |