Commit graph

962 commits

Author SHA1 Message Date
Max Brunsfeld
101e304a8a Avoid unnecessary lookahead set mutations in ParseItemSetBuilder 2016-11-20 21:41:36 -08:00
Max Brunsfeld
06215607d1 Precompute transitive closure contributions by grammar symbol 2016-11-20 11:49:55 -08:00
Max Brunsfeld
5332fd3418 Fix build warnings 2016-11-19 20:47:43 -08:00
Max Brunsfeld
6cf4ccb840 Represent rule metadata as a struct, not a map 2016-11-19 13:59:34 -08:00
Max Brunsfeld
cab1bd3ac5 Make conflict messages explicit about precedence combinations 2016-11-18 17:05:16 -08:00
Max Brunsfeld
5924285e69 🎨 2016-11-18 16:14:05 -08:00
Max Brunsfeld
32387400c6 Rework LR conflict resolution
* Unify precedence/associativity-based resolution with the
  search for a whitelisted conflict
* Improve conflict error messages
2016-11-18 13:50:55 -08:00
Max Brunsfeld
6935f1d26f Use hash_combine everywhere 2016-11-16 11:46:22 -08:00
Max Brunsfeld
6cfd009503 Compute parse state group signature based on the item set 2016-11-16 10:21:30 -08:00
Max Brunsfeld
42d37656ea Optimize remove_duplicate_parse_states method
Signed-off-by: Nathan Sobo <nathan@github.com>
2016-11-15 17:51:52 -08:00
Max Brunsfeld
e7217f1bac Clean up some methods in parser.c 2016-11-14 17:25:55 -08:00
Max Brunsfeld
535879a2bd Represent byte, char and tree counts as 32 bit numbers
The parser spends the majority of its time allocating and freeing trees and stack nodes.
Also, the memory footprint of the AST is a significant concern when using tree-sitter
with large files. This library is already unlikely to work very well with source files
larger than 4GB, so representing rows, columns, byte lengths and child indices as
unsigned 32 bit integers seems like the right choice.
2016-11-14 12:19:13 -08:00
Max Brunsfeld
8edb8df530 Remove extraneous Language methods 2016-11-14 10:35:33 -08:00
Max Brunsfeld
1118a9142a Introduce Symbol::Index type alias 2016-11-14 10:25:26 -08:00
Max Brunsfeld
1fddb124b3 Remove stray LOG_STACK() call 2016-11-14 09:32:05 -08:00
Max Brunsfeld
a89f8c086b Remove stray #include 2016-11-14 09:31:32 -08:00
Max Brunsfeld
fad7294ba4 Store shift states for non-terminals directly in the main parse table 2016-11-14 08:36:06 -08:00
Max Brunsfeld
8d9c261e3a Don't include reduce actions for nonterminal lookaheads 2016-11-10 11:33:37 -08:00
Max Brunsfeld
c9dcb29c6f Remove the TS prefix from some internal type/function names 2016-11-09 20:59:05 -08:00
Max Brunsfeld
255bc2427c 🎨 build_parse_table 2016-11-09 20:47:47 -08:00
Max Brunsfeld
7bcae8f6a8 🎨 flatten_grammar 2016-11-09 20:29:21 -08:00
Max Brunsfeld
89c01a7b22 🎨 tree_path.h 2016-11-09 20:25:03 -08:00
Max Brunsfeld
ad910ed4f5 Merge pull request #43 from tree-sitter/no-oom-recovery
Remove logic for recovering from OOM
2016-11-06 21:35:52 -08:00
Max Brunsfeld
3f0e63058b Fix handling of failure to descend when getting changed ranges 2016-11-05 21:26:01 -07:00
Max Brunsfeld
ff14cda959 Abort if malloc fails 2016-11-05 21:23:23 -07:00
Max Brunsfeld
ca45acd6af Suppress 'value computed is not used' warning on gcc 2016-11-05 21:23:03 -07:00
Max Brunsfeld
4106ecda43 Remove logic for recovering from OOM 2016-11-04 09:18:38 -07:00
Max Brunsfeld
3b3fddd64d Relax overly conservative parse state mergeability check
Built-in symbols (e.g. EOF, ERROR) should not prevent parse states from being
merged. Neither should non-token productions.
2016-10-26 21:58:15 -07:00
Max Brunsfeld
e53beb66c9 Avoid anonymous nested struct to silence override-init warnings 2016-10-26 11:10:56 -07:00
Timothy Clem
693c6d40dd Move setup of mergeable_symbols to constructor, use set throughout 2016-10-18 15:18:33 -07:00
Timothy Clem
14bae584d4 WIP: New check for mergable symbols in merge_state 2016-10-18 13:03:41 -07:00
Max Brunsfeld
5638fea120 Rename length_set_unknown -> length_set_unknown_chars 2016-10-16 21:21:53 -07:00
Max Brunsfeld
44b0c96579 Move point functions to their own file 2016-10-16 21:21:21 -07:00
Max Brunsfeld
eed54d95e1 Merge branch 'master' into changed-ranges 2016-10-16 21:10:25 -07:00
Max Brunsfeld
25d63d68f7 Move TreePath functions into their own file 2016-10-16 20:42:55 -07:00
Max Brunsfeld
b3140b2689 Implement ts_document_parse_and_get_changed_ranges 2016-10-15 22:31:21 -07:00
Max Brunsfeld
e149d94ff5 Remove generated parsers' dependency on runtime.h 2016-10-05 14:02:49 -07:00
Max Brunsfeld
3014101104 Fix inconsistencies in nodes sizes after edits 2016-09-19 13:35:08 -07:00
Max Brunsfeld
ae3b912ddc Escape unexpected characters when pretty-printing error nodes 2016-09-19 13:34:24 -07:00
Max Brunsfeld
fcf9293d35 Use explicit stack for assigning trees' parent pointers 2016-09-19 12:40:45 -07:00
Max Brunsfeld
00528e50ce Change edit API to be byte-based 2016-09-13 13:08:52 -07:00
Max Brunsfeld
cc62fe0375 Represent Lengths in terms of Points 2016-09-09 21:11:02 -07:00
Max Brunsfeld
591fcc980c Update trees' offsets when editing them 2016-09-08 17:54:51 -07:00
Max Brunsfeld
131bbee160 Rename parse_and_diff -> parse_and_get_changed_ranges
Signed-off-by: Nathan Sobo <nathan@github.com>
2016-09-08 17:51:34 -07:00
Max Brunsfeld
fce8d57152 Start work on document_parse_and_diff API 2016-09-08 17:51:20 -07:00
Max Brunsfeld
a6a08dde31 Rename ts_node_name -> ts_node_type 2016-09-06 21:43:59 -07:00
Max Brunsfeld
38241d466b Rename .read_fn, .seek_fn -> .read, .seek 2016-09-06 21:39:10 -07:00
Max Brunsfeld
f6da44fdbb Add ts_node_descendant_for_byte_range 2016-09-06 21:33:19 -07:00
Max Brunsfeld
70756034f1 Allow descendant queries by both 1D and 2D coordinates 2016-09-06 21:17:26 -07:00
Max Brunsfeld
096ac2d4b6 Rename ts_document_set_debugger -> ts_document_set_logger 2016-09-06 17:40:26 -07:00