mirror of
https://github.com/revanced/smali.git
synced 2025-06-13 12:37:37 +02:00
Improve error recovery for missing .. tokens
This commit is contained in:
9
smalidea/testData/MissingDotDot.smalidea
Normal file
9
smalidea/testData/MissingDotDot.smalidea
Normal file
@ -0,0 +1,9 @@
|
||||
.method public blah()V
|
||||
invoke-virtual/range {v0 v1}, Lblah;->blah()V
|
||||
|
||||
invoke-virtual/range {v0 .blah v1}, Lblah;->blah()V
|
||||
|
||||
.catch Ljava/lang/Exception; { :blah1 :blah2 } :blah3
|
||||
|
||||
.catch Ljava/lang/Exception; { :blah1 .blah :blah2 } :blah3
|
||||
.end method
|
126
smalidea/testData/MissingDotDot.txt
Normal file
126
smalidea/testData/MissingDotDot.txt
Normal file
@ -0,0 +1,126 @@
|
||||
smali.FILE
|
||||
SmaliClass(CLASS)
|
||||
SmaliExtendsList(EXTENDS_LIST)
|
||||
<empty list>
|
||||
SmaliImplementsList(IMPLEMENTS_LIST)
|
||||
<empty list>
|
||||
SmaliMethod(METHOD)
|
||||
SmaliThrowsList(THROWS_LIST)
|
||||
<empty list>
|
||||
PsiElement(METHOD_DIRECTIVE)('.method')
|
||||
PsiWhiteSpace(' ')
|
||||
SmaliModifierList(MODIFIER_LIST)
|
||||
PsiElement(ACCESS_SPEC)('public')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(MEMBER_NAME)
|
||||
PsiElement(SIMPLE_NAME)('blah')
|
||||
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(INSTRUCTION)
|
||||
PsiElement(INSTRUCTION_FORMAT3rc_METHOD)('invoke-virtual/range')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(OPEN_BRACE)('{')
|
||||
PsiElement(REGISTER_REFERENCE)
|
||||
PsiElement(REGISTER)('v0')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiErrorElement:extraneous input 'v1' expecting CLOSE_BRACE
|
||||
PsiElement(REGISTER)('v1')
|
||||
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)(')')
|
||||
PsiElement(VOID_TYPE)
|
||||
PsiElement(VOID_TYPE)('V')
|
||||
PsiWhiteSpace('\n\n ')
|
||||
PsiElement(INSTRUCTION)
|
||||
PsiElement(INSTRUCTION_FORMAT3rc_METHOD)('invoke-virtual/range')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(OPEN_BRACE)('{')
|
||||
PsiElement(REGISTER_REFERENCE)
|
||||
PsiElement(REGISTER)('v0')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiErrorElement:mismatched input '.blah' expecting CLOSE_BRACE
|
||||
PsiElement(BAD_CHARACTER)('.blah')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(REGISTER)('v1')
|
||||
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)(')')
|
||||
PsiElement(VOID_TYPE)
|
||||
PsiElement(VOID_TYPE)('V')
|
||||
PsiWhiteSpace('\n\n ')
|
||||
PsiElement(CATCH_STATEMENT)
|
||||
PsiElement(CATCH_DIRECTIVE)('.catch')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(CLASS_TYPE)
|
||||
PsiElement(CLASS_DESCRIPTOR)('Ljava/lang/Exception;')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(OPEN_BRACE)('{')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(LABEL_REFERENCE)
|
||||
PsiElement(COLON)(':')
|
||||
PsiElement(SIMPLE_NAME)('blah1')
|
||||
PsiErrorElement:missing DOTDOT at ':'
|
||||
<empty list>
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(LABEL_REFERENCE)
|
||||
PsiElement(COLON)(':')
|
||||
PsiElement(SIMPLE_NAME)('blah2')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(CLOSE_BRACE)('}')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(LABEL_REFERENCE)
|
||||
PsiElement(COLON)(':')
|
||||
PsiElement(SIMPLE_NAME)('blah3')
|
||||
PsiWhiteSpace('\n\n ')
|
||||
PsiElement(CATCH_STATEMENT)
|
||||
PsiElement(CATCH_DIRECTIVE)('.catch')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(CLASS_TYPE)
|
||||
PsiElement(CLASS_DESCRIPTOR)('Ljava/lang/Exception;')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(OPEN_BRACE)('{')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(LABEL_REFERENCE)
|
||||
PsiElement(COLON)(':')
|
||||
PsiElement(SIMPLE_NAME)('blah1')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiErrorElement:mismatched input '.blah' expecting DOTDOT
|
||||
PsiElement(BAD_CHARACTER)('.blah')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(LABEL_REFERENCE)
|
||||
PsiElement(COLON)(':')
|
||||
PsiElement(SIMPLE_NAME)('blah2')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(CLOSE_BRACE)('}')
|
||||
PsiWhiteSpace(' ')
|
||||
PsiElement(LABEL_REFERENCE)
|
||||
PsiElement(COLON)(':')
|
||||
PsiElement(SIMPLE_NAME)('blah3')
|
||||
PsiWhiteSpace('\n')
|
||||
PsiElement(END_METHOD_DIRECTIVE)('.end method')
|
Reference in New Issue
Block a user