diff --git a/CHANGELOG.md b/CHANGELOG.md index 0789f822e..c08e8159c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ All notable changes to this project will be documented in this file. - [#1511], [#1765] Quick search tree (Ctrl+F) for everything, not just AS3 classes - Quick search (Ctrl+F) for tag list view - [#1884] Memory search - show size and adress in hex, show only aligned to N bytes +- AS3 - "internal" keyword support ### Fixed - [#1897] Close menu button without selecting specific item diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ActionScript3Parser.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ActionScript3Parser.java index a42e483ce..be25a688f 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ActionScript3Parser.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/avm2/parser/script/ActionScript3Parser.java @@ -659,7 +659,7 @@ public class ActionScript3Parser { List>> metadata = parseMetadata(); s = lex(); - while (s.isType(SymbolType.STATIC, SymbolType.PUBLIC, SymbolType.PRIVATE, SymbolType.PROTECTED, SymbolType.OVERRIDE, SymbolType.FINAL, SymbolType.DYNAMIC, SymbolGroup.IDENTIFIER)) { + while (s.isType(SymbolType.STATIC, SymbolType.PUBLIC, SymbolType.PRIVATE, SymbolType.PROTECTED, SymbolType.OVERRIDE, SymbolType.FINAL, SymbolType.DYNAMIC, SymbolGroup.IDENTIFIER, SymbolType.INTERNAL)) { if (s.type == SymbolType.FINAL) { if (isFinal) { throw new AVM2ParseException("Only one final keyword allowed", lexer.yyline()); @@ -710,6 +710,9 @@ public class ActionScript3Parser { throw new AVM2ParseException("Interface cannot have public, private or protected modifier", lexer.yyline()); } break; + case INTERNAL: + namespace = packageInternalNs; + break; } s = lex(); } diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/Namespace.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/Namespace.java index 3c3227c30..a1fdafe50 100644 --- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/Namespace.java +++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/abc/types/Namespace.java @@ -45,7 +45,7 @@ public class Namespace { public static final String[] nameSpaceKindNames = new String[]{"Namespace", "PrivateNamespace", "PackageNamespace", "PackageInternalNs", "ProtectedNamespace", "ExplicitNamespace", "StaticProtectedNs"}; - public static final String[] namePrefixes = new String[]{"", "private", "public", "", "protected", "explicit", "protected"}; + public static final String[] namePrefixes = new String[]{"", "private", "public", "internal", "protected", "explicit", "protected"}; public int kind; diff --git a/libsrc/ffdec_lib/testdata/as3_new/bin/as3_new.air.swf b/libsrc/ffdec_lib/testdata/as3_new/bin/as3_new.air.swf index 0eb6eb5e2..274a66e03 100644 Binary files a/libsrc/ffdec_lib/testdata/as3_new/bin/as3_new.air.swf and b/libsrc/ffdec_lib/testdata/as3_new/bin/as3_new.air.swf differ diff --git a/libsrc/ffdec_lib/testdata/as3_new/bin/as3_new.flex.swf b/libsrc/ffdec_lib/testdata/as3_new/bin/as3_new.flex.swf index 4fe4fb637..17cb11b24 100644 Binary files a/libsrc/ffdec_lib/testdata/as3_new/bin/as3_new.flex.swf and b/libsrc/ffdec_lib/testdata/as3_new/bin/as3_new.flex.swf differ diff --git a/libsrc/ffdec_lib/testdata/as3_new/src/Main.as b/libsrc/ffdec_lib/testdata/as3_new/src/Main.as index 3e79dcbf0..03ba395f2 100644 --- a/libsrc/ffdec_lib/testdata/as3_new/src/Main.as +++ b/libsrc/ffdec_lib/testdata/as3_new/src/Main.as @@ -127,6 +127,8 @@ package TestPropertyCoerce; TestUnaryMinus; + + TestModifiers; public function Main() { diff --git a/libsrc/ffdec_lib/testdata/as3_new/src/tests_classes/TestModifiers.as b/libsrc/ffdec_lib/testdata/as3_new/src/tests_classes/TestModifiers.as new file mode 100644 index 000000000..8399c968e --- /dev/null +++ b/libsrc/ffdec_lib/testdata/as3_new/src/tests_classes/TestModifiers.as @@ -0,0 +1,48 @@ +package tests_classes +{ + + public class TestModifiers + { + private var attr_inst_private:int = 1; + public var attr_inst_public:int = 2; + internal var attr_inst_internal:int = 3; + protected var attr_inst_protected:int = 4; + + explicit var attr_exp:int = 9; + + private static var attr_stat_private:int = 5; + public static var attr_stat_public:int = 6; + internal static var attr_stat_internal:int = 7; + protected static var attr_stat_protected:int = 8; + + private function func_inst_private():int { + return 1; + } + public function func_inst_public():int { + return 2; + } + internal function func_inst_internal():int { + return 3; + } + protected function func_inst_protected():int { + return 4; + } + + private static function func_stat_private():int { + return 5; + } + public static function func_stat_public():int { + return 6; + } + internal static function func_stat_internal():int { + return 7; + } + protected static function func_stat_protected():int { + return 8; + } + + + + + } +}