Commit graph

15 commits

Author SHA1 Message Date
Max Brunsfeld
3d0890eecf Preserve tokens within errors 2015-06-15 15:26:06 -07:00
Max Brunsfeld
75da0a5774 Add language specs for removal of characters 2015-02-21 01:28:33 -08:00
Max Brunsfeld
8134b64d00 Remove repetition from language spec descriptions 2014-10-19 12:36:43 -07:00
Max Brunsfeld
a69dfa08f3 Add spec for inserting text w/ unicode characters 2014-10-02 11:54:00 -07:00
Max Brunsfeld
545e575508 Revert "Remove the separator characters construct"
This reverts commit 5cd07648fd.

The separators construct is useful as an optimization. It turns out that
constructing a node for every chunk of whitespace in a document causes a
significant performance regression.

Conflicts:
	src/compiler/build_tables/build_lex_table.cc
	src/compiler/grammar.cc
	src/runtime/parser.c
2014-09-02 08:03:51 -07:00
Max Brunsfeld
5cd07648fd Remove the separator characters construct
Now, grammars can handle whitespace by making it another ubiquitous
token, like comments.

For now, this has the side effect of whitespace being included in the
tree that precedes it. This was already an issue for other ubiquitous
tokens though, so it needs to be fixed anyway.
2014-09-01 20:19:43 -07:00
Max Brunsfeld
1e79ed794b Allow multiple top-level nodes
Now, the root node of a document is always a document node.
It will often have only one child node which corresponds to the grammar's
start symbol, but not always. Currently, it may have more than one child
if there are ubiquitous tokens such as comments at the beginning of the
document. In the future, it will also be possible be possible to have multiple
for the document to have multiple children if the document is partially parsed.
2014-08-09 00:00:20 -07:00
Max Brunsfeld
7ba3953f7e Simplify handling of ubiquitous tokens during reduce 2014-08-08 08:46:01 -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
6e551d6d9f Simplify handling of multiple top-level nodes after parsing 2014-07-14 20:46:20 -07:00
Max Brunsfeld
2988cc5aa2 Show offending lookahead chars when pretty-printing trees w/ errors 2014-05-26 21:50:01 -07:00
Max Brunsfeld
a437d39773 Add rule precedence construct
Still need to add some way of expressing left and right
associativity
2014-04-15 08:40:46 -07:00
Max Brunsfeld
99817a38c1 Improve trees generated by arithmetic grammar
This work should inform how to implement operator
precedence helper functions
2014-03-29 18:37:51 -07:00
Max Brunsfeld
09e28e7859 Collapse nodes with only one child and no additional text content 2014-03-26 00:10:59 -07:00
Karen Wang and Max Brunsfeld
f248ece3aa Use table-driven tests for specific parsers 2014-03-22 15:19:13 -07:00