Works as intended except for SEGFAULT in free, need to check vec impl
This commit is contained in:
parent
9f6b90d596
commit
efec224b6a
7 changed files with 1427 additions and 10 deletions
|
|
@ -1,6 +1,9 @@
|
|||
#include "tree_sitter/array.h"
|
||||
#include "tree_sitter/parser.h"
|
||||
|
||||
/*
|
||||
#include "array.h"
|
||||
#include "parser.h"
|
||||
*/
|
||||
#include <assert.h>
|
||||
#include <ctype.h>
|
||||
#include <string.h>
|
||||
|
|
@ -249,7 +252,7 @@ static inline bool scan_bare_dollar(TSLexer *lexer)
|
|||
{
|
||||
while (iswspace(lexer->lookahead) && lexer->lookahead != '\n' && !lexer->eof(lexer))
|
||||
skip(lexer);
|
||||
|
||||
|
||||
|
||||
if (lexer->lookahead == '$')
|
||||
{
|
||||
|
|
@ -378,7 +381,7 @@ static bool scan_heredoc_content(Scanner *scanner, TSLexer *lexer, enum TokenTyp
|
|||
{
|
||||
if (lexer->result_symbol == HEREDOC_END)
|
||||
{
|
||||
array_pop(&scanner->heredocs);
|
||||
(void)array_pop(&scanner->heredocs);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
@ -521,7 +524,7 @@ static bool scan(Scanner *scanner, TSLexer *lexer, const bool *valid_symbols)
|
|||
{
|
||||
array_delete(&heredoc->current_leading_word);
|
||||
array_delete(&heredoc->delimiter);
|
||||
array_pop(&scanner->heredocs);
|
||||
(void)array_pop(&scanner->heredocs);
|
||||
lexer->result_symbol = HEREDOC_END;
|
||||
return true;
|
||||
}
|
||||
|
|
@ -727,7 +730,6 @@ static bool scan(Scanner *scanner, TSLexer *lexer, const bool *valid_symbols)
|
|||
return true;
|
||||
}
|
||||
|
||||
regex:
|
||||
if ((valid_symbols[REGEX]) && !in_error_recovery(valid_symbols))
|
||||
{
|
||||
if (valid_symbols[REGEX])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue