From 7ff2b7d587b1b91dffdc16bff33fd1da56e2ab8b Mon Sep 17 00:00:00 2001 From: mbkma Date: Sun, 21 Jun 2020 01:48:25 +0200 Subject: fixes incorrect parenthesis handling reverts commit 731bdfe3591618759a44d9382b49952e781a01bd --- src/parser.c | 1 - src/test-mp-equation.c | 7 ++++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/parser.c b/src/parser.c index 633bc2f..b8cc98f 100644 --- a/src/parser.c +++ b/src/parser.c @@ -1050,7 +1050,6 @@ variable(ParserState* state) if(token->token_type == T_FUNCTION) { - state->depth_level++; token_old = token; token = l_get_next_token(state->lexer); if(token->token_type == T_SUP_NUMBER) diff --git a/src/test-mp-equation.c b/src/test-mp-equation.c index c6ab98c..adf6c06 100644 --- a/src/test-mp-equation.c +++ b/src/test-mp-equation.c @@ -387,14 +387,15 @@ test_equations(void) test ("20 / 10 mod 3", "2", 0); test ("12 / 3 √4", "8", 0); test ("√5!", "10.95445115", 0); - test ("4 ^ sin 30", "2", 0); + //test ("4 ^ sin 30", "2", 0); test ("4 ^ (sin 30)", "2", 0); - test ("4 ^ sin (30)", "2", 0); + //test ("4 ^ sin (30)", "2", 0); //test ("sin (30) ^ 4", "0.0625", 0); //test ("sin 30 ^ 4", "0.0625", 0); test ("sin (30 ^ 4)", "0", 0); - test ("-ln(1)", "0", 0); + //test ("-ln(1)", "0", 0); test ("ln(-1)", "3.141592654i", 0); + test ("2.33*sqrt(2.5)+6", "9.684053474", 0); test ("10 / - 2", "−5", 0); test ("10 * - 2", "−20", 0); -- cgit v1.2.1