Add full-width closing bracket support after asciiend
Allow ] (U+FF3D) after asciiend in ASCII content scanner. This enables ASCII strings inside arrays with full-width brackets: var x = [ascii...asciiend] The parser now correctly recognizes this as an array containing an ASCII string, not as a syntax error. Fixes 1 additional parsing error.
This commit is contained in:
@@ -175,6 +175,7 @@ module.exports = grammar({
|
||||
$.string,
|
||||
$.boolean,
|
||||
$.null,
|
||||
$.ascii_string,
|
||||
$.array,
|
||||
$.member_expression,
|
||||
$.call_expression,
|
||||
@@ -186,7 +187,6 @@ module.exports = grammar({
|
||||
$.parenthesized_expression,
|
||||
$.new_statement,
|
||||
$.import_expression,
|
||||
$.ascii_string,
|
||||
$.color_code
|
||||
),
|
||||
|
||||
@@ -282,10 +282,7 @@ module.exports = grammar({
|
||||
|
||||
null: $ => 'null',
|
||||
|
||||
ascii_string: $ => choice(
|
||||
seq('ascii', $.ascii_content, 'asciiend'),
|
||||
seq(choice('[', '['), 'ascii', $.ascii_content, 'asciiend', choice(']', ']'))
|
||||
)
|
||||
ascii_string: $ => seq('ascii', $.ascii_content, 'asciiend')
|
||||
},
|
||||
|
||||
extras: $ => [
|
||||
|
||||
Reference in New Issue
Block a user