Added: #2477 Option to disable AS2 detection of uninitialized class fields

Added: AS2 detection of uninitialized class fields is cancellable and shows progress
Changed: Icon of "Deobfuscation options" menu from pile of pills to medkit
Fixed: Comments color highlighting
This commit is contained in:
Jindra Petřík
2025-07-01 19:50:18 +02:00
parent 8a3cbf9e2d
commit 5ffc71848b
22 changed files with 225 additions and 37 deletions
@@ -64,9 +64,13 @@ import java.util.List;
this.offset = ofst;
prevToken = null;
Token t = yylex();
prevToken = t;
if (t.type != TokenType.COMMENT) {
prevToken = t;
}
for (; t != null; t = yylex()) {
prevToken = t;
if (t.type != TokenType.COMMENT) {
prevToken = t;
}
tokens.add(t);
}
} catch (IOException ex) {
@@ -187,9 +191,14 @@ RegExp = \/([^\r\n/]|\\\/)+\/[a-z]*
"typeof" |
"void" { return token(TokenType.KEYWORD); }
/* comments */
{Comment} { return token(TokenType.COMMENT); }
{RegExp} {
if (prevToken == null || (prevToken.type == TokenType.OPERATOR && prevToken.pairValue >= 0)) {
if (prevToken == null
|| (prevToken.type == TokenType.OPERATOR && prevToken.pairValue >= 0)
) {
return token(TokenType.REGEX);
} else {
int ch = yychar;
@@ -201,7 +210,7 @@ RegExp = \/([^\r\n/]|\\\/)+\/[a-z]*
/* operators */
"(" { return token(TokenType.OPERATOR, PAREN); }
"(" { return token(TokenType.OPERATOR, PAREN); }
")" { return token(TokenType.OPERATOR, -PAREN); }
"{" { return token(TokenType.OPERATOR, CURLY); }
"}" { return token(TokenType.OPERATOR, -CURLY); }
@@ -286,9 +295,7 @@ RegExp = \/([^\r\n/]|\\\/)+\/[a-z]*
// JavaDoc comments need a state so that we can highlight the @ controls
/* comments */
{Comment} { return token(TokenType.COMMENT); }
/* whitespace */
{WhiteSpace} { }
/* identifiers */
@@ -66,9 +66,13 @@ import java.util.List;
this.offset = ofst;
prevToken = null;
Token t = yylex();
prevToken = t;
if (t.type != TokenType.COMMENT) {
prevToken = t;
}
for (; t != null; t = yylex()) {
prevToken = t;
if (t.type != TokenType.COMMENT) {
prevToken = t;
}
tokens.add(t);
}
} catch (IOException ex) {
@@ -211,6 +215,9 @@ VerbatimString = "@\"" {VerbatimStringCharacter}* "\""
"new" { prevNew = true; return token(TokenType.KEYWORD); }
/* comments */
{Comment} { return token(TokenType.COMMENT); }
{RegExp} {
prevNew = false;
if (prevToken == null || (prevToken.type == TokenType.OPERATOR && prevToken.pairValue >= 0)) {
@@ -324,12 +331,7 @@ VerbatimString = "@\"" {VerbatimStringCharacter}* "\""
{DoubleLiteral} |
{DoubleLiteral}[dD] { prevNew = false; return token(TokenType.NUMBER); }
// JavaDoc comments need a state so that we can highlight the @ controls
/* comments */
{Comment} { prevNew = false; return token(TokenType.COMMENT); }
/* whitespace */
{WhiteSpace} { }
{XMLBeginOneTag} {