Avoid lookahead when parsing pipeline
The error message is worse, but it is much more performant.
This commit is contained in:
parent
7142a79eb9
commit
71fd37067e
@ -310,15 +310,6 @@ export default class ExpressionParser extends LValParser {
|
||||
const startLoc = this.state.startLoc;
|
||||
|
||||
if (op === tt.pipeline) {
|
||||
const lookahead = this.lookahead();
|
||||
|
||||
if (lookahead.type === tt.arrow) {
|
||||
throw this.raise(
|
||||
this.state.start,
|
||||
`Unexpected arrow "=>" after pipeline body; arrow function in pipeline body must be parenthesized`, // eslint-disable-line
|
||||
);
|
||||
}
|
||||
|
||||
if (
|
||||
this.match(tt.name) &&
|
||||
this.state.value === "await" &&
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
{
|
||||
"plugins": ["pipelineOperator"],
|
||||
"throws": "Unexpected arrow \"=>\" after pipeline body; arrow function in pipeline body must be parenthesized (1:6)"
|
||||
"throws": "Unexpected token, expected \";\" (1:8)"
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user