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

@@ -67,12 +67,10 @@ void test_language(void) {
Maths = mpc_new("maths");
mpca_lang(MPCA_LANG_DEFAULT,
" \
expression : <product> (('+' | '-') <product>)*; \
product : <value> (('*' | '/') <value>)*; \
value : /[0-9]+/ | '(' <expression> ')'; \
maths : /^/ <expression> /$/; \
",
" expression : <product> (('+' | '-') <product>)*; "
" product : <value> (('*' | '/') <value>)*; "
" value : /[0-9]+/ | '(' <expression> ')'; "
" maths : /^/ <expression> /$/; ",
Expr, Prod, Value, Maths);
mpc_cleanup(4, Expr, Prod, Value, Maths);