aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDanny van Kooten <dannyvankooten@users.noreply.github.com>2020-03-19 20:09:40 +0100
committerDanny van Kooten <dannyvankooten@users.noreply.github.com>2020-03-19 20:09:40 +0100
commit6400b4ecce681d698e47a1744c2f2f8f847476d9 (patch)
tree63fb95cd8fb46efe0ee886dc8fd72916712ad115
parentfd6465aad222a00d4c805043b7c0cf3b2d0f3c6b (diff)
downloadunja-6400b4ecce681d698e47a1744c2f2f8f847476d9.tar.gz
unja-6400b4ecce681d698e47a1744c2f2f8f847476d9.zip
add note for > and < precedence
-rw-r--r--src/template.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/template.c b/src/template.c
index 7b0d65b..410ead7 100644
--- a/src/template.c
+++ b/src/template.c
@@ -66,7 +66,6 @@ mpc_parser_t *parser_init() {
mpc_parser_t *symbol = mpc_new("symbol");
mpc_parser_t *number = mpc_new("number");
mpc_parser_t *string = mpc_new("string");
- mpc_parser_t *op = mpc_new("op");
mpc_parser_t *text = mpc_new("text");
mpc_parser_t *print = mpc_new("print");
mpc_parser_t *expression = mpc_new("expression");
@@ -90,9 +89,9 @@ mpc_parser_t *parser_init() {
" number : /[0-9]+/ ;"
" text : /[^{][^{%#]*/;"
" string : '\"' /([^\"])*/ '\"' ;"
- " op : '+' | '-' | '*' | '/' | '>' | '<';"
" factor : '(' <expression> ')' | <symbol> | <number> | <string> ;"
" term : <factor> (<spaces> ('*' | '/' | '%') <spaces> <factor>)* ;"
+ /* TODO: move > and < to lower predence grammar group */
" expression: <term> (<spaces> ('+' | '-' | '>' | '<') <spaces> <term>)* ;"
" print : /{{2}-? */ <expression> / *-?}}/ ;"
" comment : \"{#\" /[^#][^#}]*/ \"#}\" ;"
@@ -109,7 +108,6 @@ mpc_parser_t *parser_init() {
spaces,
factor, term,
symbol,
- op,
text,
number,
string,