Commit 0716c43226aa11d4fe8539636f24683f0d0fe401
1 parent
1348af13
-
Showing
1 changed file
with
3 additions
and
0 deletions
Show diff stats
anubis_dev/library/lexical_analysis/compile_time_test.anubis
| ... | ... | @@ -13,6 +13,7 @@ read fast_lexer_2.anubis |
| 13 | 13 | *** The lexer |
| 14 | 14 | |
| 15 | 15 | type Token: |
| 16 | + abc, | |
| 16 | 17 | symbol (String), |
| 17 | 18 | _Symbol (String), |
| 18 | 19 | symBOL (String), |
| ... | ... | @@ -23,6 +24,7 @@ define List(LexerItem(Token,One)) |
| 23 | 24 | the_lexer_description |
| 24 | 25 | = |
| 25 | 26 | [ |
| 27 | + lexer_item("abc", return((ByteArray b, Int l, Int c, One a) |-> token(abc))), | |
| 26 | 28 | lexer_item("[a-c][a-cA-C0-9]*", return((ByteArray b, Int l, Int c, One a) |-> token(symbol(to_string(b))))), |
| 27 | 29 | lexer_item("[A-C][a-cA-C0-9]*", return((ByteArray b, Int l, Int c, One a) |-> token(_Symbol(to_string(b))))), |
| 28 | 30 | lexer_item("[a-c]+[A-C]+[0-9]*", return((ByteArray b, Int l, Int c, One a) |-> token(symBOL(to_string(b))))), |
| ... | ... | @@ -62,6 +64,7 @@ define String |
| 62 | 64 | ) = |
| 63 | 65 | if t is |
| 64 | 66 | { |
| 67 | + abc then "abc", | |
| 65 | 68 | symbol(s) then "symbol("+s+")", |
| 66 | 69 | _Symbol(s) then "_Symbol("+s+")", |
| 67 | 70 | symBOL(s) then "symBOL("+s+")", | ... | ... |