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

Fix wrong parse of (def()->string 'foo')(). #241

Merged
merged 1 commit into from Feb 4, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/formula.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4453,7 +4453,12 @@ static std::string debugSubexpressionTypes(ConstFormulaPtr & fml)

if(op == nullptr) {
if(i1->type == FFL_TOKEN_TYPE::LPARENS && (i2-1)->type == FFL_TOKEN_TYPE::RPARENS) {
// This `if` will prevent ` ( def ( ) -> int 32993 ) ( ) `
// from being incorrectly interpreted as that
// ` def ( ) -> int 32993 ) ( ` must be parsed.
if (i2 - 2 >= i1 && (i2 - 2)->type != FFL_TOKEN_TYPE::LPARENS) {
return parse_expression(formula_str, i1+1,i2-1,symbols, callable_def, can_optimize);
}
} else if( (i2-1)->type == FFL_TOKEN_TYPE::RSQUARE) { //check if there is [ ] : either a list definition, or a operator
const Token* tok = i2-2;
int square_parens = 0;
Expand Down