From 6400b4ecce681d698e47a1744c2f2f8f847476d9 Mon Sep 17 00:00:00 2001 From: Danny van Kooten Date: Thu, 19 Mar 2020 20:09:40 +0100 Subject: add note for > and < precedence --- src/template.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src') 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 : '(' ')' | | | ;" " term : ( ('*' | '/' | '%') )* ;" + /* TODO: move > and < to lower predence grammar group */ " expression: ( ('+' | '-' | '>' | '<') )* ;" " print : /{{2}-? */ / *-?}}/ ;" " comment : \"{#\" /[^#][^#}]*/ \"#}\" ;" @@ -109,7 +108,6 @@ mpc_parser_t *parser_init() { spaces, factor, term, symbol, - op, text, number, string, -- cgit v1.2.3