Browse Source

Some bonus marks

master
T. Meissner 5 years 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[])
/* Define them with the following language */ /* Define them with the following language */
mpca_lang(MPCA_LANG_DEFAULT, mpca_lang(MPCA_LANG_DEFAULT,
" \ " \
number : /-?[0-9]+/ ; \
operator : '+' | '-' | '*' | '/' ; \
number : /-?[0-9]([.][0-9]+)*/ ; \
operator : '+' | '-' | '*' | '/' | '%' ; \
expr : <number> | '(' <operator> <expr>+ ')' ; \ expr : <number> | '(' <operator> <expr>+ ')' ; \
lispy : /^/ <operator> <expr>+ /$/ ; \ lispy : /^/ <operator> <expr>+ /$/ ; \
", ",
Number, Operator, Expr, Lispy); Number, Operator, Expr, Lispy);
/* Print version and exit information */ /* Print version and exit information */
puts("Lispy version 0.0.0.0.1");
puts("Lispy version 0.0.0.0.2");
puts("Press Ctrl+c to exit\n"); puts("Press Ctrl+c to exit\n");
/* In a never ending loop */ /* In a never ending loop */


Loading…
Cancel
Save