mirror of
https://github.com/pnx/tree-sitter-dotenv
synced 2026-08-16 01:08:13 +02:00
Compare commits
2 commits
38ed78c2ed
...
8b1dad8819
| Author | SHA1 | Date | |
|---|---|---|---|
| 8b1dad8819 | |||
| b0e11dc786 |
11 changed files with 516 additions and 411 deletions
|
|
@ -1,7 +1,7 @@
|
|||
cmake_minimum_required(VERSION 3.13)
|
||||
|
||||
project(tree-sitter-dotenv
|
||||
VERSION "1.1.0"
|
||||
VERSION "1.1.1"
|
||||
DESCRIPTION "Dotenv grammar for tree-sitter"
|
||||
HOMEPAGE_URL "https://github.com/pnx/tree-sitter-dotenv"
|
||||
LANGUAGES C)
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
[package]
|
||||
name = "tree-sitter-dotenv"
|
||||
description = "Dotenv grammar for tree-sitter"
|
||||
version = "1.1.0"
|
||||
version = "1.1.1"
|
||||
license = "MIT"
|
||||
readme = "README.md"
|
||||
keywords = ["incremental", "parsing", "tree-sitter", "dotenv"]
|
||||
|
|
|
|||
2
Makefile
generated
2
Makefile
generated
|
|
@ -2,7 +2,7 @@ ifeq ($(OS),Windows_NT)
|
|||
$(error Windows is not supported)
|
||||
endif
|
||||
|
||||
VERSION := 1.1.0
|
||||
VERSION := 1.1.1
|
||||
|
||||
LANGUAGE_NAME := tree-sitter-dotenv
|
||||
|
||||
|
|
|
|||
|
|
@ -62,9 +62,12 @@ module.exports = grammar({
|
|||
|
||||
string: $ => choice(
|
||||
$._string,
|
||||
$._literal_string
|
||||
$._literal_string,
|
||||
$._unquoted_string,
|
||||
),
|
||||
|
||||
_unquoted_string: $ => alias(/[^\#\s\"\'\$]+(?:[ \t]+[^\#\s\"\'\$]+)+/, $.string_content),
|
||||
|
||||
_literal_string: $ => seq(
|
||||
"'",
|
||||
optional(alias(/[^']+/, $.string_content)),
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "tree-sitter-dotenv",
|
||||
"version": "1.1.0",
|
||||
"version": "1.1.1",
|
||||
"description": "Dotenv grammar for tree-sitter",
|
||||
"repository": "github:pnx/tree-sitter-dotenv",
|
||||
"license": "MIT",
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta"
|
|||
[project]
|
||||
name = "tree-sitter-dotenv"
|
||||
description = "Dotenv grammar for tree-sitter"
|
||||
version = "1.1.0"
|
||||
version = "1.1.1"
|
||||
keywords = ["incremental", "parsing", "tree-sitter", "dotenv"]
|
||||
classifiers = [
|
||||
"Intended Audience :: Developers",
|
||||
|
|
|
|||
13
src/grammar.json
generated
13
src/grammar.json
generated
|
|
@ -212,9 +212,22 @@
|
|||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "_literal_string"
|
||||
},
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "_unquoted_string"
|
||||
}
|
||||
]
|
||||
},
|
||||
"_unquoted_string": {
|
||||
"type": "ALIAS",
|
||||
"content": {
|
||||
"type": "PATTERN",
|
||||
"value": "[^\\#\\s\\\"\\'\\$]+(?:[ \\t]+[^\\#\\s\\\"\\'\\$]+)+"
|
||||
},
|
||||
"named": true,
|
||||
"value": "string_content"
|
||||
},
|
||||
"_literal_string": {
|
||||
"type": "SEQ",
|
||||
"members": [
|
||||
|
|
|
|||
863
src/parser.c
generated
863
src/parser.c
generated
File diff suppressed because it is too large
Load diff
|
|
@ -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))
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
}
|
||||
],
|
||||
"metadata": {
|
||||
"version": "1.1.0",
|
||||
"version": "1.1.1",
|
||||
"license": "MIT",
|
||||
"description": "Dotenv grammar for tree-sitter",
|
||||
"authors": [
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue