diff --git a/CHANGELOG.md b/CHANGELOG.md index 4117583c4..47bdc1682 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ All notable changes to this project will be documented in this file. - AS2 - getters and setters decompilation and editing - AS1/2 - definefunction2 suppresssuper parameter - New version dialog error when no main window available +- AS1/2 direct editation - commands as expressions ## [14.6.0] - 2021-11-22 ### Added diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/parser/script/ActionScript2Parser.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/parser/script/ActionScript2Parser.java index 79c7c7617..0298edfee 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/parser/script/ActionScript2Parser.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/action/parser/script/ActionScript2Parser.java @@ -549,6 +549,11 @@ public class ActionScript2Parser { } GraphTargetItem ret; switch (s.type) { + case CALL: + expectedType(SymbolType.PARENT_OPEN); + ret = new CallActionItem(null, null, (expression(inFunction, inMethod, inTellTarget, true, variables, functions, false, hasEval))); + expectedType(SymbolType.PARENT_CLOSE); + break; case GETVERSION: expectedType(SymbolType.PARENT_OPEN); ret = new GetVersionActionItem(null, null); @@ -643,16 +648,6 @@ public class ActionScript2Parser { ret = new AsciiToCharActionItem(null, null, expression(inFunction, inMethod, inTellTarget, true, variables, functions, false, hasEval)); expectedType(SymbolType.PARENT_CLOSE); break; - case DUPLICATEMOVIECLIP: - expectedType(SymbolType.PARENT_OPEN); - GraphTargetItem src3 = (expression(inFunction, inMethod, inTellTarget, true, variables, functions, false, hasEval)); - expectedType(SymbolType.COMMA); - GraphTargetItem tar3 = (expression(inFunction, inMethod, inTellTarget, true, variables, functions, false, hasEval)); - expectedType(SymbolType.COMMA); - GraphTargetItem dep3 = (expression(inFunction, inMethod, inTellTarget, true, variables, functions, false, hasEval)); - expectedType(SymbolType.PARENT_CLOSE); - ret = new CloneSpriteActionItem(null, null, src3, tar3, dep3); - break; case GETTIMER: expectedType(SymbolType.PARENT_OPEN); expectedType(SymbolType.PARENT_CLOSE); @@ -725,16 +720,21 @@ public class ActionScript2Parser { } switch (s.type) { + case DUPLICATEMOVIECLIP: + expectedType(SymbolType.PARENT_OPEN); + GraphTargetItem src3 = (expression(inFunction, inMethod, inTellTarget, true, variables, functions, false, hasEval)); + expectedType(SymbolType.COMMA); + GraphTargetItem tar3 = (expression(inFunction, inMethod, inTellTarget, true, variables, functions, false, hasEval)); + expectedType(SymbolType.COMMA); + GraphTargetItem dep3 = (expression(inFunction, inMethod, inTellTarget, true, variables, functions, false, hasEval)); + expectedType(SymbolType.PARENT_CLOSE); + ret = new CloneSpriteActionItem(null, null, src3, tar3, dep3); + break; case FSCOMMAND: expectedType(SymbolType.PARENT_OPEN); ret = new FSCommandActionItem(null, null, expression(inFunction, inMethod, inTellTarget, true, variables, functions, false, hasEval)); expectedType(SymbolType.PARENT_CLOSE); break; - case CALL: - expectedType(SymbolType.PARENT_OPEN); - ret = new CallActionItem(null, null, (expression(inFunction, inMethod, inTellTarget, true, variables, functions, false, hasEval))); - expectedType(SymbolType.PARENT_CLOSE); - break; case LENGTH: expectedType(SymbolType.PARENT_OPEN); ret = new StringLengthActionItem(null, null, (expression(inFunction, inMethod, inTellTarget, true, variables, functions, false, hasEval))); @@ -1372,11 +1372,6 @@ public class ActionScript2Parser { } return new EmptyCommand(); default: - GraphTargetItem valcmd = expressionCommands(s, inFunction, inMethod, inTellTarget, forinlevel, variables, functions, hasEval); - if (valcmd != null) { - ret = valcmd; - break; - } lexer.pushback(s); ret = expression(inFunction, inMethod, inTellTarget, true, variables, functions, true, hasEval); }