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:
parent
dabedec847
commit
4d71a8548b
6 changed files with 105 additions and 102 deletions
31
grammar.js
31
grammar.js
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue