Improve error handling for literal parsing

This commit is contained in:
Ben Gruver
2015-02-21 14:02:12 -08:00
parent 251d6073b9
commit 4640cc9c5b
3 changed files with 46 additions and 0 deletions

View File

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

View File

@ -47,4 +47,26 @@ smali.FILE
PsiWhiteSpace(' ')
PsiElement(BAD_CHARACTER)('.blah')
PsiWhiteSpace('\n')
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(' ')
PsiElement(EQUAL)('=')
PsiWhiteSpace(' ')
PsiErrorElement:no viable alternative at input '.blah'
PsiElement(BAD_CHARACTER)('.blah')
PsiWhiteSpace(' ')
PsiElement(BAD_CHARACTER)('.blah')
PsiWhiteSpace('\n')
PsiElement(END_ANNOTATION_DIRECTIVE)('.end annotation')