소스 검색

Improved preprocessor.

Taddeus Kroes 14 년 전
부모
커밋
db692be17b
2개의 변경된 파일3개의 추가작업 그리고 0개의 파일을 삭제
  1. 2 0
      TODO
  2. 1 0
      src/parser.py

+ 2 - 0
TODO

@@ -103,3 +103,5 @@ Division of 0 by 1 reduces to 0.
  - No matches for sin(pi), sin(2pi), sin(4pi), etc...
 
  - Line generator: 'der(f(x), x)'  ->  'd/dx f(x)'
+
+ - Create unit tests for parser preprocessor.

+ 1 - 0
src/parser.py

@@ -160,6 +160,7 @@ class Parser(BisonParser):
         #   - "a4" with "a^4".
 
         pattern = ('(?:(\))\s*(\()'                       # )(  -> ) * (
+                + '|(\))\s*(\[)'                          # )[  -> ) * [
                 + '|([\x00-\x09\x0b-\x19a-z0-9])\s*(\()'  # a(  -> a * (
                 + '|(\))\s*([\x00-\x09\x0b-\x19a-z0-9])'  # )a  -> ) * a
                 + '|([\x00-\x09\x0b-\x19a-z])\s*'