From 83d41cd653853d77aa6f26c6e1f85d2dbb151f98 Mon Sep 17 00:00:00 2001 From: AAAlex-123 <60742680+AAAlex-123@users.noreply.github.com> Date: Wed, 15 Dec 2021 15:50:43 +0200 Subject: [PATCH] kinda restored some stuff --- minipython.grammar | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/minipython.grammar b/minipython.grammar index ecff58c..fd79905 100644 --- a/minipython.grammar +++ b/minipython.grammar @@ -107,8 +107,14 @@ Productions | {empty_line} tab*; /* EXPRESSION DEFINITION */ - expression = - {num_exp} numerical_expression; + expression = {num_exp} numerical_expression + | {id_bracket} identifier l_br expression r_br + | {func_call} function_call + /*| {value} value*/ + | {id} identifier + | {len_exp} length l_par expression r_par + | {minimax} minimax l_par value comma_value* r_par + | {brackets} l_br expression expression_list* r_br; /* First the lowest priority expression aka addition and subtraction. */ numerical_expression = {res2} res2 @@ -122,8 +128,8 @@ Productions | {modulo} res2 op_mod res3; /* Lastly, in the highest priority order, the exponentiation and number literal/identifier definition. */ - res3 = {value} value - | {exponentiation} res3 op_exp value; + res3 = {exponentiation} res3 op_exp expression + | {value} value; /* IMPORT STATEMENTS */ import_stmt = {import_module} import module import_as? more_modules* @@ -164,14 +170,7 @@ Productions | {num} number | {str_double} string | {str_single} string_s - | {none} none - | {id} id - | {parentheses} l_par numerical_expression r_par - | {id_bracket} identifier l_br expression r_br - | {func_call} function_call - | {len_exp} length l_par expression r_par - | {minimax} minimax l_par value comma_value* r_par - | {brackets} l_br expression expression_list* r_br; + | {none} none; identifier = {identifier} id;