Please sign in to comment.
Fix lexing regression in certain types of method parameter lists
It was mis-lexing the case when a class descriptor is immediately followed by a primitive type. The primitive type was being lexed as PARAM_LIST_OR_ID_PRIMITIVE_TYPE instead of PRIMITIVE_TYPE. The root cause was due to an incorrect state change. Since the CLASS_DESCRIPTOR state can be started from within the PARAM_LIST state, but when the CLASS_DESCRIPTOR state ends it just went back to YYINITIAL, instead of going back to PARAM_LIST. This adds a state stack to track these state changes
- Loading branch information...
Showing with 37 additions and 4 deletions.
- +7 −4 smali/src/main/jflex/smaliLexer.jflex
- +1 −0 smali/src/test/resources/LexerTest/TypeAndIdentifierTest.smali
- +14 −0 smali/src/test/resources/LexerTest/TypeAndIdentifierTest.tokens
- +1 −0 smali/src/test/resources/LexerTest/TypeAndIdentifierTest_api29.smali
- +14 −0 smali/src/test/resources/LexerTest/TypeAndIdentifierTest_api29.tokens