Skip to content

Commit

Permalink
tree-sitter: fix parser error on unescaped dollar identifier in strin…
Browse files Browse the repository at this point in the history
…g literals, add test (#79)
  • Loading branch information
ttytm authored Mar 31, 2024
1 parent 879357c commit b50fdc3
Show file tree
Hide file tree
Showing 6 changed files with 197,840 additions and 197,986 deletions.
4 changes: 2 additions & 2 deletions tree_sitter_v/bindings/node_types.v
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ pub enum NodeType {
index_expression
interface_declaration
interface_method_definition
interpolation_closing
interpreted_string_literal
is_clause
is_expression
Expand Down Expand Up @@ -178,6 +177,7 @@ pub enum NodeType {
float_literal
identifier
int_literal
interpolation_closing
interpolation_opening
nil_
none_
Expand Down Expand Up @@ -393,7 +393,6 @@ const node_type_name_to_enum = {
'index_expression': NodeType.index_expression
'interface_declaration': NodeType.interface_declaration
'interface_method_definition': NodeType.interface_method_definition
'interpolation_closing': NodeType.interpolation_closing
'interpreted_string_literal': NodeType.interpreted_string_literal
'is_clause': NodeType.is_clause
'is_expression': NodeType.is_expression
Expand Down Expand Up @@ -486,6 +485,7 @@ const node_type_name_to_enum = {
'float_literal': NodeType.float_literal
'identifier': NodeType.identifier
'int_literal': NodeType.int_literal
'interpolation_closing': NodeType.interpolation_closing
'interpolation_opening': NodeType.interpolation_opening
'nil': NodeType.nil_
'none': NodeType.none_
Expand Down
2 changes: 1 addition & 1 deletion tree_sitter_v/grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -1251,7 +1251,7 @@ function sep(rule) {
*
*/
function stringBody(re, $) {
return choice(token.immediate(prec.right(1, re)), $.escape_sequence, $.string_interpolation);
return choice(token.immediate(prec.right(1, re)), '$', $.escape_sequence, $.string_interpolation);
}

/**
Expand Down
Loading

0 comments on commit b50fdc3

Please sign in to comment.