Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: cannot parse function name ending with number #27

Open
vvvbit opened this issue Sep 1, 2019 · 0 comments
Open

Bug: cannot parse function name ending with number #27

vvvbit opened this issue Sep 1, 2019 · 0 comments
Labels

Comments

@vvvbit
Copy link

vvvbit commented Sep 1, 2019

Hello. I found that parser cannot properly parse function names ending with number like f1() or test5(). It adds extra token * between function name and opening "(".
so list of tokens looks like: [f1, , (, )] [test5,,(,)]

Here is my correction for method private List Lexer(string expr)

if (ch == '(') {
   if (i != 0 && (char.IsDigit(expr[i - 1]) || expr[i - 1] == ')')) {
      //correction start
     if (expr[i-1] == ')'||!LocalFunctions.Keys.Contains(tokens[tokens.Count-1])) {
         tokens.Add("*");
     }
     //correction end
     tokens.Add("(");
   }
   else {
      tokens.Add("(");
   }
}
else {
    tokens.Add(ch.ToString());
}
@napen123 napen123 added the bug label Oct 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants