Commit graph

22 commits

Author SHA1 Message Date
Max Brunsfeld
e149d94ff5 Remove generated parsers' dependency on runtime.h 2016-10-05 14:02:49 -07:00
Max Brunsfeld
8c26d99353 Store error recovery actions in the normal parse table 2016-06-27 14:07:47 -07:00
Max Brunsfeld
57f669dfda clang-format 2016-06-22 14:11:08 -07:00
Max Brunsfeld
43ae8235fd Remove the error action; a lack of actions implies an error. 2016-06-21 22:53:48 -07:00
Max Brunsfeld
38c144b4a3 Refine logic for deciding when tokens need to be re-lexed
* While generating the lex table, note which tokens can match the
  same string. A token needs to be relexed when it has possible
  homonyms in the current state.
* Also note which tokens can match substrings of each other tokens.
  A token needs to be relexed when there are viable tokens that
  could match longer strings in the current state and the next
  token has been edited.
* Remove the logic for marking tokens as fragile on creation.
* Store the reusability/non-reusability of symbols off of individual
  actions and onto the entire entry for the state & symbol.
2016-06-21 07:28:04 -07:00
Max Brunsfeld
96e2e49ef8 Fix false positive when marking nodes unreusable due to ambiguity 2016-05-30 14:16:55 -07:00
Max Brunsfeld
1e353381ff Don't create error node in lexer unless token is completely invalid
Before, any syntax error would cause the lexer to create an error
leaf node. This could happen even with a valid input, if the parse
stack had split and one particular version of the parse stack
failed to parse.

Now, an error leaf node is only created when the lexer cannot understand
part of the input stream at all. When a normal syntax error occurs,
the lexer just returns a token that is outside of the expected token
set, and the parser handles the unexpected token.
2016-05-26 14:15:10 -07:00
Max Brunsfeld
22c550c9d6 Discard tokens after error detection to find the best repair
* Use GLR stack-splitting to try all numbers of tokens to
  discard until a repair is found.
* Check the validity of repairs by looking at the child trees,
  rather than the statically-computed 'in-progress symbols' list
2016-05-11 13:49:43 -07:00
Max Brunsfeld
9ad1e36238 Rename out_of_context_states -> recovery_states 2016-04-27 14:14:56 -07:00
Max Brunsfeld
f63fcffe95 Fix incorrect cast in ts_language_symbol_is_in_progress 2016-04-18 11:17:07 -07:00
Max Brunsfeld
2e35587161 Use new stack_pop_until function for repairing errors 2016-03-07 20:06:46 -08:00
Max Brunsfeld
e0c24e3be6 Remove old error recovery code 2016-03-02 20:58:39 -08:00
Max Brunsfeld
501e426d29 Add function exposing in-progress symbols for each state 2016-03-02 20:58:08 -08:00
Max Brunsfeld
c8d7c16f87 Use out-of-context states when in error parse state 2016-03-02 20:56:05 -08:00
Max Brunsfeld
2b35890bbb Add ts_node_symbols() function 2016-02-19 15:41:30 -08:00
Max Brunsfeld
4ad1a666be clang-format 2015-12-29 21:17:31 -08:00
Max Brunsfeld
97a281502e Store parse table more compactly 2015-12-29 11:27:41 -08:00
Max Brunsfeld
467930a785 Move some ts_language functions to the right file 2015-11-20 12:00:49 -08:00
Rob Rix
f86789126d Include the correct file. 2015-10-29 13:26:12 -04:00
Rob Rix
007f519028 Name the parameter. 2015-10-29 12:47:04 -04:00
Rob Rix
04f3bf0b32 Implement ts_language_symbol_count. 2015-10-29 12:45:28 -04:00
Rob Rix
ecf79564f0 Implement symbol name retrieval on TSLanguage. 2015-10-29 12:42:52 -04:00