Commit graph

40 commits

Author SHA1 Message Date
Max Brunsfeld
22ee68e1a9 Make node for each var assignment in JS grammar 2014-10-15 15:04:57 -07:00
Max Brunsfeld
d3137c6ac6 Organize parser spec 2014-10-14 23:23:12 -07:00
Max Brunsfeld
fb38140317 Discard portion of right subtree that is within the edited region 2014-10-12 11:51:12 -07:00
Max Brunsfeld
f460b921e2 Fix off-by-one error in storing reusable right-subtree 2014-10-10 12:10:23 -07:00
Max Brunsfeld
4dcc712a8c Start work on re-using right side of parse tree 2014-10-09 19:58:15 -07:00
Max Brunsfeld
af7f57a80e Fix sizing of error nodes after edits 2014-10-05 16:56:50 -07:00
Max Brunsfeld
808b003f1a Read unicode characters correctly in Lexer advance 2014-10-03 15:44:49 -07:00
Max Brunsfeld
a69dfa08f3 Add spec for inserting text w/ unicode characters 2014-10-02 11:54:00 -07:00
Max Brunsfeld
8bee9d8fb9 Fix typo in parser spec descriptions 2014-10-02 11:52:58 -07:00
Max Brunsfeld
5f313896c3 Make ::input a method on SpyReader, not a field 2014-09-30 14:57:57 -07:00
Max Brunsfeld
8d7d9af661 Remove unnecessary helper function in parser spec 2014-09-29 10:51:12 -07:00
Max Brunsfeld
700919951e Reorganize parser spec about handling edits 2014-09-29 10:48:35 -07:00
Max Brunsfeld
7988829c08 Add spec for recognition of UTF8 characters 2014-09-27 16:00:48 -07:00
Max Brunsfeld
c1565c1aae Track AST nodes' sizes in characters as well as bytes
The `pos` and `size` functions for Nodes now return TSLength structs,
which contain lengths in both characters and bytes. This is important
for knowing the number of unicode characters in a Node.
2014-09-26 16:15:07 -07:00
Max Brunsfeld
68d6e242ee Fix parsing of wildcard patterns at the ends of documents
- Remove special EOF handling from lexer
- Explicitly exclude the EOF character from all-inclusive character sets.
2014-09-11 13:10:23 -07:00
Max Brunsfeld
f05762b4a0 Move parser tests into their own file 2014-09-10 18:49:53 -07:00
Max Brunsfeld
9302080aa6 Remove unit test on parser
It wasn't adding any value
2014-08-09 00:00:20 -07:00
Max Brunsfeld
b155994491 Fix indentation in specs 2014-08-07 08:11:21 -07:00
Max Brunsfeld
0d6d09cbd9 In generated parsers, export language as a function 2014-07-31 13:04:46 -07:00
Max Brunsfeld
eecbcccee0 Remove generated parsers' dependency on the runtime library
Generated parsers no longer export a parser constructor function.
They now export an opaque Language object which can be set on
Documents directly. This way, the logic for constructing parsers
lives entirely in the runtime. The Languages are just structs which
have no load-time dependency on the runtime
2014-07-30 23:40:02 -07:00
Max Brunsfeld
779bf0d745 Don't store tree's hidden children in a separate array
Just mark hidden trees as such, and skip them when
pretty-printing a tree
2014-07-17 13:36:53 -07:00
Max Brunsfeld
25f927e321 Remove unnecessary accessor functions for tree 2014-07-14 21:11:15 -07:00
Max Brunsfeld
9da7663e99 Combine TSParser and TSStateMachine objects
My original thought was to decouple the runtime from
the LR parser generator by making TSParser a generic
interface that LR parsers implement.

I think this was more trouble than it was worth.
2014-07-10 13:23:20 -07:00
Max Brunsfeld
9d4fcf75de Rename type ts_lexer, ts_parser -> TSLexer, TSParser 2014-06-28 19:01:46 -07:00
Max Brunsfeld
2795078633 Rename type ts_document -> TSDocument 2014-06-28 18:37:29 -07:00
Max Brunsfeld
81880e000e Tweak header include paths in tests 2014-06-23 18:50:03 -07:00
Max Brunsfeld
6a0a28f4b3 WIP - try to fix travis build 2014-04-08 21:41:38 -07:00
Max Brunsfeld
09e28e7859 Collapse nodes with only one child and no additional text content 2014-03-26 00:10:59 -07:00
Max Brunsfeld
bdbe69258a Fix bug in stack breakdown procedure 2014-03-21 12:46:23 -07:00
Max Brunsfeld
fbe8b0a905 Fix incremental parsing
Stop collapsing hidden symbols upon reducing them.
Sadly, this messes up the ability to re-use parse
trees. Instead, for now, hide these nodes when
stringifying parse trees
2014-03-19 19:27:31 -07:00
Max Brunsfeld
7e94a4f1b2 Start work on reading input incrementally 2014-03-18 13:23:21 -07:00
Max Brunsfeld
a3a7546450 In SpyReader, store entire strings read, not individual chunks
Makes assertions easier to write. We don't need to assert
that the strings were read chunk by chunk.
2014-03-18 13:23:00 -07:00
Max Brunsfeld
67b33a615b Refactor generated parsers to used explicit table
This is slightly slower than encoding the parse table in
flow control, but allows the parser to inspect the parse
table more flexibly. This is needed for incremental parsing.
2014-03-17 18:43:17 -07:00
Max Brunsfeld
0d6435e24a Pass edit information into parser function 2014-03-15 16:55:35 -07:00
Max Brunsfeld
464a0e8dad Clean up parser header further 2014-03-15 15:15:59 -07:00
Max Brunsfeld
da992b77ff Rename 'parse_config' export -> 'parser' 2014-03-15 14:48:28 -07:00
Max Brunsfeld
0dc3a95d0c Refactor parser header
Make separate lexer, stack and parser structs.
2014-03-15 14:43:50 -07:00
Max Brunsfeld
05a5f9c124 Add function for notifying documents of edits 2014-03-12 13:39:12 -07:00
Max Brunsfeld
ff0c8a98b8 Consolidate reading of input chunks in parser 2014-03-11 12:43:13 -07:00
Max Brunsfeld
42e9a264f3 In parser, read chunked input correctly 2014-03-10 13:25:31 -07:00