Parser: 91.7% of the corpus, operator symbols and #code statements
operatorSymbol now tries multi-token forms first, so 'operator *[]' is no longer cut short by the bare '*'. '#code'/'#insert' take a whole statement, and a statement that already consumed its ';' satisfies the enclosing declaration. Ratchet 650/714.
This commit is contained in:
@@ -237,8 +237,9 @@ object JaiParserUtil : GeneratedParserUtilBase() {
|
||||
|
||||
/**
|
||||
* True if the previous token already closes a construct, so no `;` is needed:
|
||||
* `}` ends a block, struct or enum body, and a here-string ends on its own
|
||||
* terminator line (`BODY :: #string DONE … DONE`).
|
||||
* `}` ends a block, struct or enum body, a here-string ends on its own terminator
|
||||
* line (`BODY :: #string DONE … DONE`), and a `;` was already taken by a nested
|
||||
* statement (`code :: #code a := 1;`).
|
||||
*/
|
||||
@JvmStatic
|
||||
fun prevEndsConstruct(
|
||||
@@ -249,7 +250,7 @@ object JaiParserUtil : GeneratedParserUtilBase() {
|
||||
while (true) {
|
||||
val t: IElementType = b.rawLookup(i) ?: return false
|
||||
if (t !== TokenType.WHITE_SPACE && t !== T.LINE_COMMENT && t !== T.BLOCK_COMMENT) {
|
||||
return t === T.RBRACE || t === T.HERE_STRING
|
||||
return t === T.RBRACE || t === T.HERE_STRING || t === T.SEMICOLON
|
||||
}
|
||||
i--
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user