Remove generated parsers' dependency on the runtime library
Generated parsers no longer export a parser constructor function. They now export an opaque Language object which can be set on Documents directly. This way, the logic for constructing parsers lives entirely in the runtime. The Languages are just structs which have no load-time dependency on the runtime
This commit is contained in:
parent
048a479b5f
commit
eecbcccee0
21 changed files with 219 additions and 173 deletions
16
src/runtime/lexer.h
Normal file
16
src/runtime/lexer.h
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
#ifndef RUNTIME_LEXER_H_
|
||||
#define RUNTIME_LEXER_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "tree_sitter/parser.h"
|
||||
|
||||
TSLexer ts_lexer_make();
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // RUNTIME_LEXER_H_
|
||||
Loading…
Add table
Add a link
Reference in a new issue