Fixed bug in state tagging. Updated examples to use concatinated preprocessor strings

This commit is contained in:
Daniel Holden
2014-04-16 17:06:16 +01:00
parent 842835aaa5
commit 8d9bf9fdda
7 changed files with 95 additions and 80 deletions

View File

@@ -12,17 +12,15 @@ int main(int argc, char **argv) {
mpc_parser_t* Lispy = mpc_new("lispy");
mpca_lang(MPCA_LANG_PREDICTIVE,
" \
number \"number\" : /[0-9]+/ ; \
symbol \"symbol\" : /[a-zA-Z0-9_+\\-*\\/\\\\=<>!&]+/ ; \
string \"string\" : /\"(\\\\.|[^\"])*\"/ ; \
comment : /;[^\\r\\n]*/ ; \
sexpr : '(' <expr>* ')' ; \
qexpr : '{' <expr>* '}' ; \
expr : <number> | <symbol> | <string> \
| <comment> | <sexpr> | <qexpr> ; \
lispy : /^/ <expr>* /$/ ; \
",
" number \"number\" : /[0-9]+/ ; "
" symbol \"symbol\" : /[a-zA-Z0-9_+\\-*\\/\\\\=<>!&]+/ ; "
" string \"string\" : /\"(\\\\.|[^\"])*\"/ ; "
" comment : /;[^\\r\\n]*/ ; "
" sexpr : '(' <expr>* ')' ; "
" qexpr : '{' <expr>* '}' ; "
" expr : <number> | <symbol> | <string> "
" | <comment> | <sexpr> | <qexpr> ; "
" lispy : /^/ <expr>* /$/ ; ",
Number, Symbol, String, Comment, Sexpr, Qexpr, Expr, Lispy);
if (argc > 1) {