feat: update grammars
This commit is contained in:
committed by
Michael Hoffmann
parent
6bc92930a7
commit
f0a315ded3
@@ -26,10 +26,10 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"prebuildify": "^6.0.0",
|
||||
"tree-sitter-cli": "^0.22.6"
|
||||
"tree-sitter-cli": "^0.24"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"tree-sitter": "^0.21.0"
|
||||
"tree-sitter": "^0.24"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"tree-sitter": {
|
||||
@@ -39,15 +39,9 @@
|
||||
"scripts": {
|
||||
"install": "node-gyp-build",
|
||||
"prebuildify": "prebuildify --napi --strip",
|
||||
"build": "tree-sitter generate --no-bindings",
|
||||
"build": "tree-sitter generate",
|
||||
"build-wasm": "tree-sitter build --wasm",
|
||||
"test": "tree-sitter test",
|
||||
"parse": "tree-sitter parse"
|
||||
},
|
||||
"tree-sitter": [
|
||||
{
|
||||
"scope": "source.terraform",
|
||||
"injection-regex": "^terraform$"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
{
|
||||
"$schema": "https://tree-sitter.github.io/tree-sitter/assets/schemas/grammar.schema.json",
|
||||
"name": "terraform",
|
||||
"rules": {
|
||||
"config_file": {
|
||||
|
||||
@@ -194,6 +194,7 @@
|
||||
{
|
||||
"type": "config_file",
|
||||
"named": true,
|
||||
"root": true,
|
||||
"fields": {},
|
||||
"children": {
|
||||
"multiple": false,
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -12,10 +12,10 @@ extern "C" {
|
||||
// Allow clients to override allocation functions
|
||||
#ifdef TREE_SITTER_REUSE_ALLOCATOR
|
||||
|
||||
extern void *(*ts_current_malloc)(size_t);
|
||||
extern void *(*ts_current_calloc)(size_t, size_t);
|
||||
extern void *(*ts_current_realloc)(void *, size_t);
|
||||
extern void (*ts_current_free)(void *);
|
||||
extern void *(*ts_current_malloc)(size_t size);
|
||||
extern void *(*ts_current_calloc)(size_t count, size_t size);
|
||||
extern void *(*ts_current_realloc)(void *ptr, size_t size);
|
||||
extern void (*ts_current_free)(void *ptr);
|
||||
|
||||
#ifndef ts_malloc
|
||||
#define ts_malloc ts_current_malloc
|
||||
|
||||
@@ -14,6 +14,7 @@ extern "C" {
|
||||
#include <string.h>
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable : 4101)
|
||||
#elif defined(__GNUC__) || defined(__clang__)
|
||||
#pragma GCC diagnostic push
|
||||
@@ -278,7 +279,7 @@ static inline void _array__splice(Array *self, size_t element_size,
|
||||
#define _compare_int(a, b) ((int)*(a) - (int)(b))
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(default : 4101)
|
||||
#pragma warning(pop)
|
||||
#elif defined(__GNUC__) || defined(__clang__)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
|
||||
@@ -47,6 +47,7 @@ struct TSLexer {
|
||||
uint32_t (*get_column)(TSLexer *);
|
||||
bool (*is_at_included_range_start)(const TSLexer *);
|
||||
bool (*eof)(const TSLexer *);
|
||||
void (*log)(const TSLexer *, const char *, ...);
|
||||
};
|
||||
|
||||
typedef enum {
|
||||
|
||||
28
dialects/terraform/tree-sitter.json
Normal file
28
dialects/terraform/tree-sitter.json
Normal file
@@ -0,0 +1,28 @@
|
||||
{
|
||||
"grammars": [
|
||||
{
|
||||
"name": "terraform",
|
||||
"camelcase": "Terraform",
|
||||
"scope": "source.terraform",
|
||||
"path": ".",
|
||||
"file-types": null,
|
||||
"injection-regex": "^terraform$"
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"version": "0.0.1",
|
||||
"license": "MIT",
|
||||
"description": "Terraform grammar for tree-sitter",
|
||||
"links": {
|
||||
"repository": "https://github.com/tree-sitter/tree-sitter-terraform"
|
||||
}
|
||||
},
|
||||
"bindings": {
|
||||
"c": true,
|
||||
"go": true,
|
||||
"node": true,
|
||||
"python": true,
|
||||
"rust": true,
|
||||
"swift": true
|
||||
}
|
||||
}
|
||||
14
package.json
14
package.json
@@ -7,16 +7,6 @@
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"nan": "^2.14.2",
|
||||
"tree-sitter-cli": "^0.20.6"
|
||||
},
|
||||
"tree-sitter": [
|
||||
{
|
||||
"scope": "source.hcl",
|
||||
"file-types": [
|
||||
"hcl",
|
||||
"tf",
|
||||
"tfvars"
|
||||
]
|
||||
}
|
||||
]
|
||||
"tree-sitter-cli": "^0.24"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
{
|
||||
"$schema": "https://tree-sitter.github.io/tree-sitter/assets/schemas/grammar.schema.json",
|
||||
"name": "hcl",
|
||||
"rules": {
|
||||
"config_file": {
|
||||
|
||||
@@ -194,6 +194,7 @@
|
||||
{
|
||||
"type": "config_file",
|
||||
"named": true,
|
||||
"root": true,
|
||||
"fields": {},
|
||||
"children": {
|
||||
"multiple": false,
|
||||
|
||||
23211
src/parser.c
23211
src/parser.c
File diff suppressed because it is too large
Load Diff
@@ -12,10 +12,10 @@ extern "C" {
|
||||
// Allow clients to override allocation functions
|
||||
#ifdef TREE_SITTER_REUSE_ALLOCATOR
|
||||
|
||||
extern void *(*ts_current_malloc)(size_t);
|
||||
extern void *(*ts_current_calloc)(size_t, size_t);
|
||||
extern void *(*ts_current_realloc)(void *, size_t);
|
||||
extern void (*ts_current_free)(void *);
|
||||
extern void *(*ts_current_malloc)(size_t size);
|
||||
extern void *(*ts_current_calloc)(size_t count, size_t size);
|
||||
extern void *(*ts_current_realloc)(void *ptr, size_t size);
|
||||
extern void (*ts_current_free)(void *ptr);
|
||||
|
||||
#ifndef ts_malloc
|
||||
#define ts_malloc ts_current_malloc
|
||||
|
||||
@@ -14,6 +14,7 @@ extern "C" {
|
||||
#include <string.h>
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable : 4101)
|
||||
#elif defined(__GNUC__) || defined(__clang__)
|
||||
#pragma GCC diagnostic push
|
||||
@@ -278,7 +279,7 @@ static inline void _array__splice(Array *self, size_t element_size,
|
||||
#define _compare_int(a, b) ((int)*(a) - (int)(b))
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(default : 4101)
|
||||
#pragma warning(pop)
|
||||
#elif defined(__GNUC__) || defined(__clang__)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
|
||||
@@ -47,6 +47,7 @@ struct TSLexer {
|
||||
uint32_t (*get_column)(TSLexer *);
|
||||
bool (*is_at_included_range_start)(const TSLexer *);
|
||||
bool (*eof)(const TSLexer *);
|
||||
void (*log)(const TSLexer *, const char *, ...);
|
||||
};
|
||||
|
||||
typedef enum {
|
||||
|
||||
31
tree-sitter.json
Normal file
31
tree-sitter.json
Normal file
@@ -0,0 +1,31 @@
|
||||
{
|
||||
"grammars": [
|
||||
{
|
||||
"name": "hcl",
|
||||
"camelcase": "Hcl",
|
||||
"scope": "source.hcl",
|
||||
"path": ".",
|
||||
"file-types": [
|
||||
"hcl",
|
||||
"tf",
|
||||
"tfvars"
|
||||
]
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"version": "0.2.0-snapshot",
|
||||
"license": "ISC",
|
||||
"description": "",
|
||||
"links": {
|
||||
"repository": "https://github.com/tree-sitter/tree-sitter-hcl"
|
||||
}
|
||||
},
|
||||
"bindings": {
|
||||
"c": true,
|
||||
"go": true,
|
||||
"node": true,
|
||||
"python": true,
|
||||
"rust": true,
|
||||
"swift": true
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user