Improve error handling for annotation element parsing

This commit is contained in:
Ben Gruver
2015-02-21 12:43:13 -08:00
parent 1325537f8a
commit 251d6073b9
3 changed files with 32 additions and 1 deletions

View File

@ -4,3 +4,6 @@
.annotation runtime .blah
.end annotation
.annotation runtime Lblah;
blah .blah .blah
.end annotation

View File

@ -27,4 +27,24 @@ smali.FILE
PsiWhiteSpace('\n')
PsiElement(ANNOTATION_PARAMETER_LIST)
<empty list>
PsiElement(END_ANNOTATION_DIRECTIVE)('.end annotation')
PsiWhiteSpace('\n\n')
SmaliAnnotation(ANNOTATION)
PsiElement(ANNOTATION_DIRECTIVE)('.annotation')
PsiWhiteSpace(' ')
PsiElement(ANNOTATION_VISIBILITY)('runtime')
PsiWhiteSpace(' ')
PsiElement(CLASS_TYPE)
PsiElement(CLASS_DESCRIPTOR)('Lblah;')
PsiWhiteSpace('\n ')
PsiElement(ANNOTATION_PARAMETER_LIST)
PsiElement(ANNOTATION_ELEMENT)
PsiElement(ANNOTATION_ELEMENT_NAME)
PsiElement(SIMPLE_NAME)('blah')
PsiWhiteSpace(' ')
PsiErrorElement:mismatched input '.blah' expecting EQUAL
PsiElement(BAD_CHARACTER)('.blah')
PsiWhiteSpace(' ')
PsiElement(BAD_CHARACTER)('.blah')
PsiWhiteSpace('\n')
PsiElement(END_ANNOTATION_DIRECTIVE)('.end annotation')