Move plugin check to pipeline op appearance
No need to recheck it throughout then.
This commit is contained in:
parent
a0e94ec24d
commit
0eb9b2463d
@ -298,6 +298,7 @@ export default class ExpressionParser extends LValParser {
|
||||
const op = this.state.type;
|
||||
|
||||
if (op === tt.pipeline) {
|
||||
this.expectPlugin("pipelineOperator");
|
||||
this.state.inPipeline = true;
|
||||
this.checkPipelineAtInfixOperator(left, leftStartPos);
|
||||
} else if (op === tt.nullishCoalescing) {
|
||||
@ -958,7 +959,6 @@ export default class ExpressionParser extends LValParser {
|
||||
|
||||
case tt.hash: {
|
||||
if (this.state.inPipeline) {
|
||||
this.expectPlugin("pipelineOperator");
|
||||
node = this.startNode();
|
||||
|
||||
if (
|
||||
@ -2034,8 +2034,6 @@ export default class ExpressionParser extends LValParser {
|
||||
// of the infix operator `|>`.
|
||||
|
||||
checkPipelineAtInfixOperator(left: N.Expression, leftStartPos: number) {
|
||||
this.expectPlugin("pipelineOperator");
|
||||
|
||||
if (this.getPluginOption("pipelineOperator", "proposal") === "smart") {
|
||||
if (left.type === "SequenceExpression") {
|
||||
// Ensure that the pipeline head is not a comma-delimited
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user