1
0
Fork 0
mirror of https://github.com/pnx/tree-sitter-dotenv synced 2026-06-16 01:54:56 +02:00

make no distinction between single quoted and double quoted string tokens.

This commit is contained in:
Henrik Hautakoski 2024-12-12 17:05:31 +01:00
parent dabedec847
commit 4d71a8548b
6 changed files with 105 additions and 102 deletions

View file

@ -31,28 +31,29 @@ module.exports = grammar({
_value: $ => choice(
$.string,
$.string_interpolation,
$.number,
$.boolean,
$.value,
),
string: $ => seq(
"'",
$.string_content,
"'",
),
string_interpolation: $ => seq(
'"',
alias($.string_interpolation_content, $.string_content),
'"',
),
// Strings
string_content: _ => /[^']*/,
string_interpolation_content: _ => /[^"]*/,
string: $ => choice(
$._string,
$._literal_string
),
_literal_string: $ => seq(
"'",
alias(/[^']*/, $.string_content),
"'",
),
_string: $ => seq(
'"',
alias(/[^"]*/, $.string_content),
'"',
),
// Numbers