Not time to address styling this at the moment. This code was previously
not reached until recent fixes. And I forgot that this was even
permitted (such complex calculations within matches)!
* src/current/summary.xsl (match-desc): Do not terminate on unknown
match-desc elements.
Rather than producing a syntax error, provide a useful warning and simply
yield 0.
* src/current/compiler/js.xsl (compile)[lv:rate]: Warn and yield 0 when no
calculation is provided in the body.
We've never done this before (thus this bug lasting so many years), but only
because it doesn't really make much sense in practice; this was caught when
writing test cases.
* src/current/compiler/js.xsl (compile)[lv:match]: Compile `consts' instead
of `args' when referencing a constant.
* src/current/include/preproc/template.xsl
(preproc:gen-param-value)[lv:param-add]: Resolve value of @value before
processing numeric expression (to support template variables). Error
when any values are not numeric rather than producing NaN.
This is imperfect, but will work based on current assumptions.
* src/current/include/preproc/expand.xsl (preproc:expand)[c:const,lv:const):
If '@' is found, do not perform expansion.
They corrupt the display. This solution isn't ideal, though.
* src/current/include/calc-display.xsl: Use new `preproc:tex-index'.
(preproc:tex-index): Add function.
* src/current/summary.xsl: Use `preproc:tex-index' for @index display.
* src/current/include/display.xsl (preproc:dim-to-str): New function.
(summary:desc): Use it. Display appropriate generator dimensions as a
string rather than hard-coding to `vector'. Remove yield symbol ref.
Vector length is customarily denoted by |V|.
* src/current/include/calc-display.xsl (c:sum, c:length-of): Use new
notation.
* src/current/summary.xsl: Update N.B. with new notation.
There's no point in having a link to itself. Further, the link was wrong.
* src/current/summary.xsl (gen-equation-details): Remove link from generator
name.
When a symbol is imported as local, and subsequently directly imported using
another package with @export, the symbol needs to be overridden as
non-local.
* src/current/include/preproc/symtable.xsl
(preproc:sym-discover): Deduplicate based on local status.
(preproc:symtable-process-symbols): Retain non-local symbols when only
local version of the symbol exists.
This is a linker bug that I don't have time to debug at the
moment. Hopefully the linker will be re-written in Scheme sometime in the
near future anyway.
* src/current/summary.xsl (preproc:sym-lookup): Take first result of symbol
lookup.
If it is copied an yields an empty value, then it is later converted into a
0, which is wholly incorrect in the case of generators.
* src/current/include/preproc/macros.xsl (preproc:macros)[lv:rate-each]:
Conditionally copy `@dim'.
This is just a temporary workaround for a failed lookup; no time to debug at
the moment.
* src/current/summary.xsl (preproc:sym-lookup): Allow empty sequence as
return value.
If the hash is e.g. `:class:*', it tries to parse it, which is
invalid. There's a better solution to this problem, but I don't have time
to test possibly messing this up right now.
* src/current/scripts/entry-form.js (begin): Ignore JSON parsing errors.
This same problem can occur anywhere---everything needs to be converted to
use the new `preproc:sym-lookup', but I don't have the time at the moment.
* src/current/summary.xsl (preproc:sym-lookup): New function.
(program): New toplevel variable.
(process-match)[lv:match]: Use function.
This optimization (which already existed) is supposed to remove
c:sum/c:product nodes if they contain one or fewer calculations, but it
failed to remove them when inline templates were used (because it creates,
well, a template inline).
Instead, we'll assume that any lv:* nodes handled by the preprocessor will
be okay. In the case of inline templates, they receive a preproc attribute
identifying what created it.
I hope this is a valid assumption. This will be thoroughly tested. If only
we had test cases for the preprocessor.
* src/current/include/preproc/expand.xsl: (preproc:expand)[c:sum,c:product]:
Consider optimization for `lv:*[@preproc:*]'.
The idea is to provide some guidance with how YAML test cases are supposed
to appear.
This just adds to the massive cluster that is the `entry-form.js'.
* src/current/include/entry-form.xsl (entry-form)[preproc:sym]: Add
`entry-testcase-dfn' div.
* src/current/scripts/entry-form.js: Invoke `updateParamTestcaseDfn' in
various event listeners.
(populateBucket): Invoke `updateParamTestcaseDfn'.
(updateParamTestcaseDfn, getParamTestcaseDfnElement): New functions.
* src/current/summary.css: Style `.entry-testcase-dfn'.
This existed in the old summary pages. Since we'll be having certain people
reference ids, they need to be easily visible from somewhere.
* src/current/include/entry-form.xsl (preproc:sym)[entry-form]: Add param
name and link.
* src/current/summary.css: Style it.
Long-standing bug. Didn't often see it because FF performance was
relatively poor for the Summary Pages compared to Chromium until recently,
so I didn't often load the page in it (despite it being my primary browser).
* src/current/summary.css (legend): width:auto.
If nested c:let expressions contained values of the same name, they would
all be rendered, rather than just the one intended.
* src/current/include/display.xsl (do-gen-let-list): Pass let symbol to
`_gen-let-list-item'.
(_gen-let-list-item): Render only values part of context let expression.
[letsym]: New parameter.
This was recently introduced and was noticed because c:let/@name was not
being generated under certain circumstances.
* src/current/include/preproc/expand.xsl (preproc:expand): Continue applying
templates after @dim expansion (rather than copying child nodes).
This (hopefully) prevents metadata from leaking outside of template
expansions where they are not wanted.
* src/current/include/preproc/macros.xsl (preproc:macropass): Strip
cruft (new barrier nodes) on final pass.
* src/current/include/preproc/template.xsl (preproc:expand-template):
Enclose template expansion in preproc:tpl-barrier (which is stripped on
the final pass).
(preproc:apply-template)[lv:param-meta]: Document template. "Hoist"
node (set attribute) if not contained within lv:param-copy.
(preproc:gen-param-value)[lv:param-inherit]: Consider hoisted nodes behind
barrier.
This renders template expansions as part of the calculation breakdown, which
goes a long way to understanding what the system is doing.
This further updates the hover over the breakdown to color-code based on
depth, making it easier to observe the nesting of
expressions. Sub-expressions that are toplevel results of template
expansions (nodes marked with templates) have a thicker border.
* src/current/summary.css: Add template id styling, breakdown colors, and
misc. styling.
* src/current/summary.xsl (ultra-breakdown-set): Enclose label in
span. Output template id, if applicable. Mark fieldset if templated.
This allows for debugging expansions, which are otherwise confusing and
difficult. This will be valuable information for the Summary Pages as
well (see future commit).
* src/current/include/preproc/template.xsl (preproc:expand-template): Mark
toplevel nodes after expansion.
(preproc:mark-tpl-expansion): Add templates.
Cruft left around from the symbol table refactoring long ago.
* src/current/compiler/js.xsl
(compile)[preproc:rate]: Remove template.
[preproc:class]: Remove template.
(compile-rates)[lv:package]: Remove template.
This makes me slightly uncomfortable because I haven't researched why
exactly this was not a problem before. We encountered this issue using an
inline template iterating over the symbol table yielding a `c:value-of',
which is admittedly something that we haven't done before.
Hopefully it's an isolated case.
I diffed the offending object file and the entire linked tax calculator and
they were bit-for-bit identical, so we're probably good.
* src/current/include/depgen.xsl (preproc:depgen): Do not perform dependency
generation within templates.