Fix parser position in parse error messages

This commit is contained in:
Max Brunsfeld 2014-01-13 12:57:12 -08:00
parent a21c42ca85
commit 4cacdcba70
2 changed files with 3 additions and 1 deletions

View file

@ -19,7 +19,7 @@ const char * TSParseErrorToString(const TSParseError *error, const char *input_s
result += "Expected: ";
for (int i = 0; i < error->expected_input_count; i++)
result += string(" '") + error->expected_inputs[i] + "'";
result += error->expected_inputs[i];
char *stuff = (char *)malloc(result.size() * sizeof(char));
strcpy(stuff, result.c_str());