1
0
Fork 0
mirror of https://github.com/pnx/tree-sitter-dotenv synced 2026-08-15 12:58:12 +02:00

fix: parse multi-word unquoted string values

This commit is contained in:
Henrik Hautakoski 2026-07-22 19:43:59 +02:00
parent 38ed78c2ed
commit b0e11dc786
5 changed files with 509 additions and 404 deletions

View file

@ -13,6 +13,8 @@ EMPTY_WITH_COMMENT_WHITESPACE = # comment
STRING_VALUE_WITH_COMMENT = 'string content' # comment
STRING_VALUE_WITH_COMMENT = "string" # comment
STRING_MULTIWORD_WITH_COMMENT = one two three # comment
SINGLE_WORD_WITH_COMMENT = singleword # comment
--------------------------------------------------------------------------------
@ -35,6 +37,14 @@ STRING_VALUE_WITH_COMMENT = "string" # comment
(assignment
key: (identifier)
value: (string
(string_content)))
(string_content)))
(comment)
(assignment
key: (identifier)
value: (string
(string_content)))
(comment)
(assignment
key: (identifier)
value: (value))
(comment))

View file

@ -2,6 +2,11 @@
String values
================================================================================
key = multi word non quoted string
key = hyphenated-value another.value
key = value with trailing spaces
key = singleword
key = "quoted string"
key = ""
@ -11,6 +16,21 @@ key = ''
--------------------------------------------------------------------------------
(document
(assignment
(identifier)
(string
(string_content)))
(assignment
(identifier)
(string
(string_content)))
(assignment
(identifier)
(string
(string_content)))
(assignment
(identifier)
(value))
(assignment
(identifier)
(string