Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[[FIX]] Correct invalid function invocation
The second parameter of the `expression` function accepts a value that modifies how the next token is parsed. When set to `true`, the token is interpreted as the beginning of a statement; otherwise, it is interpreted as the beginning of an expression. Two call sites within the `for` statement's parsing logic specified the string value `"for"`. Due to inconsistencies in how the parameter was interpreted internally, this causes `expression` to mix parsing strategies. Specifically: - It used the "statement" parsing strategy to mark the token value as beginning a statement. This could be observed in the application of the `singleGroups` linting option. Further, it disqualify it for consideration as a Mozilla "let expression" - It used the "expression" parsing strategy to ignore the token's `fud` method Since the grammar does not allow a statement in either location, the "expression" parsing strategy should be used consistently. Achieve this by removing the argument from the call site, thereby falling back to the default behavior of the `expression` function. Update `expression` to consistently interpret the parameter for "truthiness" in order to discourage similar ambiguity in the future.
- Loading branch information
1 parent
58967ea
commit cda02ae
Showing
3 changed files
with
19 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters