Refactor parser header
Make separate lexer, stack and parser structs.
This commit is contained in:
parent
05a5f9c124
commit
0dc3a95d0c
11 changed files with 361 additions and 276 deletions
10
src/runtime/parser.c
Normal file
10
src/runtime/parser.c
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
#include "tree_sitter/runtime.h"
|
||||
|
||||
const ts_tree * ts_parser_parse(ts_parser *parser, ts_input input) {
|
||||
return parser->parse_fn(parser->data, input);
|
||||
}
|
||||
|
||||
void ts_parser_free(ts_parser *parser) {
|
||||
if (parser->free_fn != NULL)
|
||||
parser->free_fn(parser->data);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue