Mercurial > lbo > hg > pcombinators
changeset 44:990d234e1488 draft
arith_test: More performance, 1
author | Lewin Bormann <lbo@spheniscida.de> |
---|---|
date | Thu, 23 May 2019 21:40:34 +0200 |
parents | 2ff88b76c661 |
children | 2bce673577a2 |
files | pcombinators/arith_test.py |
diffstat | 1 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/pcombinators/arith_test.py Thu May 23 20:02:08 2019 +0200 +++ b/pcombinators/arith_test.py Thu May 23 21:40:34 2019 +0200 @@ -16,11 +16,11 @@ def Variable(): """A variable consists of several letters.""" - return Last(Skip(Whitespace()) + Regex('[a-zA-Z]+[0-9]*')) + return Regex('[a-zA-Z]+[0-9]*') def Atom(): """An atom is a variable or a float or a parentheses term.""" - return (Variable() | Parens() | Last(Skip(Whitespace()) + Float())) + return Skip(Whitespace()).then((Variable() | Parens() | Float())) def Operator(set): """An operator or parenthesis."""