⬆️ tree-sitter-cli, add explicit word token
This commit is contained in:
parent
7b003599b3
commit
44b3de2594
|
@ -43,6 +43,8 @@ module.exports = grammar({
|
||||||
token(choice(/\s/, '\\\n')),
|
token(choice(/\s/, '\\\n')),
|
||||||
],
|
],
|
||||||
|
|
||||||
|
word: $ => $.word,
|
||||||
|
|
||||||
rules: {
|
rules: {
|
||||||
program: $ => repeat($._terminated_statement),
|
program: $ => repeat($._terminated_statement),
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
"nan": "^2.10.0"
|
"nan": "^2.10.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"tree-sitter-cli": "^0.12.2"
|
"tree-sitter-cli": "^0.12.6"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "tree-sitter generate && node-gyp build",
|
"build": "tree-sitter generate && node-gyp build",
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "bash",
|
"name": "bash",
|
||||||
|
"word": "word",
|
||||||
"rules": {
|
"rules": {
|
||||||
"program": {
|
"program": {
|
||||||
"type": "REPEAT",
|
"type": "REPEAT",
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -13,7 +13,10 @@ extern "C" {
|
||||||
#define ts_builtin_sym_end 0
|
#define ts_builtin_sym_end 0
|
||||||
#define TREE_SITTER_SERIALIZATION_BUFFER_SIZE 1024
|
#define TREE_SITTER_SERIALIZATION_BUFFER_SIZE 1024
|
||||||
|
|
||||||
|
#ifndef TREE_SITTER_RUNTIME_H_
|
||||||
typedef uint16_t TSSymbol;
|
typedef uint16_t TSSymbol;
|
||||||
|
typedef struct TSLanguage TSLanguage;
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef uint16_t TSStateId;
|
typedef uint16_t TSStateId;
|
||||||
|
|
||||||
|
@ -67,7 +70,7 @@ typedef union {
|
||||||
};
|
};
|
||||||
} TSParseActionEntry;
|
} TSParseActionEntry;
|
||||||
|
|
||||||
typedef struct TSLanguage {
|
struct TSLanguage {
|
||||||
uint32_t version;
|
uint32_t version;
|
||||||
uint32_t symbol_count;
|
uint32_t symbol_count;
|
||||||
uint32_t alias_count;
|
uint32_t alias_count;
|
||||||
|
@ -92,7 +95,7 @@ typedef struct TSLanguage {
|
||||||
unsigned (*serialize)(void *, char *);
|
unsigned (*serialize)(void *, char *);
|
||||||
void (*deserialize)(void *, const char *, unsigned);
|
void (*deserialize)(void *, const char *, unsigned);
|
||||||
} external_scanner;
|
} external_scanner;
|
||||||
} TSLanguage;
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Lexer Macros
|
* Lexer Macros
|
||||||
|
|
Loading…
Reference in New Issue