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;
|
const op = this.state.type;
|
||||||
|
|
||||||
if (op === tt.pipeline) {
|
if (op === tt.pipeline) {
|
||||||
|
this.expectPlugin("pipelineOperator");
|
||||||
this.state.inPipeline = true;
|
this.state.inPipeline = true;
|
||||||
this.checkPipelineAtInfixOperator(left, leftStartPos);
|
this.checkPipelineAtInfixOperator(left, leftStartPos);
|
||||||
} else if (op === tt.nullishCoalescing) {
|
} else if (op === tt.nullishCoalescing) {
|
||||||
@ -958,7 +959,6 @@ export default class ExpressionParser extends LValParser {
|
|||||||
|
|
||||||
case tt.hash: {
|
case tt.hash: {
|
||||||
if (this.state.inPipeline) {
|
if (this.state.inPipeline) {
|
||||||
this.expectPlugin("pipelineOperator");
|
|
||||||
node = this.startNode();
|
node = this.startNode();
|
||||||
|
|
||||||
if (
|
if (
|
||||||
@ -2034,8 +2034,6 @@ export default class ExpressionParser extends LValParser {
|
|||||||
// of the infix operator `|>`.
|
// of the infix operator `|>`.
|
||||||
|
|
||||||
checkPipelineAtInfixOperator(left: N.Expression, leftStartPos: number) {
|
checkPipelineAtInfixOperator(left: N.Expression, leftStartPos: number) {
|
||||||
this.expectPlugin("pipelineOperator");
|
|
||||||
|
|
||||||
if (this.getPluginOption("pipelineOperator", "proposal") === "smart") {
|
if (this.getPluginOption("pipelineOperator", "proposal") === "smart") {
|
||||||
if (left.type === "SequenceExpression") {
|
if (left.type === "SequenceExpression") {
|
||||||
// Ensure that the pipeline head is not a comma-delimited
|
// Ensure that the pipeline head is not a comma-delimited
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user