Commit 3b10ae04 authored by Igor Dejanovic's avatar Igor Dejanovic

Fixing speed test.

parent e0a3a087
...@@ -21,9 +21,9 @@ from arpeggio import OneOrMore, ZeroOrMore, EOF, ParserPython, Optional ...@@ -21,9 +21,9 @@ from arpeggio import OneOrMore, ZeroOrMore, EOF, ParserPython, Optional
from arpeggio import RegExMatch as _ from arpeggio import RegExMatch as _
def number(): return _(r'\d*\.\d*|\d+') def number(): return _(r'\d*\.\d*|\d+')
def factor(): return [(Optional(["+","-"]), number), ("(", expression, ")")] def factor(): return [(Optional([u"+",u"-"]), number), (u"(", expression, u")")]
def term(): return factor, ZeroOrMore(["*","/"], factor) def term(): return factor, ZeroOrMore([u"*",u"/"], factor)
def expression(): return term, ZeroOrMore(["+", "-"], term) def expression(): return term, ZeroOrMore([u"+", u"-"], term)
def calcfile(): return OneOrMore(expression), EOF def calcfile(): return OneOrMore(expression), EOF
parser = ParserPython(calcfile, reduce_tree=True) parser = ParserPython(calcfile, reduce_tree=True)
......
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