aboutsummaryrefslogtreecommitdiff
path: root/stdlib/test
diff options
context:
space:
mode:
authorEduardo Julian2017-07-01 17:36:17 -0400
committerEduardo Julian2017-07-01 17:36:17 -0400
commitc6a107d54f20a57dff4b8e26b07d8eac15982c91 (patch)
tree380d8ddd694acd0c57e5ad7be2d27e4b5f061b93 /stdlib/test
parenta2f8078dcc79d7f4aa0f596b08f4402546df5ddb (diff)
- Lexers now carry an offset which they use to figure out where to extract parts of the whole input, instead of having to clip the input as they lex. thereby doing a lot of unnecessary text allocations.
- Some refactoring.
Diffstat (limited to 'stdlib/test')
-rw-r--r--stdlib/test/test/lux/data/text/lexer.lux30
1 files changed, 15 insertions, 15 deletions
diff --git a/stdlib/test/test/lux/data/text/lexer.lux b/stdlib/test/test/lux/data/text/lexer.lux
index 76eadfbb0..8752d4b96 100644
--- a/stdlib/test/test/lux/data/text/lexer.lux
+++ b/stdlib/test/test/lux/data/text/lexer.lux
@@ -94,9 +94,9 @@
(test "Can lex characters ranges."
(and (should-passT "Y" (&;run "Y"
- (&;char-range #"X" #"Z")))
+ (&;range #"X" #"Z")))
(should-fail (&;run "M"
- (&;char-range #"X" #"Z")))))
+ (&;range #"X" #"Z")))))
(test "Can lex upper-case and &;lower-case letters."
(and (should-passT "Y" (&;run "Y"
@@ -111,23 +111,23 @@
(test "Can lex numbers."
(and (should-passT "1" (&;run "1"
- &;digit))
+ &;decimal))
(should-fail (&;run " "
- &;digit))
+ &;decimal))
(should-passT "7" (&;run "7"
- &;oct-digit))
+ &;octal))
(should-fail (&;run "8"
- &;oct-digit))
+ &;octal))
(should-passT "1" (&;run "1"
- &;hex-digit))
+ &;hexadecimal))
(should-passT "a" (&;run "a"
- &;hex-digit))
+ &;hexadecimal))
(should-passT "A" (&;run "A"
- &;hex-digit))
+ &;hexadecimal))
(should-fail (&;run " "
- &;hex-digit))
+ &;hexadecimal))
))
(test "Can lex alphabetic characters."
@@ -167,9 +167,9 @@
(test "Can create the opposite of a lexer."
(and (should-passT "a" (&;run "a"
- (&;not (p;alt &;digit &;upper))))
+ (&;not (p;alt &;decimal &;upper))))
(should-fail (&;run "A"
- (&;not (p;alt &;digit &;upper))))))
+ (&;not (p;alt &;decimal &;upper))))))
(test "Can select from among a set of characters."
(and (should-passT "C" (&;run "C"
@@ -191,10 +191,10 @@
(test "Can apply a lexer multiple times."
(and (should-passT "0123456789ABCDEF" (&;run "0123456789ABCDEF"
- (&;many &;hex-digit)))
+ (&;many &;hexadecimal)))
(should-fail (&;run "yolo"
- (&;many &;hex-digit)))
+ (&;many &;hexadecimal)))
(should-passT "" (&;run ""
- (&;some &;hex-digit)))))
+ (&;some &;hexadecimal)))))
))