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

build: regenerate parser [dependabot skip]

This commit is contained in:
dependabot[bot] 2026-07-12 11:52:52 +00:00
parent 7a5cb4b1cb
commit 8254f01fdb
2 changed files with 92 additions and 40 deletions

92
src/parser.c generated
View file

@ -331,20 +331,26 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) {
lookahead == ' ') SKIP(1); lookahead == ' ') SKIP(1);
if (('1' <= lookahead && lookahead <= '9')) ADVANCE(29); if (('1' <= lookahead && lookahead <= '9')) ADVANCE(29);
if (lookahead != 0 && if (lookahead != 0 &&
(lookahead < '"' || '$' < lookahead)) ADVANCE(45); (lookahead < '"' || '$' < lookahead) &&
lookahead != 0x17f &&
lookahead != 0x212a) ADVANCE(45);
END_STATE(); END_STATE();
case 2: case 2:
if (lookahead == '"') ADVANCE(25); if (lookahead == '"') ADVANCE(25);
if (lookahead == '$') ADVANCE(19); if (lookahead == '$') ADVANCE(19);
if (('\t' <= lookahead && lookahead <= '\r') || if (('\t' <= lookahead && lookahead <= '\r') ||
lookahead == ' ') ADVANCE(26); lookahead == ' ') ADVANCE(26);
if (lookahead != 0) ADVANCE(27); if (lookahead != 0 &&
lookahead != 0x17f &&
lookahead != 0x212a) ADVANCE(27);
END_STATE(); END_STATE();
case 3: case 3:
if (lookahead == '\'') ADVANCE(22); if (lookahead == '\'') ADVANCE(22);
if (('\t' <= lookahead && lookahead <= '\r') || if (('\t' <= lookahead && lookahead <= '\r') ||
lookahead == ' ') ADVANCE(23); lookahead == ' ') ADVANCE(23);
if (lookahead != 0) ADVANCE(24); if (lookahead != 0 &&
lookahead != 0x17f &&
lookahead != 0x212a) ADVANCE(24);
END_STATE(); END_STATE();
case 4: case 4:
if (lookahead == 'X' || if (lookahead == 'X' ||
@ -380,7 +386,9 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) {
case 11: case 11:
ACCEPT_TOKEN(sym_comment); ACCEPT_TOKEN(sym_comment);
if (lookahead != 0 && if (lookahead != 0 &&
lookahead != '\n') ADVANCE(11); lookahead != '\n' &&
lookahead != 0x17f &&
lookahead != 0x212a) ADVANCE(11);
END_STATE(); END_STATE();
case 12: case 12:
ACCEPT_TOKEN(sym_identifier); ACCEPT_TOKEN(sym_identifier);
@ -454,12 +462,16 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) {
if (('\t' <= lookahead && lookahead <= '\r') || if (('\t' <= lookahead && lookahead <= '\r') ||
lookahead == ' ') ADVANCE(23); lookahead == ' ') ADVANCE(23);
if (lookahead != 0 && if (lookahead != 0 &&
lookahead != '\'') ADVANCE(24); lookahead != '\'' &&
lookahead != 0x17f &&
lookahead != 0x212a) ADVANCE(24);
END_STATE(); END_STATE();
case 24: case 24:
ACCEPT_TOKEN(aux_sym__literal_string_token1); ACCEPT_TOKEN(aux_sym__literal_string_token1);
if (lookahead != 0 && if (lookahead != 0 &&
lookahead != '\'') ADVANCE(24); lookahead != '\'' &&
lookahead != 0x17f &&
lookahead != 0x212a) ADVANCE(24);
END_STATE(); END_STATE();
case 25: case 25:
ACCEPT_TOKEN(anon_sym_DQUOTE); ACCEPT_TOKEN(anon_sym_DQUOTE);
@ -470,13 +482,17 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) {
lookahead == ' ') ADVANCE(26); lookahead == ' ') ADVANCE(26);
if (lookahead != 0 && if (lookahead != 0 &&
lookahead != '"' && lookahead != '"' &&
lookahead != '$') ADVANCE(27); lookahead != '$' &&
lookahead != 0x17f &&
lookahead != 0x212a) ADVANCE(27);
END_STATE(); END_STATE();
case 27: case 27:
ACCEPT_TOKEN(aux_sym__string_token1); ACCEPT_TOKEN(aux_sym__string_token1);
if (lookahead != 0 && if (lookahead != 0 &&
lookahead != '"' && lookahead != '"' &&
lookahead != '$') ADVANCE(27); lookahead != '$' &&
lookahead != 0x17f &&
lookahead != 0x212a) ADVANCE(27);
END_STATE(); END_STATE();
case 28: case 28:
ACCEPT_TOKEN(sym_decimal); ACCEPT_TOKEN(sym_decimal);
@ -491,7 +507,9 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) {
(lookahead < '\t' || '\r' < lookahead) && (lookahead < '\t' || '\r' < lookahead) &&
lookahead != ' ' && lookahead != ' ' &&
(lookahead < '"' || '$' < lookahead) && (lookahead < '"' || '$' < lookahead) &&
lookahead != '\'') ADVANCE(45); lookahead != '\'' &&
lookahead != 0x17f &&
lookahead != 0x212a) ADVANCE(45);
END_STATE(); END_STATE();
case 30: case 30:
ACCEPT_TOKEN(sym_hexadecimal); ACCEPT_TOKEN(sym_hexadecimal);
@ -508,7 +526,9 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) {
(lookahead < '\t' || '\r' < lookahead) && (lookahead < '\t' || '\r' < lookahead) &&
lookahead != ' ' && lookahead != ' ' &&
(lookahead < '"' || '$' < lookahead) && (lookahead < '"' || '$' < lookahead) &&
lookahead != '\'') ADVANCE(45); lookahead != '\'' &&
lookahead != 0x17f &&
lookahead != 0x212a) ADVANCE(45);
END_STATE(); END_STATE();
case 32: case 32:
ACCEPT_TOKEN(sym_float); ACCEPT_TOKEN(sym_float);
@ -521,7 +541,9 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) {
(lookahead < '\t' || '\r' < lookahead) && (lookahead < '\t' || '\r' < lookahead) &&
lookahead != ' ' && lookahead != ' ' &&
(lookahead < '"' || '$' < lookahead) && (lookahead < '"' || '$' < lookahead) &&
lookahead != '\'') ADVANCE(45); lookahead != '\'' &&
lookahead != 0x17f &&
lookahead != 0x212a) ADVANCE(45);
END_STATE(); END_STATE();
case 34: case 34:
ACCEPT_TOKEN(sym_boolean); ACCEPT_TOKEN(sym_boolean);
@ -529,7 +551,9 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) {
(lookahead < '\t' || '\r' < lookahead) && (lookahead < '\t' || '\r' < lookahead) &&
lookahead != ' ' && lookahead != ' ' &&
(lookahead < '"' || '$' < lookahead) && (lookahead < '"' || '$' < lookahead) &&
lookahead != '\'') ADVANCE(45); lookahead != '\'' &&
lookahead != 0x17f &&
lookahead != 0x212a) ADVANCE(45);
END_STATE(); END_STATE();
case 35: case 35:
ACCEPT_TOKEN(sym_value); ACCEPT_TOKEN(sym_value);
@ -538,7 +562,9 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) {
(lookahead < '\t' || '\r' < lookahead) && (lookahead < '\t' || '\r' < lookahead) &&
lookahead != ' ' && lookahead != ' ' &&
(lookahead < '"' || '$' < lookahead) && (lookahead < '"' || '$' < lookahead) &&
lookahead != '\'') ADVANCE(45); lookahead != '\'' &&
lookahead != 0x17f &&
lookahead != 0x212a) ADVANCE(45);
END_STATE(); END_STATE();
case 36: case 36:
ACCEPT_TOKEN(sym_value); ACCEPT_TOKEN(sym_value);
@ -547,7 +573,9 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) {
(lookahead < '\t' || '\r' < lookahead) && (lookahead < '\t' || '\r' < lookahead) &&
lookahead != ' ' && lookahead != ' ' &&
(lookahead < '"' || '$' < lookahead) && (lookahead < '"' || '$' < lookahead) &&
lookahead != '\'') ADVANCE(45); lookahead != '\'' &&
lookahead != 0x17f &&
lookahead != 0x212a) ADVANCE(45);
END_STATE(); END_STATE();
case 37: case 37:
ACCEPT_TOKEN(sym_value); ACCEPT_TOKEN(sym_value);
@ -556,7 +584,9 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) {
(lookahead < '\t' || '\r' < lookahead) && (lookahead < '\t' || '\r' < lookahead) &&
lookahead != ' ' && lookahead != ' ' &&
(lookahead < '"' || '$' < lookahead) && (lookahead < '"' || '$' < lookahead) &&
lookahead != '\'') ADVANCE(45); lookahead != '\'' &&
lookahead != 0x17f &&
lookahead != 0x212a) ADVANCE(45);
END_STATE(); END_STATE();
case 38: case 38:
ACCEPT_TOKEN(sym_value); ACCEPT_TOKEN(sym_value);
@ -565,7 +595,9 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) {
(lookahead < '\t' || '\r' < lookahead) && (lookahead < '\t' || '\r' < lookahead) &&
lookahead != ' ' && lookahead != ' ' &&
(lookahead < '"' || '$' < lookahead) && (lookahead < '"' || '$' < lookahead) &&
lookahead != '\'') ADVANCE(45); lookahead != '\'' &&
lookahead != 0x17f &&
lookahead != 0x212a) ADVANCE(45);
END_STATE(); END_STATE();
case 39: case 39:
ACCEPT_TOKEN(sym_value); ACCEPT_TOKEN(sym_value);
@ -574,7 +606,9 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) {
(lookahead < '\t' || '\r' < lookahead) && (lookahead < '\t' || '\r' < lookahead) &&
lookahead != ' ' && lookahead != ' ' &&
(lookahead < '"' || '$' < lookahead) && (lookahead < '"' || '$' < lookahead) &&
lookahead != '\'') ADVANCE(45); lookahead != '\'' &&
lookahead != 0x17f &&
lookahead != 0x212a) ADVANCE(45);
END_STATE(); END_STATE();
case 40: case 40:
ACCEPT_TOKEN(sym_value); ACCEPT_TOKEN(sym_value);
@ -583,7 +617,9 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) {
(lookahead < '\t' || '\r' < lookahead) && (lookahead < '\t' || '\r' < lookahead) &&
lookahead != ' ' && lookahead != ' ' &&
(lookahead < '"' || '$' < lookahead) && (lookahead < '"' || '$' < lookahead) &&
lookahead != '\'') ADVANCE(45); lookahead != '\'' &&
lookahead != 0x17f &&
lookahead != 0x212a) ADVANCE(45);
END_STATE(); END_STATE();
case 41: case 41:
ACCEPT_TOKEN(sym_value); ACCEPT_TOKEN(sym_value);
@ -593,7 +629,9 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) {
(lookahead < '\t' || '\r' < lookahead) && (lookahead < '\t' || '\r' < lookahead) &&
lookahead != ' ' && lookahead != ' ' &&
(lookahead < '"' || '$' < lookahead) && (lookahead < '"' || '$' < lookahead) &&
lookahead != '\'') ADVANCE(45); lookahead != '\'' &&
lookahead != 0x17f &&
lookahead != 0x212a) ADVANCE(45);
END_STATE(); END_STATE();
case 42: case 42:
ACCEPT_TOKEN(sym_value); ACCEPT_TOKEN(sym_value);
@ -602,7 +640,9 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) {
(lookahead < '\t' || '\r' < lookahead) && (lookahead < '\t' || '\r' < lookahead) &&
lookahead != ' ' && lookahead != ' ' &&
(lookahead < '"' || '$' < lookahead) && (lookahead < '"' || '$' < lookahead) &&
lookahead != '\'') ADVANCE(45); lookahead != '\'' &&
lookahead != 0x17f &&
lookahead != 0x212a) ADVANCE(45);
END_STATE(); END_STATE();
case 43: case 43:
ACCEPT_TOKEN(sym_value); ACCEPT_TOKEN(sym_value);
@ -611,7 +651,9 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) {
(lookahead < '\t' || '\r' < lookahead) && (lookahead < '\t' || '\r' < lookahead) &&
lookahead != ' ' && lookahead != ' ' &&
(lookahead < '"' || '$' < lookahead) && (lookahead < '"' || '$' < lookahead) &&
lookahead != '\'') ADVANCE(45); lookahead != '\'' &&
lookahead != 0x17f &&
lookahead != 0x212a) ADVANCE(45);
END_STATE(); END_STATE();
case 44: case 44:
ACCEPT_TOKEN(sym_value); ACCEPT_TOKEN(sym_value);
@ -622,7 +664,9 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) {
(lookahead < '\t' || '\r' < lookahead) && (lookahead < '\t' || '\r' < lookahead) &&
lookahead != ' ' && lookahead != ' ' &&
(lookahead < '"' || '$' < lookahead) && (lookahead < '"' || '$' < lookahead) &&
lookahead != '\'') ADVANCE(45); lookahead != '\'' &&
lookahead != 0x17f &&
lookahead != 0x212a) ADVANCE(45);
END_STATE(); END_STATE();
case 45: case 45:
ACCEPT_TOKEN(sym_value); ACCEPT_TOKEN(sym_value);
@ -630,7 +674,9 @@ static bool ts_lex(TSLexer *lexer, TSStateId state) {
(lookahead < '\t' || '\r' < lookahead) && (lookahead < '\t' || '\r' < lookahead) &&
lookahead != ' ' && lookahead != ' ' &&
(lookahead < '"' || '$' < lookahead) && (lookahead < '"' || '$' < lookahead) &&
lookahead != '\'') ADVANCE(45); lookahead != '\'' &&
lookahead != 0x17f &&
lookahead != 0x212a) ADVANCE(45);
END_STATE(); END_STATE();
default: default:
return false; return false;

