Max Brunsfeld
010a606b76
Add undo method to SpyInput
2015-09-19 14:46:14 -07:00
Max Brunsfeld
f37f73f92f
Add ability to edit multiple times between parses
2015-09-18 23:20: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
66ad271c82
Add Document parse_count() method, for tracking if trees are still valid
2015-09-10 14:23:42 -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
53926c467e
Don't automatically hide singleton nodes
2015-09-02 16:36:29 -07:00
Max Brunsfeld
acf9280eda
Make expression and statement rules hidden in javascript grammar
2015-09-02 13:05:54 -07:00
Max Brunsfeld
21258e6a9e
Remove 'document' wrapper node
2015-08-22 10:48:34 -07:00
Max Brunsfeld
e89ec7c85e
Whitespace
2015-07-31 16:29:01 -07:00
Max Brunsfeld
54e40b8146
Rework AST access API: reduce heap allocation
2015-07-31 15:47:48 -07:00
Max Brunsfeld
32e79700bf
Rename SpyReader -> SpyInput
2015-07-16 17:32:19 -07:00
Max Brunsfeld
3d0890eecf
Preserve tokens within errors
2015-06-15 15:26:06 -07:00
Max Brunsfeld
2d436cf141
Identify fragile reductions at compile time
2015-02-21 15:11:03 -08:00
Max Brunsfeld
647c3e2010
Add tests for editing all language examples
...
This drove out several fixes to the incremental parsing algorithm.
There are a few examples which still don't work and which have
been explicitly excluded, for now.
2014-10-22 20:10:08 -07:00
Max Brunsfeld
91cf35b72c
Rework javascript fixture grammar
2014-10-21 08:49:16 -07:00
Max Brunsfeld
c26cee5d18
Remove debugger in parser spec
2014-10-17 23:47:20 -07:00
Max Brunsfeld
0962b21dd3
Fix parse errors with tree-reuse
...
- Don't reuse error nodes
- When re-using nodes, update lexer's token_end_position
2014-10-17 23:20:36 -07:00
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