Skip to content

Commit

Permalink
string literal added
Browse files Browse the repository at this point in the history
  • Loading branch information
r001 committed Aug 26, 2024
1 parent f7dd9c1 commit f5ecaaa
Show file tree
Hide file tree
Showing 3 changed files with 19,238 additions and 17,384 deletions.
17 changes: 17 additions & 0 deletions grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,20 @@ module.exports = grammar({
/[a-z0-9]{212}/
),

string_literal: $ => seq(
'"',
repeat(
choice(
/[\x00-\x09]/,
/[\x0B-\x21]/,
/[\x23-\x7f]/,
$.safe_nonascii,
$.line_terminator,
)
),
'"',
),

annotation: $ => seq(
'@', $.identifier
),
Expand Down Expand Up @@ -672,6 +686,7 @@ module.exports = grammar({
$.boolean_literal,
$.address_literal,
$.signature_literal,
$.string_literal,
$.affine_group_literal,
$.variable,
$.associated_constant,
Expand Down Expand Up @@ -714,6 +729,7 @@ module.exports = grammar({
$.function_arguments
)
),

parenthesized_expression: $ => seq('(', $._expression, ')'),

_expression: $ => choice(
Expand All @@ -725,6 +741,7 @@ module.exports = grammar({
$.boolean_literal,
$.address_literal,
$.signature_literal,
$.string_literal,
$.affine_group_literal,
$.variable,
$.associated_constant,
Expand Down
Loading

0 comments on commit f5ecaaa

Please sign in to comment.