| 1 |
- Only apply LAST definition of a particular mapping. This could be |
| 2 |
determined by keeping track of positions of mapping declarations as in |
| 3 |
a preorder traversal, done in stage 3 of parsing. |
| 4 |
|
| 5 |
- Somehow we need to speed up the application of mappings. Instead of |
| 6 |
recurring through the entire tree, can't we just make USED_COMMANDS contain |
| 7 |
at each entry a "postings list" of where in the tree the command occurs? |
| 8 |
|
| 9 |
CAVEAT: if we do this, we'd have to also update these postings lists each |
| 10 |
time a mapping is applied, because we're making new subtrees with new |
| 11 |
commands being exercised. |
| 12 |
|
| 13 |
On the bright side, if this is properly executed, we could get massive |
| 14 |
speedups on applying the mappings (for n mappings, we'd remove n full tree |
| 15 |
traversals!) |
| 16 |
|
| 17 |
- Normalize TEXT nodes on all splits (adjacent TEXT nodes should be combined) |
| 18 |
|
| 19 |
- Have linked-list stuff maintained as the parsing proceeds. |
| 20 |
|
| 21 |
- Add interface to brace matching in parser (and make sure it works). |
| 22 |
|
| 23 |
- Add environment boundary matching, with interface. |
| 24 |
|
| 25 |
- Perhaps remove array-based tree representation entirely. |
| 26 |
|
| 27 |
- Add file names to parser errors, so we know which included files are being |
| 28 |
complained about. |
| 29 |
|
| 30 |
- Add another parsing stage to pull group nodes that are part of multi-group |
| 31 |
commands into a single "parameter" list. This would be kind of analogous |
| 32 |
to the "attributes" list of an XML node. |
| 33 |
|
| 34 |
This will require information about all built-in commands (though we might |
| 35 |
be able to get away with grabbing all GROUPs until we hit non-whitespace |
| 36 |
TEXT nodes.) |
| 37 |
|
| 38 |
- Parse all commands into COMMAND nodes, not just ones that have groups as |
| 39 |
children. This is more for consistency than structural usefulness. |
| 40 |
|
| 41 |
This would fairly radically effect later parsing stages. |
| 42 |
|
| 43 |
Note that currently some commands will appear in the results of getting all |
| 44 |
TEXT nodes. This doesn't really make sense; the semantics of unrecognized |
| 45 |
commands is not that they are plain text. |
| 46 |
|
| 47 |
- In a group, embedded commands go from the embedded location to the end of |
| 48 |
the group boundary. So for each embedded command we should really be |
| 49 |
splitting the text of the group, and making the right half a child of the |
| 50 |
command, and the left half a previous sibling. Currently the parser just |
| 51 |
makes the entire group a child of the command, which is wrong (but not |
| 52 |
likely to be encountered due to convention). |
| 53 |
|
| 54 |
- Should we be treating square-braces ([]) as groups, analogously to what we |
| 55 |
do for curly braces? Read up on the full semantics of the square braces. |