Refactor parser error messages

- move message generation to TSParseError,
  so that Parser doesn’t need to import <string>, and can
  be compiled as plain C.
This commit is contained in:
Max Brunsfeld 2014-01-11 17:59:45 -08:00
parent f342067293
commit 7a3092b765
9 changed files with 91 additions and 90 deletions

View file

@ -12,14 +12,13 @@ extern "C" {
typedef int TSState;
typedef struct TSStackEntry TSStackEntry;
typedef struct TSParser {
TSTree *tree;
const char *input;
const char *error_message;
size_t position;
TSTree *lookahead_node;
TSState lex_state;
TSStackEntry *stack;
size_t stack_size;
TSParseResult result;
} TSParser;
TSParser TSParserMake(const char *input);