mxd 3 лет назад
Родитель
Сommit
e0534ca7a9

+ 5 - 0
magic-editor/src/console/src/scripts/parsing/ast.js

@@ -318,9 +318,14 @@ class UnaryOperation extends Node {
     constructor(operator, operand, atAfter) {
         super(new Span(operator.getSpan(), operand.getSpan()))
         this.operand = operand
+        this.operator = operator
         this.atAfter = atAfter
     }
 
+    async getJavaType() {
+        return this.operand.getJavaType();
+    }
+
 }
 
 class TryStatement extends Node {

+ 1 - 2
magic-editor/src/console/src/scripts/parsing/parser.js

@@ -94,7 +94,6 @@ export class Parser {
 
     validateNode(node) {
         if (node instanceof Literal || node instanceof VariableAccess || node instanceof MapOrArrayAccess) {
-            console.log(new Error('111111'))
             throw new ParseException('literal cannot be used alone', node.getSpan());
         }
     }
@@ -157,7 +156,7 @@ export class Parser {
                 }
                 expression = new ClassConverter(new Span(open, closing), identifier.getText(), expression, args);
             } else {
-                expression = this.parseAccessOrCall(stream, expression);
+                expression = this.parseAccessOrCall(expression);
             }
         }
         return expression;