tame/tamer/tests/xmli
Mike Gerwitz 5a301c1548 tamer: asg::graph::visit::ontree: Source ordering of ontological tree
This introduces the ability to specify an edge ordering for the ontological
tree traversal.  `tree_reconstruction` will now use a
`SourceCompatibleTreeEdgeOrder`, which will traverse the graph in an order
that will result in a properly ordered source reconstruction.  This is
needed for template headers, because interpolation causes
metavariables (exposed as template params) to be mixed into the body.

There's a lot of information here, including some TODOs on possible
improvements.  I used the unstable `is_sorted` to output how many template
were already sorted, based on one of our very large packages internally that
uses templates extensively, and found that none of the desugared shorthand
template expansions were already ordered.  If I tweak that a bit, then
nearly all templates will already be ordered, reducing the work that needs
to be done, leaving only template definitions with interpolation to be
concerned about, which is infrequent relative to everything else.

DEV-13163
2023-07-18 10:31:31 -04:00
..
classify tamer: Replace wip-asg-derived-xmli flag with command line option 2023-06-13 23:23:51 -04:00
combined tamer: Replace wip-asg-derived-xmli flag with command line option 2023-06-13 23:23:51 -04:00
cp tamer: Replace wip-asg-derived-xmli flag with command line option 2023-06-13 23:23:51 -04:00
empty tamer: Replace wip-asg-derived-xmli flag with command line option 2023-06-13 23:23:51 -04:00
meta-interp tamer: asg::graph::visit::ontree: Source ordering of ontological tree 2023-07-18 10:31:31 -04:00
package tamer: Replace wip-asg-derived-xmli flag with command line option 2023-06-13 23:23:51 -04:00
rate tamer: Replace wip-asg-derived-xmli flag with command line option 2023-06-13 23:23:51 -04:00
template tamer: Initial template/param support through xmli 2023-06-14 16:38:05 -04:00
.gitignore tamer: tests/xmli: Formatted and more informative output 2023-03-10 14:27:59 -05:00
README.md tamer: Replace wip-asg-derived-xmli flag with command line option 2023-06-13 23:23:51 -04:00
test-xmli tamer: xmli reconstruction of desugared interpolated metavars 2023-07-17 14:20:05 -04:00

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.

Experimental Features

If a file is-experimental exists in a test directory, then --emit xmlo-experimental will be used in place of --emit xmlo.

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.