View file

@ -50,12 +50,18 @@ extern "C" {
/// memory allocated for the array's contents. /// memory allocated for the array's contents.
#define array_clear(self) ((self)->size = 0) #define array_clear(self) ((self)->size = 0)
#ifdef __cplusplus
#define _array__cast(self, expr) (decltype((self)->contents))(expr)
#else
#define _array__cast(self, expr) (expr)
#endif
/// Reserve `new_capacity` elements of space in the array. If `new_capacity` is /// Reserve `new_capacity` elements of space in the array. If `new_capacity` is
/// less than the array's current capacity, this function has no effect. /// less than the array's current capacity, this function has no effect.
#define array_reserve(self, new_capacity) \ #define array_reserve(self, new_capacity) \
((self)->contents = _array__reserve( \ ((self)->contents = _array__cast(self, _array__reserve( \
(void *)(self)->contents, &(self)->capacity, \ (void *)(self)->contents, &(self)->capacity, \
array_elem_size(self), new_capacity) \ array_elem_size(self), new_capacity)) \
) )
/// Free any memory allocated for this array. Note that this does not free any /// Free any memory allocated for this array. Note that this does not free any
@ -71,10 +77,10 @@ extern "C" {
/// Push a new `element` onto the end of the array. /// Push a new `element` onto the end of the array.
#define array_push(self, element) \ #define array_push(self, element) \
do { \ do { \
(self)->contents = _array__grow( \ (self)->contents = _array__cast(self, _array__grow( \
(void *)(self)->contents, (self)->size, &(self)->capacity, \ (void *)(self)->contents, (self)->size, &(self)->capacity, \
1, array_elem_size(self) \ 1, array_elem_size(self) \
); \ )); \
(self)->contents[(self)->size++] = (element); \ (self)->contents[(self)->size++] = (element); \
} while(0) } while(0)
@ -83,10 +89,10 @@ extern "C" {
#define array_grow_by(self, count) \ #define array_grow_by(self, count) \
do { \ do { \
if ((count) == 0) break; \ if ((count) == 0) break; \
(self)->contents = _array__grow( \ (self)->contents = _array__cast(self, _array__grow( \
(self)->contents, (self)->size, &(self)->capacity, \ (self)->contents, (self)->size, &(self)->capacity, \
count, array_elem_size(self) \ count, array_elem_size(self) \
); \ )); \
memset((self)->contents + (self)->size, 0, (count) * array_elem_size(self)); \ memset((self)->contents + (self)->size, 0, (count) * array_elem_size(self)); \
(self)->size += (count); \ (self)->size += (count); \
} while (0) } while (0)
@ -98,26 +104,26 @@ extern "C" {
/// Append `count` elements to the end of the array, reading their values from the /// Append `count` elements to the end of the array, reading their values from the
/// `contents` pointer. /// `contents` pointer.
#define array_extend(self, count, other_contents) \ #define array_extend(self, count, other_contents) \
(self)->contents = _array__splice( \ ((self)->contents = _array__cast(self, _array__splice( \
(void*)(self)->contents, &(self)->size, &(self)->capacity, \ (void*)(self)->contents, &(self)->size, &(self)->capacity, \
array_elem_size(self), (self)->size, 0, count, other_contents \ array_elem_size(self), (self)->size, 0, count, other_contents \
) )))
/// Remove `old_count` elements from the array starting at the given `index`. At /// Remove `old_count` elements from the array starting at the given `index`. At
/// the same index, insert `new_count` new elements, reading their values from the /// the same index, insert `new_count` new elements, reading their values from the
/// `new_contents` pointer. /// `new_contents` pointer.
#define array_splice(self, _index, old_count, new_count, new_contents) \ #define array_splice(self, _index, old_count, new_count, new_contents) \
(self)->contents = _array__splice( \ ((self)->contents = _array__cast(self, _array__splice( \
(void *)(self)->contents, &(self)->size, &(self)->capacity, \ (void *)(self)->contents, &(self)->size, &(self)->capacity, \
array_elem_size(self), _index, old_count, new_count, new_contents \ array_elem_size(self), _index, old_count, new_count, new_contents \
) )))
/// Insert one `element` into the array at the given `index`. /// Insert one `element` into the array at the given `index`.
#define array_insert(self, _index, element) \ #define array_insert(self, _index, element) \
(self)->contents = _array__splice( \ ((self)->contents = _array__cast(self, _array__splice( \
(void *)(self)->contents, &(self)->size, &(self)->capacity, \ (void *)(self)->contents, &(self)->size, &(self)->capacity, \
array_elem_size(self), _index, 0, 1, &(element) \ array_elem_size(self), _index, 0, 1, &(element) \
) )))
/// Remove one element from the array at the given `index`. /// Remove one element from the array at the given `index`.
#define array_erase(self, _index) \ #define array_erase(self, _index) \
@ -128,17 +134,17 @@ extern "C" {
/// Assign the contents of one array to another, reallocating if necessary. /// Assign the contents of one array to another, reallocating if necessary.
#define array_assign(self, other) \ #define array_assign(self, other) \
(self)->contents = _array__assign( \ ((self)->contents = _array__cast(self, _array__assign( \
(void *)(self)->contents, &(self)->size, &(self)->capacity, \ (void *)(self)->contents, &(self)->size, &(self)->capacity, \
(const void *)(other)->contents, (other)->size, array_elem_size(self) \ (const void *)(other)->contents, (other)->size, array_elem_size(self) \
) )))
/// Swap one array with another /// Swap one array with another
#define array_swap(self, other) \ #define array_swap(self, other) \
do { \ do { \
void *_array_swap_tmp = (void *)(self)->contents; \ void *_array_swap_tmp = (void *)(self)->contents; \
(self)->contents = (other)->contents; \ (self)->contents = (other)->contents; \
(other)->contents = _array_swap_tmp; \ (other)->contents = _array__cast(other, _array_swap_tmp); \
_array__swap(&(self)->size, &(self)->capacity, \ _array__swap(&(self)->size, &(self)->capacity, \
&(other)->size, &(other)->capacity); \ &(other)->size, &(other)->capacity); \
} while (0) } while (0)