Fixed not operator !working

This commit is contained in:
Stefan Zermatten
2022-02-22 19:16:03 +02:00
parent dc4d0416a2
commit 90b277e181
3 changed files with 3 additions and 2 deletions

View File

@@ -79,7 +79,7 @@ let ParserRules = [
{"name": "exponentExpression", "symbols": ["unaryExpression"], "postprocess": id},
{"name": "unaryExpression", "symbols": [(lexer.has("additiveOperator") ? {type: "additiveOperator"} : additiveOperator), "_", "unaryExpression"], "postprocess": d => node.unaryOperator.create({operator: d[0].value, right: d[2]})},
{"name": "unaryExpression", "symbols": ["notExpression"], "postprocess": id},
{"name": "notExpression", "symbols": [(lexer.has("notOperator") ? {type: "notOperator"} : notOperator), "_", "notExpression"], "postprocess": d => node.notOperator.create({right: d[2]})},
{"name": "notExpression", "symbols": [(lexer.has("notOperator") ? {type: "notOperator"} : notOperator), "_", "notExpression"], "postprocess": d => node.not.create({right: d[2]})},
{"name": "notExpression", "symbols": ["callExpression"], "postprocess": id},
{"name": "callExpression", "symbols": ["name", "_", "arguments"], "postprocess":
d => node.call.create({functionName: d[0].name, args: d[2]})

View File

@@ -109,7 +109,7 @@ unaryExpression ->
| notExpression {% id %}
notExpression ->
%notOperator _ notExpression {% d => node.notOperator.create({right: d[2]})%}
%notOperator _ notExpression {% d => node.not.create({right: d[2]})%}
| callExpression {% id %}
callExpression ->

View File

@@ -377,6 +377,7 @@ export default {
disabledNodeCount += 1;
}
} catch (e){
console.warn(e);
let error = prettifyParseError(e);
node._disabledBySlotFillerCondition = true;
node._conditionError = error;