You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Two points that could be improved in Parser.pattern:
For choices, patterns are always processed but for lines, patterns are only processed if the line has a tag. I don't see why this should be a requirement.
RegExp patterns are only processed if one wraps a regexp in the RegExp function (without new)
Parser.pattern(/foo/, () => {}) will not be processed
Parser.pattern(new RegExp("foo"), () => {}) will not be processed
Parser.pattern(RegExp("foo"), () => {}) will be processed
Parser.pattern(RegExp(/foo/), () => {}) will be processed
I don't see a reason for this restriction. It's fixable by replacing pattern.matcher == RegExp(pattern.matcher) with `pattern.match instanceof RegExp, which will work for all 4 cases.
The text was updated successfully, but these errors were encountered:
Two points that could be improved in
Parser.pattern
:pattern.matcher == RegExp(pattern.matcher)
with `pattern.match instanceof RegExp, which will work for all 4 cases.The text was updated successfully, but these errors were encountered: