]> git.kaiwu.me - klib.git/commitdiff
fixed a bug related to functions
authorHeng Li <lh3@me.com>
Fri, 22 May 2015 01:54:10 +0000 (21:54 -0400)
committerHeng Li <lh3@me.com>
Fri, 22 May 2015 01:54:10 +0000 (21:54 -0400)
kexpr.c

diff --git a/kexpr.c b/kexpr.c
index b5e2988dee4a7795c99653b4a248fa64ae567f27..83dba2cc2bdb2031b0834efddd4235f0215a1605 100644 (file)
--- a/kexpr.c
+++ b/kexpr.c
@@ -193,6 +193,10 @@ static ke1_t *ke_parse_core(const char *_s, int *_n, int *err)
                                *err |= KEE_UNRP;
                                break;
                        } else --n_op; // pop out '('
+                       if (n_op > 0 && op[n_op-1].ttype == KET_FUNC) {
+                               u = push_back(&out, &n_out, &m_out);
+                               *u = op[--n_op];
+                       }
                        ++p;
                } else if (*p == ',') {
                        while (n_op > 0 && op[n_op-1].op >= 0) {