Issue #306 editing AS directly - expressions are commands too

This commit is contained in:
Jindra Pet��k
2014-02-24 21:25:29 +01:00
parent 54bd2439d2
commit 83360a19df
2 changed files with 16 additions and 11 deletions
@@ -1087,9 +1087,10 @@ public class ActionScriptParser {
if (isEval) {
ret = var;
} else {
if (mustBeCommand) {
throw new ParseException("Not a command", lexer.yyline());
}
ret = null; //expression can be command too
/*if (mustBeCommand) {
throw new ParseException("Not a command", lexer.yyline());
}*/
}
}
break;
@@ -1302,17 +1303,19 @@ public class ActionScriptParser {
}
return null;
}
if (debugMode) {
System.out.println("/command");
}
lexer.removeListener(buf);
if (ret == null) { //can be popped expression
buf.pushAllBack(lexer);
ret = expression(registerVars, inFunction, inMethod, true, variables);
}
s = lex();
if ((s != null) && (s.type != SymbolType.SEMICOLON)) {
lexer.pushback(s);
}
if (debugMode) {
System.out.println("/command");
}
if (ret == null && (!mustBeCommand)) {
buf.pushAllBack(lexer);
}
lexer.removeListener(buf);
return ret;
}
@@ -58,7 +58,9 @@ public class VariableActionItem extends ActionItem {
public void setBoxedValue(ActionItem it) {
this.it = it;
this.precedence = it.getPrecedence();
if(it!=null){
this.precedence = it.getPrecedence();
}
}
public ActionItem getBoxedValue() {