diff options
author | Eduardo Julian | 2020-12-17 22:03:54 -0400 |
---|---|---|
committer | Eduardo Julian | 2020-12-17 22:03:54 -0400 |
commit | 68b1dd82f23d6648ac3d9075a8f84b0174392945 (patch) | |
tree | 2db148a005c21552947d96dfd4e788ba21705037 /stdlib/source/lux/data/text.lux | |
parent | abc5c5293603229b447b8b5dfa7f3275571ad982 (diff) |
More optimizations to the Lux syntax parser.
Diffstat (limited to 'stdlib/source/lux/data/text.lux')
-rw-r--r-- | stdlib/source/lux/data/text.lux | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/stdlib/source/lux/data/text.lux b/stdlib/source/lux/data/text.lux index 81e6e6bd5..042919c24 100644 --- a/stdlib/source/lux/data/text.lux +++ b/stdlib/source/lux/data/text.lux @@ -275,14 +275,19 @@ (def: #export (space? char) {#.doc "Checks whether the character is white-space."} (-> Char Bit) - (`` (case char - (^or (^ (char (~~ (static ..tab)))) - (^ (char (~~ (static ..vertical-tab)))) - (^ (char (~~ (static ..space)))) - (^ (char (~~ (static ..new-line)))) - (^ (char (~~ (static ..carriage-return)))) - (^ (char (~~ (static ..form-feed))))) - true - - _ - false))) + (with-expansions [<options> (template [<char>] + [(^ (char (~~ (static <char>))))] + + [..tab] + [..vertical-tab] + [..space] + [..new-line] + [..carriage-return] + [..form-feed] + )] + (`` (case char + (^or <options>) + true + + _ + false)))) |