Improve the parsing of a field type

This commit is contained in:
Ben Gruver 2015-02-20 20:54:31 -08:00
parent 01f8c7dc7b
commit cbde720efa
4 changed files with 24 additions and 0 deletions

View File

@ -526,6 +526,11 @@ nonvoid_type_descriptor
: primitive_type
| class_descriptor
| array_descriptor;
catch [RecognitionException re] {
Marker marker = mark();
recover(input, re);
reportError(marker, re, false);
}
reference_type_descriptor
: class_descriptor

View File

@ -49,6 +49,7 @@ public class ParserTest extends LightCodeInsightParsingTestCase {
public void testInvalidField() throws Exception { doTest(true); }
public void testInvalidField2() throws Exception { doTest(true); }
public void testInvalidField3() throws Exception { doTest(true); }
public void testInvalidField4() throws Exception { doTest(true); }
public void testParamListInvalidParameter() throws Exception { doTest(true); }
public void testSuperClassInvalidSyntax() throws Exception { doTest(true); }
public void testSuperClassInvalidSyntax2() throws Exception { doTest(true); }

View File

@ -0,0 +1 @@
.field public blah:.blah

View File

@ -0,0 +1,17 @@
smali.FILE
SmaliClass(CLASS)
SmaliExtendsList(EXTENDS_LIST)
<empty list>
SmaliImplementsList(IMPLEMENTS_LIST)
<empty list>
SmaliField(FIELD)
PsiElement(FIELD_DIRECTIVE)('.field')
PsiWhiteSpace(' ')
SmaliModifierList(MODIFIER_LIST)
PsiElement(ACCESS_SPEC)('public')
PsiWhiteSpace(' ')
PsiElement(MEMBER_NAME)
PsiElement(SIMPLE_NAME)('blah')
PsiElement(COLON)(':')
PsiErrorElement:no viable alternative at input '.blah'
PsiElement(BAD_CHARACTER)('.blah')