From: DeaDDooMER Date: Sun, 13 Aug 2017 13:25:44 +0000 (+0300) Subject: Унарный минус работает как описанов в Дубовых требованиях X-Git-Url: http://deadsoftware.ru/gitweb?p=dsw-obn.git;a=commitdiff_plain;h=d4c8198d236035324c6ebf07deb79e73bb062af9 Унарный минус работает как описанов в Дубовых требованиях --- diff --git a/notes b/notes index 03a10c9..b09a685 100644 --- a/notes +++ b/notes @@ -17,7 +17,6 @@ 3.5 Interfacing to External Libraries 3.6 Underscores in Identifiers 3.7 In-line Exponentiation - 5.10 Monadic ‘-’: -5 MOD 3 is equivalent to -(5 MOD 3) 5.13 Read only VAR Parameters 1.2.5 Module Files 1.2.6 Module Strings diff --git a/src/oberon.c b/src/oberon.c index 8b94271..830844a 100644 --- a/src/oberon.c +++ b/src/oberon.c @@ -1958,11 +1958,6 @@ oberon_simple_expr(oberon_context_t * ctx) expr = oberon_term_expr(ctx); - if(minus) - { - expr = oberon_make_unary_op(ctx, MINUS, expr); - } - while(ISADDOP(ctx -> token)) { int token = ctx -> token; @@ -1972,6 +1967,11 @@ oberon_simple_expr(oberon_context_t * ctx) expr = oberon_make_bin_op(ctx, token, expr, inter); } + if(minus) + { + expr = oberon_make_unary_op(ctx, MINUS, expr); + } + return expr; }