diff options
Diffstat (limited to 'stdlib/source/lux/lexer.lux')
-rw-r--r-- | stdlib/source/lux/lexer.lux | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/stdlib/source/lux/lexer.lux b/stdlib/source/lux/lexer.lux index ca8f7f5cf..03e5f5cbd 100644 --- a/stdlib/source/lux/lexer.lux +++ b/stdlib/source/lux/lexer.lux @@ -15,7 +15,7 @@ [char "Char/" Ord<Char>] maybe ["E" error #- fail] - (struct [list "" Functor<List>])))) + (coll [list "" Functor<List>])))) ## [Types] (type: #export (Lexer a) @@ -86,7 +86,7 @@ {#;doc "Just returns the next character without applying any logic."} (Lexer Char) (lambda [input] - (case [(text;at +0 input) (text;split +1 input)] + (case [(text;nth +0 input) (text;split +1 input)] [(#;Some output) (#;Some [_ input'])] (#E;Success [input' output]) @@ -276,7 +276,7 @@ {#;doc "Lex the next character (without consuming it from the input)."} (Lexer Char) (lambda [input] - (case (text;at +0 input) + (case (text;nth +0 input) (#;Some output) (#E;Success [input output]) @@ -288,7 +288,7 @@ {#;doc "Lex a character if it matches the given sample."} (-> Char (Lexer Char)) (lambda [input] - (case [(text;at +0 input) (text;split +1 input)] + (case [(text;nth +0 input) (text;split +1 input)] [(#;Some char') (#;Some [_ input'])] (if (Char/= test char') (#E;Success [input' test]) @@ -352,7 +352,7 @@ (case (text;split +1 input) (#;Some [init input']) (if (text;contains? init options) - (case (text;at +0 init) + (case (text;nth +0 init) (#;Some output) (#E;Success [input' output]) @@ -370,7 +370,7 @@ (case (text;split +1 input) (#;Some [init input']) (if (;not (text;contains? init options)) - (case (text;at +0 init) + (case (text;nth +0 init) (#;Some output) (#E;Success [input' output]) @@ -388,7 +388,7 @@ (case (: (Maybe [Text Char]) (do Monad<Maybe> [[init input'] (text;split +1 input) - output (text;at +0 init)] + output (text;nth +0 init)] (wrap [input' output]))) (#;Some [input' output]) (if (p output) |