diff options
author | Matthieu Coudron <mattator@gmail.com> | 2020-06-06 15:37:51 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-06 15:37:51 +0200 |
commit | dbc8ec94464049311e69274cad562585d7bb6749 (patch) | |
tree | 3f0580a30098f12aa0eb2749f588b503156a8ac6 /src/tree_sitter/parser.h | |
parent | 39f802bef4fa211349bc1489770645608466a378 (diff) | |
parent | 6b949211a06e21af67bf4cb3a20c6f87c932ef2a (diff) | |
download | rneovim-dbc8ec94464049311e69274cad562585d7bb6749.tar.gz rneovim-dbc8ec94464049311e69274cad562585d7bb6749.tar.bz2 rneovim-dbc8ec94464049311e69274cad562585d7bb6749.zip |
Merge pull request #12321 from vigoux/treesitter-runtime
treesitter: update runtime
Diffstat (limited to 'src/tree_sitter/parser.h')
-rw-r--r-- | src/tree_sitter/parser.h | 50 |
1 files changed, 31 insertions, 19 deletions
diff --git a/src/tree_sitter/parser.h b/src/tree_sitter/parser.h index 9df91f8c3c..11bf4fc42a 100644 --- a/src/tree_sitter/parser.h +++ b/src/tree_sitter/parser.h @@ -62,13 +62,13 @@ typedef struct { TSStateId state; bool extra : 1; bool repetition : 1; - }; + } shift; struct { TSSymbol symbol; int16_t dynamic_precedence; uint8_t child_count; uint8_t production_id; - }; + } reduce; } params; TSParseActionType type : 4; } TSParseAction; @@ -83,7 +83,7 @@ typedef union { struct { uint8_t count; bool reusable : 1; - }; + } entry; } TSParseActionEntry; struct TSLanguage { @@ -167,22 +167,28 @@ struct TSLanguage { #define ACTIONS(id) id -#define SHIFT(state_value) \ - { \ - { \ - .type = TSParseActionTypeShift, \ - .params = {.state = state_value}, \ - } \ +#define SHIFT(state_value) \ + { \ + { \ + .params = { \ + .shift = { \ + .state = state_value \ + } \ + }, \ + .type = TSParseActionTypeShift \ + } \ } #define SHIFT_REPEAT(state_value) \ { \ { \ - .type = TSParseActionTypeShift, \ .params = { \ - .state = state_value, \ - .repetition = true \ + .shift = { \ + .state = state_value, \ + .repetition = true \ + } \ }, \ + .type = TSParseActionTypeShift \ } \ } @@ -194,20 +200,26 @@ struct TSLanguage { #define SHIFT_EXTRA() \ { \ { \ - .type = TSParseActionTypeShift, \ - .params = {.extra = true} \ + .params = { \ + .shift = { \ + .extra = true \ + } \ + }, \ + .type = TSParseActionTypeShift \ } \ } #define REDUCE(symbol_val, child_count_val, ...) \ { \ { \ - .type = TSParseActionTypeReduce, \ .params = { \ - .symbol = symbol_val, \ - .child_count = child_count_val, \ - __VA_ARGS__ \ - } \ + .reduce = { \ + .symbol = symbol_val, \ + .child_count = child_count_val, \ + __VA_ARGS__ \ + }, \ + }, \ + .type = TSParseActionTypeReduce \ } \ } |