Preprocessor: variables, defines and -E #6
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Reference
jeff/zixl#6
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Parent
Part of #1
What to build
Preprocessing becomes real:
<?define?>,<?undef?>,$(var.NAME),$(env.NAME),$(sys.CURRENTDIR),$(sys.SOURCEFILEDIR),$(sys.SOURCEFILEPATH),-D NAME[=VALUE]on the command line, and<?warning?>and<?error?>.zixl -Eprints the preprocessed source and stops. An undefined variable is an error naming it and where it was used.Acceptance criteria
zig build test): text in, preprocessed text or diagnostics out, for each directive and variable kind.<?error?>each give a diagnostic with file, line and column;<?warning?>gives a warning and continues.-Don the command line overrides nothing defined later in the source, and is visible to it, as WiX documents.zixl -Eoutput matcheswixl -Efor a fixture using every feature above, after normalizing whitespace if the two differ only there.Done in
a660e3a; CI run 6 is green.tests/preprocess.zigcovers every directive and variable kind, escaping in each quoting context,$$(, command-line versus later definitions, and the diagnostics with file, line and column.zixl -Evswixl -E:tests/e2e/preprocess.shcompares the two in canonical XML (C14N 2.0).Where zixl follows WiX's documentation over the reference implementation:
$$(var.X)as$plus the value.$(sys.SOURCEFILEDIR)as the file name.<?define NAME?>(which wixl rejects) and ends$(sys.CURRENTDIR)and$(sys.SOURCEFILEDIR)with a separator, both as WiX documents.