Jelajahi Sumber

Fixed merge conflict in TODO list.

Sander Mathijs van Veen 14 tahun lalu
induk
melakukan
dd5f8afcd9
2 mengubah file dengan 16 tambahan dan 1 penghapusan
  1. 14 1
      TODO
  2. 2 0
      src/rules/numerics.py

+ 14 - 1
TODO

@@ -1,3 +1,5 @@
+# vim: set fileencoding=utf-8 :
+
  - Fix BisonSyntaxError location tracking.
 
  - Sort polynom by its exponents?
@@ -70,7 +72,6 @@ Division of 0 by 1 reduces to 0.
    >>> @
    2 / 7 + 4 / 11
 
-
  - Cancel terms before multiplying constants: (3 * ...) / (3 * ...) -> ... / ...
     >>> (7/3)*(3/5)
     7 / 3 * (3 / 5)
@@ -89,3 +90,15 @@ Division of 0 by 1 reduces to 0.
     >>> @
     7 / 5
 
+ - filter_duplicates does not seem to work anymore...
+
+ - Fix error while parsing unicode PI:
+   >>> sin(1/2 * pi)
+   sin(1 / 2 * π)
+   >>> @
+   unknown char � ignored.
+   unknown char � ignored.
+   ERROR: 41.7-41.8: "syntax error, unexpected TIMES" near "*".
+   ERROR: 41.14-41.15: "syntax error, unexpected RPAREN" near ")".
+
+ - No matches for sin(pi), sin(2pi), sin(4pi), etc...

+ 2 - 0
src/rules/numerics.py

@@ -114,10 +114,12 @@ def match_divide_numerics(node):
 
         if 1 < gcd <= nv:
             # 2 / 4  ->  1 / 2
+            # TODO: Test with negations!
             return [P(node, reduce_fraction_constants, (gcd,))]
 
         if nv > dv:
             # 4 / 3  ->  1 + 1 / 3
+            # TODO: Test with negations!
             return [P(node, fraction_to_int_fraction,
                       ((nv - mod) / dv, mod, dv))]
     elif n.is_numeric() and d.is_numeric():