summaryrefslogtreecommitdiff
path: root/src/parser.c
diff options
context:
space:
mode:
authormbkma <[email protected]>2020-01-02 16:53:11 +0100
committerraveit65 <[email protected]>2020-01-12 14:59:36 +0100
commitd15bf0bc9df66506e5073caefda5e7fcdc3f427a (patch)
tree08188e1adbb72cf0efba2444761b097591a4fd39 /src/parser.c
parent6d270dcc067da3ef5cc497339f2652c2f2c3911c (diff)
downloadmate-calc-d15bf0bc9df66506e5073caefda5e7fcdc3f427a.tar.bz2
mate-calc-d15bf0bc9df66506e5073caefda5e7fcdc3f427a.tar.xz
fixes precedence of functions i.e. the result of -ln(1) and add according tests
Diffstat (limited to 'src/parser.c')
-rw-r--r--src/parser.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/parser.c b/src/parser.c
index fb4fd12..b4f90fc 100644
--- a/src/parser.c
+++ b/src/parser.c
@@ -1044,8 +1044,10 @@ variable(ParserState* state)
LexerToken* token_old;
ParseNode* node;
token = l_get_next_token(state->lexer);
+
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)