Commit graph

265 commits

Author SHA1 Message Date
joshvera
cf72f2f0ae ts_node_size_point 2015-11-18 16:47:27 -08:00
joshvera
eb2a18cf16 s/TSLength/TSPoint 2015-11-18 16:46:09 -08:00
joshvera
6485e27d70 add ts_node_end_point 2015-11-18 16:45:10 -08:00
joshvera
b0f6bac3ab replace start and end with padding and size 2015-11-18 16:34:50 -08:00
joshvera
a85b7fe3c4 start column at 0 again 2015-11-16 16:59:12 -08:00
joshvera
fc49a3949a try resetting to 1 2015-11-13 14:13:16 -05:00
joshvera
8058500c5b Add source info to TSTree 2015-11-12 15:32:53 -05:00
joshvera
bf666351e9 Set token_end_source_info 2015-11-12 13:28:33 -05:00
joshvera
e60ab58187 maybe increment line and column here? 2015-11-12 13:25:35 -05:00
joshvera
e3936e71fd Merge remote-tracking branch 'origin/master' into line-numbers 2015-11-12 13:14:17 -05:00
joshvera
e720922662 Add source info to TSLexer 2015-11-12 12:24:05 -05:00
Max Brunsfeld
46e99d3e42 Retrieve the shift action correctly when reducing and recovering 2015-11-11 17:53:45 -08:00
Max Brunsfeld
483577f00d Fix error when merging nodes at the base of the parse stack 2015-11-11 17:31:40 -08:00
Max Brunsfeld
40a90b551a Allow error recovery to look all the way to the bottom of the stack
Previously, there was a bug where the first node on the stack
would never be popped
2015-11-11 16:59:41 -08:00
Max Brunsfeld
1a5d5b3156 Make ambiguities resolve deterministically
In the future, they should resolve according to some kind of dynamic
precedence annotations provided in the grammars. For now, this at least makes
them fully deterministic, so that tests won't fail due to ambiguities resolving
differently after undone edits.
2015-11-11 16:54:03 -08:00
Max Brunsfeld
30b6530fd1 Account for parse stack merges when shifting
Previously, when the parse stack was split into 3 or more heads, it was
possible for head 3 to be accidentally skipped if head 2 merged with head 1.
2015-11-05 21:21:18 -08:00
Max Brunsfeld
a26d7849ce Merge pull request #2 from robrix/get-symbol-names-from-documents
Get symbol names from documents
2015-10-29 10:51:13 -07: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
Rob Rix
8143224098 Implement ts_document_symbol_name. 2015-10-28 17:13:31 -04:00
Max Brunsfeld
f5d861a019 Fix bug where ts_stack_pop results were backwards for some stack configurations 2015-10-28 12:10:45 -07:00
Max Brunsfeld
36eae5d5e9 Add option to tree_string to include anonymous tokens 2015-10-28 12:09:28 -07:00
Max Brunsfeld
c885eea706 Add current position to lexer debug message 2015-10-26 12:47:54 -07:00
Max Brunsfeld
1829b34c6f Fix child count error when documents starts w/ ubiquitous tokens 2015-10-24 13:45:42 -07:00
Max Brunsfeld
500533476b Fix bugs in handling multiple simultaneous ambiguities 2015-10-22 11:42:38 -07:00
Max Brunsfeld
0955f660d0 Add ts_document_invalidate, for forcing a full re-parse 2015-10-18 13:05:40 -07:00
Max Brunsfeld
216ce8c80b Rename receiver parameter to 'self' 2015-10-14 22:14:08 -07:00
Max Brunsfeld
3ee58461d7 Clean up main parser loop 2015-10-07 13:05:36 -07:00
Max Brunsfeld
8ef25ffef3 Try lexing using each parse stack head's state
This fixes the case where the parse stack is split and the top states
have different valid lookahead symbols
2015-10-06 16:22:58 -07:00
Max Brunsfeld
85466a5b22 Clean up and document ts_parser__next function 2015-10-06 11:43:34 -07:00
Max Brunsfeld
03e7fc49fd Fix bug in parse stack splitting logic for GLR 2015-10-06 10:50:51 -07:00
Max Brunsfeld
e7838d520a Remove invalid assertion in ts_tree_edit 2015-09-22 21:02:25 -07:00
Max Brunsfeld
aba8af9e5b Cleanup debug logging in parser 2015-09-22 19:35:13 -07:00
Max Brunsfeld
7be067a2e9 Guard for null tree in ts_document_edit 2015-09-20 13:39:18 -07:00
Max Brunsfeld
673ca411b1 Fix lint errors 2015-09-19 13:19:49 -07:00
Max Brunsfeld
f37f73f92f Add ability to edit multiple times between parses 2015-09-18 23:20:06 -07:00
Max Brunsfeld
6254f45c1b Rename ParseStack -> Stack 2015-09-18 22:02:06 -07:00
Max Brunsfeld
b3d883e128 Store edits in trees, not by splitting stack
This allows for multiple edits per parse, though it is not exposed through
the API yet
2015-09-18 22:02:06 -07:00
Max Brunsfeld
0467d190fe Add ts_tree_edit function 2015-09-18 22:02:06 -07:00
Max Brunsfeld
296d8cc1e8 clang-format 2015-09-13 19:41:11 -07:00
Max Brunsfeld
c09947146a Remove not-necessarily-valid assertion 2015-09-10 16:26:23 -07:00
Max Brunsfeld
66ad271c82 Add Document parse_count() method, for tracking if trees are still valid 2015-09-10 14:23:42 -07:00
Max Brunsfeld
f5f24a708e Remove unnecessary named TSTreeOptions struct 2015-09-09 13:00:07 -07:00
Max Brunsfeld
fe3be2aa53 Optimize Node parent() method 2015-09-09 12:43:35 -07:00
Max Brunsfeld
252fa7b631 Add Document getter methods for input, language 2015-09-08 23:33:43 -07:00
Max Brunsfeld
ebd60213d9 Drop release functions from callback structs
The caller can just as easily take care of the cleanup explicitly
2015-09-08 23:24:33 -07:00
Max Brunsfeld
7ee5eaa16a Rename node accessor methods
Instead of child() vs concrete_child(), next_sibling() vs next_concrete_sibling(), etc,
the default is switched: child() refers to the concrete syntax tree, and named_child()
refers to the AST. Because the AST is abstract through exclusion of some nodes, the
names are clearer if the qualifier goes on the AST operations
2015-09-08 23:16:24 -07:00
Max Brunsfeld
245daffbc4 Add {next,prev}_concrete_sibling Node methods 2015-09-08 21:43:37 -07:00