Renamed language option constants

This commit is contained in:
Daniel Holden
2014-04-15 16:06:59 +01:00
parent 0164931350
commit 8d0ee197e1
8 changed files with 18 additions and 18 deletions

View File

@@ -11,9 +11,9 @@ void test_grammar(void) {
Value = mpc_new("value");
Maths = mpc_new("maths");
mpc_define(Expr, mpca_grammar(MPC_LANG_DEFAULT, " <product> (('+' | '-') <product>)* ", Prod));
mpc_define(Prod, mpca_grammar(MPC_LANG_DEFAULT, " <value> (('*' | '/') <value>)* ", Value));
mpc_define(Value, mpca_grammar(MPC_LANG_DEFAULT, " /[0-9]+/ | '(' <expression> ')' ", Expr));
mpc_define(Expr, mpca_grammar(MPCA_LANG_DEFAULT, " <product> (('+' | '-') <product>)* ", Prod));
mpc_define(Prod, mpca_grammar(MPCA_LANG_DEFAULT, " <value> (('*' | '/') <value>)* ", Value));
mpc_define(Value, mpca_grammar(MPCA_LANG_DEFAULT, " /[0-9]+/ | '(' <expression> ')' ", Expr));
mpc_define(Maths, mpca_total(Expr));
t0 = mpc_ast_new("product|value|regex", "24");
@@ -66,7 +66,7 @@ void test_language(void) {
Value = mpc_new("value");
Maths = mpc_new("maths");
mpca_lang(MPC_LANG_DEFAULT,
mpca_lang(MPCA_LANG_DEFAULT,
" \
expression : <product> (('+' | '-') <product>)*; \
product : <value> (('*' | '/') <value>)*; \
@@ -87,7 +87,7 @@ void test_language_file(void) {
Value = mpc_new("value");
Maths = mpc_new("maths");
mpca_lang_contents(MPC_LANG_DEFAULT,"./tests/maths.grammar", Expr, Prod, Value, Maths);
mpca_lang_contents(MPCA_LANG_DEFAULT,"./tests/maths.grammar", Expr, Prod, Value, Maths);
mpc_cleanup(4, Expr, Prod, Value, Maths);