Browse Source

Some bonus marks

T. Meissner 6 months ago
parent
commit
c51df4a3cb
1 changed files with 3 additions and 3 deletions
  1. 3
    3
      chapter_06/parsing.c

+ 3
- 3
chapter_06/parsing.c View File

@@ -42,15 +42,15 @@ int main(int argc, char const *argv[])
42 42
     /* Define them with the following language */
43 43
     mpca_lang(MPCA_LANG_DEFAULT,
44 44
         "                                                        \
45
-            number   : /-?[0-9]+/ ;                              \
46
-            operator : '+' | '-' | '*' | '/' ;                   \
45
+            number   : /-?[0-9]([.][0-9]+)*/ ;                   \
46
+            operator : '+' | '-' | '*' | '/' | '%' ;             \
47 47
             expr     : <number> |  '(' <operator> <expr>+ ')' ;  \
48 48
             lispy    : /^/ <operator> <expr>+ /$/ ;              \
49 49
         ",
50 50
         Number, Operator, Expr, Lispy);
51 51
 
52 52
     /* Print version and exit information */
53
-    puts("Lispy version 0.0.0.0.1");
53
+    puts("Lispy version 0.0.0.0.2");
54 54
     puts("Press Ctrl+c to exit\n");
55 55
 
56 56
     /* In a never ending loop */