Added SQRT token for square roots.

parent a836452c
...@@ -53,7 +53,7 @@ class Parser(BisonParser): ...@@ -53,7 +53,7 @@ class Parser(BisonParser):
tokens = ['NUMBER', 'IDENTIFIER', 'POSSIBILITIES', tokens = ['NUMBER', 'IDENTIFIER', 'POSSIBILITIES',
'PLUS', 'MINUS', 'TIMES', 'DIVIDE', 'POW', 'PLUS', 'MINUS', 'TIMES', 'DIVIDE', 'POW',
'LPAREN', 'RPAREN', 'COMMA', 'HINT', 'REWRITE', 'LPAREN', 'RPAREN', 'COMMA', 'HINT', 'REWRITE',
'NEWLINE', 'QUIT', 'RAISE', 'GRAPH'] 'NEWLINE', 'QUIT', 'RAISE', 'GRAPH', 'SQRT']
# ------------------------------ # ------------------------------
# precedences # precedences
...@@ -356,6 +356,7 @@ class Parser(BisonParser): ...@@ -356,6 +356,7 @@ class Parser(BisonParser):
"quit" { yyterminate(); returntoken(QUIT); } "quit" { yyterminate(); returntoken(QUIT); }
"raise" { returntoken(RAISE); } "raise" { returntoken(RAISE); }
"graph" { returntoken(GRAPH); } "graph" { returntoken(GRAPH); }
"sqrt" { returntoken(SQRT); }
[ \t\v\f] { } [ \t\v\f] { }
[\n] { yycolumn = 0; returntoken(NEWLINE); } [\n] { yycolumn = 0; returntoken(NEWLINE); }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment