From 9a1dcb941df0c4c7fbd20fc1d2cba22b3d98f283 Mon Sep 17 00:00:00 2001 From: Bulat Kurbanov Date: Thu, 27 Nov 2025 10:30:49 +0100 Subject: [PATCH] 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. --- src/scanner.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/scanner.c b/src/scanner.c index 30c6a0e..80bcf4d 100644 --- a/src/scanner.c +++ b/src/scanner.c @@ -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;