Mike Gerwitz
56d92fe22b
This this a big change that's difficult to break up, and I don't have the energy after it. This introduces nullary template application, short- and long-form. Note that a body of the short form is a `@values@` argument, so that's not supported yet. This continues to formalize the idea of what "template application" and "template expansion" mean in TAMER. It makes a separate `TplApply` unnecessary, because now application is simply a reference to a template. Expansion and application are one and the same: when a template expands, it'll re-bind metavariables to the parent context. So in a template context, this amounts to application. But applying a closed template will have nothing to bind, and so is equivalent to expansion. And since `Meta` objects are not valid outside of a `Tpl` context, applying a non-closed template outside of another template will be invalid. So we get all of this with a single primitive (getting the "value" of a template). The expansion is conceptually like `,@` in Lisp, where we're splicing trees. It's a mess in some spots, but I want to get this committed before I do a little bit of cleanup. |
||
---|---|---|
.. | ||
classify | ||
combined | ||
empty | ||
rate | ||
template | ||
.gitignore | ||
README.md | ||
test-xmli |
README.md
XMLI System Test
The xmli
file is an intermediate file that serves as a handoff between
TAMER and the XSLT-based compiler:
xml -> (TAMER) -> xmli -> (TAME XSLT) -> xmlo
TAMER gets the first shot at processing, and then the compilation process continues with the XSLT-based compiler. This allows TAMER to incrementally augment and manipulate the source file and remove responsibilities from TAME XSLT.
Tests in this directory ensure that this process is working as intended. TAMER's failure to perform a proper handoff will cause TAME XSLT to compile sources incorrectly, since TAMER will have rewritten them to something else.
This handoff is more than just echoing tokens back into a file---it derives a new program from the state of the ASG. This program may have a slightly different representation than the original sources, but it must express an equivalent program, and the program must be at least as performant when emitted by TAME XSLT.
Running Tests
Test are prefixed with test-*
and are executable. They must be invoked
with the environment variable PATH_TAMEC
set to the path of tamec
relative to the working directory.
Test cases are organized into sub-directories with src.xml
and
expected.xml
files. src.xml
will be compiled with tamec
, its output
formatted with xmllint --format
, and diff
'd against the
xmllint
-formatted output of expected.xml
.