mirror of
https://github.com/janet-lang/janet
synced 2025-10-30 07:03:02 +00:00
Allow parser to parse files rather than just a repl. I think
there are some memory leak issues (problems with gc).
This commit is contained in:
@@ -20,7 +20,8 @@ struct GstParser {
|
||||
enum {
|
||||
GST_PARSER_PENDING = 0,
|
||||
GST_PARSER_FULL,
|
||||
GST_PARSER_ERROR
|
||||
GST_PARSER_ERROR,
|
||||
GST_PARSER_ROOT
|
||||
} status;
|
||||
};
|
||||
|
||||
@@ -37,4 +38,12 @@ int gst_parse_cstring(GstParser *p, const char *string);
|
||||
/* Parse a gst string. Returns number of bytes read */
|
||||
int gst_parse_string(GstParser *p, const uint8_t *string);
|
||||
|
||||
/* Check if a parser has a value that needs to be handled. If
|
||||
* so, the parser will not parse any more input until that value
|
||||
* is consumed. */
|
||||
int gst_parse_hasvalue(GstParser *p);
|
||||
|
||||
/* Gets a value from the parser */
|
||||
GstValue gst_parse_consume(GstParser *p);
|
||||
|
||||
#endif /* end of include guard: PARSE_H_ONYWMADW */
|
||||
|
||||
Reference in New Issue
Block a user