Reverse yoda conditions
If "smart" proposal is, we'll no longer say.
This commit is contained in:
parent
fbf62b4830
commit
ef0f723fc5
@ -307,7 +307,7 @@ export default class ExpressionParser extends LValParser {
|
|||||||
|
|
||||||
if (
|
if (
|
||||||
op === tt.pipeline &&
|
op === tt.pipeline &&
|
||||||
"minimal" === this.getPluginOption("pipelineOperator", "proposal")
|
this.getPluginOption("pipelineOperator", "proposal") === "minimal"
|
||||||
) {
|
) {
|
||||||
if (
|
if (
|
||||||
this.match(tt.name) &&
|
this.match(tt.name) &&
|
||||||
@ -354,7 +354,7 @@ export default class ExpressionParser extends LValParser {
|
|||||||
): N.Expression {
|
): N.Expression {
|
||||||
switch (op) {
|
switch (op) {
|
||||||
case tt.pipeline:
|
case tt.pipeline:
|
||||||
if ("smart" === this.getPluginOption("pipelineOperator", "proposal")) {
|
if (this.getPluginOption("pipelineOperator", "proposal") === "smart") {
|
||||||
const startPos = this.state.start;
|
const startPos = this.state.start;
|
||||||
const startLoc = this.state.startLoc;
|
const startLoc = this.state.startLoc;
|
||||||
return this.withTopicPermittingContext(() => {
|
return this.withTopicPermittingContext(() => {
|
||||||
@ -1995,7 +1995,7 @@ export default class ExpressionParser extends LValParser {
|
|||||||
checkPipelineAtInfixOperator(left: N.Expression, leftStartPos: number) {
|
checkPipelineAtInfixOperator(left: N.Expression, leftStartPos: number) {
|
||||||
this.expectPlugin("pipelineOperator");
|
this.expectPlugin("pipelineOperator");
|
||||||
|
|
||||||
if ("smart" === this.getPluginOption("pipelineOperator", "proposal")) {
|
if (this.getPluginOption("pipelineOperator", "proposal") === "smart") {
|
||||||
this.checkSmartPipelineHeadEarlyErrors(left, leftStartPos);
|
this.checkSmartPipelineHeadEarlyErrors(left, leftStartPos);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -421,7 +421,7 @@ export default class Tokenizer extends LocationParser {
|
|||||||
this.finishToken(tt.hash);
|
this.finishToken(tt.hash);
|
||||||
return;
|
return;
|
||||||
} else if (
|
} else if (
|
||||||
"smart" === this.getPluginOption("pipelineOperator", "proposal")
|
this.getPluginOption("pipelineOperator", "proposal") === "smart"
|
||||||
) {
|
) {
|
||||||
if (next >= charCodes.digit0 && next <= charCodes.digit9) {
|
if (next >= charCodes.digit0 && next <= charCodes.digit9) {
|
||||||
this.raise(
|
this.raise(
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user