We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
If you write a rule that contains code that references an AS parse expression, it will throw an error if the rule is not matched:
foo | :FOO as :value |> 'return $.value.length' | bar ;
it will throw cannot get .length of null, even if foo is not matched and the rule falls through to bar.
cannot get .length of null
Seems like the AS combinator is missing a check:
--- a/lib/parsers/combinators/as.js +++ b/lib/parsers/combinators/as.js @@ -13,7 +13,7 @@ module.exports = class As { parse (tokens) { const result = this.lhs.parse(tokens).clone() result.matched = { name: this.name, value: result.matched } - if (this.code) result.matched = Evaluator.eval(this.code, result.matched) + if (result.success && this.code) result.matched = Evaluator.eval(this.code, result.matched) return result }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
If you write a rule that contains code that references an AS parse expression, it will throw an error if the rule is not matched:
foo
| :FOO as :value
|> 'return $.value.length'
| bar
;
it will throw
cannot get .length of null
, even if foo is not matched and the rule falls through to bar.Seems like the AS combinator is missing a check:
The text was updated successfully, but these errors were encountered: