mirror of
https://github.com/revanced/smali.git
synced 2025-05-29 12:20:11 +02:00
Allow space characters in SimpleName.
DEX format allows Unicode space characters in SimpleName since version 040. Allowed space characters include everything in Unicode category 'Zs': 0x20, 0xa0, 0x1680, 0x2000..0x200a, 0x202f, 0x205f, 0x3000 Smali now supports symtax `method with spaces` (spaces are allowed in backtick-quoted names).
This commit is contained in:
parent
751fe1ce61
commit
586ec594e2
@ -225,8 +225,11 @@ HighSurrogate = [\ud800-\udbff]
|
|||||||
LowSurrogate = [\udc00-\udfff]
|
LowSurrogate = [\udc00-\udfff]
|
||||||
|
|
||||||
SimpleNameCharacter = ({HighSurrogate} {LowSurrogate}) | [A-Za-z0-9$\-_\u00a1-\u1fff\u2010-\u2027\u2030-\ud7ff\ue000-\uffef]
|
SimpleNameCharacter = ({HighSurrogate} {LowSurrogate}) | [A-Za-z0-9$\-_\u00a1-\u1fff\u2010-\u2027\u2030-\ud7ff\ue000-\uffef]
|
||||||
|
UnicodeSpace = [\u0020\u00A0\u1680\u2000-\u200A\u202F\u205F\u3000] /* Zs category */
|
||||||
|
|
||||||
SimpleName = {SimpleNameCharacter}+
|
SimpleNameRaw = {SimpleNameCharacter}+
|
||||||
|
SimpleNameQuoted = [`] ({SimpleNameCharacter} | {UnicodeSpace})+ [`]
|
||||||
|
SimpleName = {SimpleNameRaw} | {SimpleNameQuoted}
|
||||||
|
|
||||||
PrimitiveType = [ZBSCIJFD]
|
PrimitiveType = [ZBSCIJFD]
|
||||||
|
|
||||||
@ -682,8 +685,13 @@ Type = {PrimitiveType} | {ClassDescriptor} | {ArrayPrefix} ({ClassDescriptor} |
|
|||||||
yybegin(PARAM_LIST);
|
yybegin(PARAM_LIST);
|
||||||
}
|
}
|
||||||
|
|
||||||
{SimpleName} { return newToken(SIMPLE_NAME); }
|
{SimpleNameRaw} { return newToken(SIMPLE_NAME); }
|
||||||
"<" {SimpleName} ">" { return newToken(MEMBER_NAME); }
|
{SimpleNameQuoted} {
|
||||||
|
String quoted = yytext();
|
||||||
|
String raw = quoted.substring(1, quoted.length() - 1); /* strip backticks */
|
||||||
|
return newToken(SIMPLE_NAME, raw);
|
||||||
|
}
|
||||||
|
"<" {SimpleNameRaw} ">" { return newToken(MEMBER_NAME); }
|
||||||
}
|
}
|
||||||
|
|
||||||
/*Symbols/Whitespace/EOF*/
|
/*Symbols/Whitespace/EOF*/
|
||||||
|
@ -53,4 +53,6 @@ L[Ljava/lang/String;
|
|||||||
|
|
||||||
III
|
III
|
||||||
|
|
||||||
[I->clone()Ljava/lang/Object;
|
[I->clone()Ljava/lang/Object;
|
||||||
|
|
||||||
|
`method_with_spaces_20 a0 1680 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 200a 202f 205f 3000 `
|
||||||
|
@ -107,4 +107,6 @@ ARROW("->")
|
|||||||
SIMPLE_NAME("clone")
|
SIMPLE_NAME("clone")
|
||||||
OPEN_PAREN("(")
|
OPEN_PAREN("(")
|
||||||
CLOSE_PAREN(")")
|
CLOSE_PAREN(")")
|
||||||
CLASS_DESCRIPTOR("Ljava/lang/Object;")
|
CLASS_DESCRIPTOR("Ljava/lang/Object;")
|
||||||
|
|
||||||
|
SIMPLE_NAME("method_with_spaces_20 a0 1680 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 200a 202f 205f 3000 ")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user