mirror of
https://github.com/revanced/smali.git
synced 2025-05-08 10:24:31 +02:00
Improve the parsing of a field type
This commit is contained in:
parent
01f8c7dc7b
commit
cbde720efa
@ -526,6 +526,11 @@ nonvoid_type_descriptor
|
|||||||
: primitive_type
|
: primitive_type
|
||||||
| class_descriptor
|
| class_descriptor
|
||||||
| array_descriptor;
|
| array_descriptor;
|
||||||
|
catch [RecognitionException re] {
|
||||||
|
Marker marker = mark();
|
||||||
|
recover(input, re);
|
||||||
|
reportError(marker, re, false);
|
||||||
|
}
|
||||||
|
|
||||||
reference_type_descriptor
|
reference_type_descriptor
|
||||||
: class_descriptor
|
: class_descriptor
|
||||||
|
@ -49,6 +49,7 @@ public class ParserTest extends LightCodeInsightParsingTestCase {
|
|||||||
public void testInvalidField() throws Exception { doTest(true); }
|
public void testInvalidField() throws Exception { doTest(true); }
|
||||||
public void testInvalidField2() throws Exception { doTest(true); }
|
public void testInvalidField2() throws Exception { doTest(true); }
|
||||||
public void testInvalidField3() 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 testParamListInvalidParameter() throws Exception { doTest(true); }
|
||||||
public void testSuperClassInvalidSyntax() throws Exception { doTest(true); }
|
public void testSuperClassInvalidSyntax() throws Exception { doTest(true); }
|
||||||
public void testSuperClassInvalidSyntax2() throws Exception { doTest(true); }
|
public void testSuperClassInvalidSyntax2() throws Exception { doTest(true); }
|
||||||
|
1
smalidea/testData/InvalidField4.smalidea
Normal file
1
smalidea/testData/InvalidField4.smalidea
Normal file
@ -0,0 +1 @@
|
|||||||
|
.field public blah:.blah
|
17
smalidea/testData/InvalidField4.txt
Normal file
17
smalidea/testData/InvalidField4.txt
Normal 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')
|
Loading…
x
Reference in New Issue
Block a user