mirror of
https://github.com/revanced/smali.git
synced 2025-05-01 23:24:38 +02:00
Add better error recovery for the type_descriptor rule
This commit is contained in:
parent
62958a7091
commit
21d509aa6c
@ -536,6 +536,11 @@ type_descriptor
|
||||
| primitive_type
|
||||
| class_descriptor
|
||||
| array_descriptor;
|
||||
catch [RecognitionException re] {
|
||||
Marker marker = mark();
|
||||
recover(input, re);
|
||||
reportError(marker, re, false);
|
||||
}
|
||||
|
||||
nonvoid_type_descriptor
|
||||
: primitive_type
|
||||
|
@ -4,3 +4,5 @@
|
||||
.method blah(I .blah V
|
||||
.end method
|
||||
|
||||
.method blah())V
|
||||
.end method
|
@ -51,3 +51,23 @@ smali.FILE
|
||||
PsiElement(VOID_TYPE)('V')
|
||||
PsiWhiteSpace('\n')
|
||||
PsiElement(END_METHOD_DIRECTIVE)('.end method')
|
||||
PsiWhiteSpace('\n\n')
|
||||
SmaliMethod(METHOD)
|
||||
SmaliThrowsList(THROWS_LIST)
|
||||
<empty list>
|
||||
PsiElement(METHOD_DIRECTIVE)('.method')
|
||||
PsiWhiteSpace(' ')
|
||||
SmaliModifierList(MODIFIER_LIST)
|
||||
<empty list>
|
||||
PsiElement(MEMBER_NAME)
|
||||
PsiElement(SIMPLE_NAME)('blah')
|
||||
SmaliMethodPrototype(METHOD_PROTOTYPE)
|
||||
PsiElement(OPEN_PAREN)('(')
|
||||
SmaliMethodParamList(METHOD_PARAM_LIST)
|
||||
<empty list>
|
||||
PsiElement(CLOSE_PAREN)(')')
|
||||
PsiErrorElement:no viable alternative at input ')'
|
||||
PsiElement(CLOSE_PAREN)(')')
|
||||
PsiElement(VOID_TYPE)('V')
|
||||
PsiWhiteSpace('\n')
|
||||
PsiElement(END_METHOD_DIRECTIVE)('.end method')
|
@ -17,3 +17,8 @@ invoke-virtual {v0}, Lblah;->blah .blah )V
|
||||
.registers 1
|
||||
invoke-virtual {v0}, Lblah;->blah(I .blah V
|
||||
.end method
|
||||
|
||||
.method blah5()V
|
||||
.registers 1
|
||||
invoke-virtual {v0}, Lblah;->blah())V
|
||||
.end method
|
||||
|
@ -187,3 +187,51 @@ smali.FILE
|
||||
PsiElement(VOID_TYPE)('V')
|
||||
PsiWhiteSpace('\n')
|
||||
PsiElement(END_METHOD_DIRECTIVE)('.end method')
|
||||
PsiWhiteSpace('\n\n')
|
||||
SmaliMethod(METHOD)
|
||||
SmaliThrowsList(THROWS_LIST)
|
||||
<empty list>
|
||||
PsiElement(METHOD_DIRECTIVE)('.method')
|
||||
PsiWhiteSpace(' ')
|
||||
SmaliModifierList(MODIFIER_LIST)
|
||||
<empty list>
|
||||
PsiElement(MEMBER_NAME)
|
||||
PsiElement(SIMPLE_NAME)('blah5')
|
||||
SmaliMethodPrototype(METHOD_PROTOTYPE)
|
||||
PsiElement(OPEN_PAREN)('(')
|
||||
SmaliMethodParamList(METHOD_PARAM_LIST)
|
||||
<empty list>
|
||||
PsiElement(CLOSE_PAREN)(')')
|
||||
PsiElement(VOID_TYPE)
|
||||
PsiElement(VOID_TYPE)('V')
|
||||
PsiWhiteSpace('\n')
|
||||
PsiElement(REGISTERS_STATEMENT)
|
||||
PsiElement(REGISTERS_DIRECTIVE)('.registers')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(LITERAL)
|
||||
PsiElement(POSITIVE_INTEGER_LITERAL)('1')
|
||||
PsiWhiteSpace('\n')
|
||||
PsiElement(INSTRUCTION)
|
||||
PsiElement(INSTRUCTION_FORMAT35c_METHOD)('invoke-virtual')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(OPEN_BRACE)('{')
|
||||
PsiElement(REGISTER_REFERENCE)
|
||||
PsiElement(REGISTER)('v0')
|
||||
PsiElement(CLOSE_BRACE)('}')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(METHOD_REFERENCE)
|
||||
PsiElement(CLASS_TYPE)
|
||||
PsiElement(CLASS_DESCRIPTOR)('Lblah;')
|
||||
PsiElement(ARROW)('->')
|
||||
PsiElement(MEMBER_NAME)
|
||||
PsiElement(SIMPLE_NAME)('blah')
|
||||
PsiElement(OPEN_PAREN)('(')
|
||||
PsiElement(METHOD_REFERENCE_PARAM_LIST)
|
||||
<empty list>
|
||||
PsiElement(CLOSE_PAREN)(')')
|
||||
PsiErrorElement:no viable alternative at input ')'
|
||||
PsiElement(CLOSE_PAREN)(')')
|
||||
PsiElement(VOID_TYPE)('V')
|
||||
PsiWhiteSpace('\n')
|
||||
PsiElement(END_METHOD_DIRECTIVE)('.end method')
|
Loading…
x
Reference in New Issue
Block a user