fix/schema: fix string literals

This commit is contained in:
mae
2026-01-28 19:52:13 -06:00
parent dc87bef1c2
commit 73fd1dd90d
12 changed files with 5285 additions and 3720 deletions

View File

@@ -1,6 +1,5 @@
_raw_string: '`' {.} '`';
_interpreted_string: '"' {.} '"';
string: _raw_string | _interpreted_string;
raw_string: '`' {.} '`';
interpreted_string: '"' {_byte_value | _little_u_value | _big_u_value | _escaped_char | ' ' - '!' | '#' - '[' | ']' - '\U0010FFFF'} '"';
_unicode_value: . | _little_u_value | _big_u_value | _escaped_char;
_byte_value: _octal_byte_value | _hex_byte_value;
@@ -60,7 +59,8 @@ ValList
| ValList Val <<ast.AppendVal($0, $1)>>
;
Val
: string <<ast.NewStringVal($T0)>>
: raw_string <<ast.NewStringVal($T0)>>
| interpreted_string <<ast.NewIStringVal($T0)>>
| rune <<ast.NewRuneVal($T0)>>
| int <<ast.NewIntVal($T0)>>
| float <<ast.NewFloatVal($T0)>>