mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-09-26 10:20:42 +00:00
Fixed: #2466 AS1/2/3 Highlighter freezing - expression missing operand,
+ also fixed saving
This commit is contained in:
+4
-3
@@ -184,7 +184,7 @@ import java.util.Map;
|
||||
public class ActionScript2Parser {
|
||||
|
||||
private static final GraphTargetDialect DIALECT = ActionGraphTargetDialect.INSTANCE;
|
||||
|
||||
|
||||
/**
|
||||
* Builtin classes that can be casted to
|
||||
*/
|
||||
@@ -1531,8 +1531,9 @@ public class ActionScript2Parser {
|
||||
|
||||
rhs = expressionPrimary(allowRemainder, inFunction, inMethod, inTellTarget, allowRemainder, variables, functions, true, hasEval);
|
||||
if (rhs == null) {
|
||||
lexer.pushback(op);
|
||||
break;
|
||||
throw new ActionParseException("Missing operand", lexer.yyline());
|
||||
//lexer.pushback(op);
|
||||
//break;
|
||||
}
|
||||
|
||||
lookahead = peekLex();
|
||||
|
||||
+5
-2
@@ -36,7 +36,6 @@ import java.io.IOException;
|
||||
import java.io.StringReader;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -1145,13 +1144,17 @@ public class ActionScript2SimpleParser implements SimpleParser {
|
||||
rhs = expressionPrimary(errors, inFunction, inMethod, inTellTarget, allowRemainder, variables, true, hasEval);
|
||||
if (rhs == false) {
|
||||
lexer.pushback(op);
|
||||
break;
|
||||
errors.add(new SimpleParseException("Missing operand", lexer.yyline(), op.position));
|
||||
return false;
|
||||
}
|
||||
|
||||
lookahead = peekLex();
|
||||
while ((isBinaryOperator(lookahead) && getSymbPrecedence(lookahead) < /* > on wiki */ getSymbPrecedence(op))
|
||||
|| (lookahead.type.isRightAssociative() && getSymbPrecedence(lookahead) == getSymbPrecedence(op))) {
|
||||
rhs = expression1(errors, rhs, getSymbPrecedence(lookahead), inFunction, inMethod, inTellTarget, allowRemainder, variables, hasEval);
|
||||
if (!rhs) {
|
||||
break;
|
||||
}
|
||||
lookahead = peekLex();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user