From 8ee5ec8905930591aa5dd592b0e7aac9779214e9 Mon Sep 17 00:00:00 2001 From: nishi Date: Sun, 5 May 2024 16:54:21 +0000 Subject: [PATCH] fix math op git-svn-id: file:///raid/svn-main/nishi-serenade/trunk@112 0f02c867-ac3d-714e-8a88-971ba1f6efcf --- Serenade/parser.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Serenade/parser.c b/Serenade/parser.c index 930cf39..58c4ba7 100644 --- a/Serenade/parser.c +++ b/Serenade/parser.c @@ -147,6 +147,13 @@ struct sn_generic* sn_expr_parse(char* data, unsigned long long size) { } else { if(c == ' ' || c == '\n' || c == '\t') { if(strlen(argbuf) > 0) { + if(strlen(argbuf) == 1 && argbuf[0] == '-') { + if(index_stack[br - 1] == 0) { + argbufmode = SN_TYPE_FUNCTION; + } else { + argbufmode = SN_TYPE_VARIABLE; + } + } push_stack(gn_stack[br - 1], argbuf, argbufmode); index_stack[br - 1]++; } -- 2.43.0