Allow ) and ] after asciiend in ASCII blocks

ASCII blocks can now be used as function arguments and array
elements. The scanner now accepts ) and ] as valid characters
after 'asciiend', allowing constructs like:
- var x = uiAA(ascii...asciiend)
- var y = [ascii...asciiend]

Fixes 12 parsing errors in test scripts.
This commit is contained in:
2025-11-27 10:30:49 +01:00
parent eaf0963459
commit 9a1dcb941d

View File

@@ -134,10 +134,11 @@ bool tree_sitter_stonescript_external_scanner_scan(void *payload, TSLexer *lexer
}
}
// Check that asciiend is followed by whitespace or EOL
// Check that asciiend is followed by whitespace or EOL or closing delimiters
if (match && (lexer->lookahead == '\n' || lexer->lookahead == '\r' ||
lexer->lookahead == ' ' || lexer->lookahead == '\t' ||
lexer->lookahead == ',' ||
lexer->lookahead == ',' || lexer->lookahead == ')' ||
lexer->lookahead == ']' ||
lexer->eof(lexer))) {
lexer->result_symbol = ASCII_CONTENT;
return has_content;