Reverted the previous change. The version number is unchanged.
authorimode <immediate.mode@gmail.com>
Thu, 15 Nov 2018 18:29:11 +0000 (10:29 -0800)
committerimode <immediate.mode@gmail.com>
Thu, 15 Nov 2018 18:29:11 +0000 (10:29 -0800)
modal.py

index c6e3fee..e8a8be9 100644 (file)
--- a/modal.py
+++ b/modal.py
@@ -220,7 +220,7 @@ def literal(string, index=0):
         index = index + 1;
     return (token, index);
 
-def parse(string, index=0, query=False):
+def parse(string, index=0):
     results = [];
     while index != len(string):
         character = string[index];
@@ -233,8 +233,6 @@ def parse(string, index=0, query=False):
         elif character not in [' ', '\t', '\n', '\r']:
             token, index = literal(string, index);
             if character == '?':
-                if query:
-                    results.append(["LIT", "var"]);
                 results.append(["VAR", token]);
             elif number(token):
                 results.append(["LIT", "num"]);
@@ -330,7 +328,7 @@ def main():
             break;
         else:
             print("Reducing...");
-            print(inspect(seek(run(rules, parse(input, 0, True)), ["SRT"])));
+            print(inspect(seek(run(rules, parse(input)), ["SRT"])));
     return;
 
 if __name__ == "__main__":