Commit db692be1 authored by Taddeus Kroes's avatar Taddeus Kroes

Improved preprocessor.

parent b04cf62c
...@@ -103,3 +103,5 @@ Division of 0 by 1 reduces to 0. ...@@ -103,3 +103,5 @@ Division of 0 by 1 reduces to 0.
- No matches for sin(pi), sin(2pi), sin(4pi), etc... - No matches for sin(pi), sin(2pi), sin(4pi), etc...
- Line generator: 'der(f(x), x)' -> 'd/dx f(x)' - Line generator: 'der(f(x), x)' -> 'd/dx f(x)'
- Create unit tests for parser preprocessor.
...@@ -160,6 +160,7 @@ class Parser(BisonParser): ...@@ -160,6 +160,7 @@ class Parser(BisonParser):
# - "a4" with "a^4". # - "a4" with "a^4".
pattern = ('(?:(\))\s*(\()' # )( -> ) * ( pattern = ('(?:(\))\s*(\()' # )( -> ) * (
+ '|(\))\s*(\[)' # )[ -> ) * [
+ '|([\x00-\x09\x0b-\x19a-z0-9])\s*(\()' # a( -> a * ( + '|([\x00-\x09\x0b-\x19a-z0-9])\s*(\()' # a( -> a * (
+ '|(\))\s*([\x00-\x09\x0b-\x19a-z0-9])' # )a -> ) * a + '|(\))\s*([\x00-\x09\x0b-\x19a-z0-9])' # )a -> ) * a
+ '|([\x00-\x09\x0b-\x19a-z])\s*' + '|([\x00-\x09\x0b-\x19a-z])\s*'
......
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