1

restructure + syntactic sugar implementation

This commit is contained in:
Christoph
2021-08-11 21:11:35 +02:00
parent 7365c41e11
commit 3a6814a850
27 changed files with 145 additions and 86 deletions

13
mytest/test_sugar_lex.py Normal file
View File

@ -0,0 +1,13 @@
from rply import Token
from simplelexer import lex
def test_lexing():
token = lex("+ - * / ++ %")
assert Token("Plus", "+") == token[0]
assert Token("Minus", "-") == token[1]
assert Token("Multiply", "*") == token[2]
assert Token("Divide", "/") == token[3]
assert Token("Increment", "++") == token[4]
assert Token("Modulo", "%") == token[5]