Commit Graph

1254 Commits (5a866f773562869953eabdb9bc827a745fec88a6)

Author SHA1 Message Date
Mike Gerwitz d128b2384e entry-form: Ignore missing DOM elements
* src/current/scripts/entry-form.js (updateParamTestcaseDfn): Ignore if DOM
  element cannot be found.
2018-01-25 15:27:27 -05:00
Mike Gerwitz 78ea30e7b5 Retain unknown template param references during expansion
For example, with template-generating templates, if a reference is unknown
and therefore determined to be blank, an attribute might be completely
removed while the template is being generated.  (See the /when package in
core for an example.)  That is not good.

* src/current/include/preproc/template
  (preproc:expand-template): Add `tpl' tunneling param to
    preproc:apply-template application.
  (preproc:apply-template)[@*]: Retain param reference if applying template
    does not define it.
2018-01-25 14:53:31 -05:00
Mike Gerwitz 87a059f0c8 Retain template conditionals verbatim if param unknown
This is important for template-generating templates.

* src/current/include/preproc/template.xsl (lv:if,lv:unlesS):
  Retain conditional nodes verbatim when referenced param is unknown.
2018-01-18 15:44:12 -05:00
Mike Gerwitz 211387ce2f Mark generated @yields on classes and rate-each as such on symbols
* src/current/include/preproc/expand.xsl
  (lv:classify): Set `@preproc:yields-generated' if `@yields' was not
    previously defined.
* src/current/include/preproc/macros.xsl:
  (lv:rate-each): Set `@preproc:yields-generated` if `@yields' was not
    previously defined.
* src/current/include/preproc/symtable.xsl:
  (lv:rate, lv:classify): Set `@preproc:generated` on symbol if
    `@preproc:yields-generated'.
2018-01-16 12:12:33 -05:00
Mike Gerwitz f8dcdbfd23 make-full-graph: Add script
* build-aux/make-full-graph: Add script.
2018-01-16 11:56:06 -05:00
Mike Gerwitz f8d21c1c5f summary: Correct height of pipes denoting length
* src/current/include/calc-display.xsl
  (c:sum[@of], c:length-of): Add `\left', `\right'.
* src/current/summary.xsl: Update "N.B." section.
2018-01-11 08:42:04 -05:00
Mike Gerwitz 2767917d62 summary: Do not terminate on unknown match-desc calculations
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.
2018-01-09 15:55:39 -05:00
Mike Gerwitz 7ff3a2d702 summary: Correct unknown match calc error display
* src/current/summary.xsl (match-desc): {c=>lv}:classify.
2018-01-09 15:44:16 -05:00
Mike Gerwitz aa99cebc65 Yield 0 and provide warning for empty rate blocks
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.
2018-01-04 14:51:20 -05:00
Mike Gerwitz 107581017b Support constant refs with lv:match/@on
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.
2018-01-04 14:38:18 -05:00
Mike Gerwitz a62d155eb0 Resolve lv:param-add/@value before processing
* 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.
2018-01-04 11:05:58 -05:00
Mike Gerwitz d8c7d8fee2 Ignore constant parsing for template param references
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.
2018-01-04 11:04:55 -05:00
Mike Gerwitz cd5a1a99fc summary: Display @desc in breakdown if @label is not available
* src/current/summary.xsl (ultra-breakdown-set): Use @desc if no @label.
2017-12-22 11:13:42 -05:00
Mike Gerwitz 4ed63b3661 summary: Remove index underscores from TeX
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.
2017-12-22 11:07:24 -05:00
Mike Gerwitz 55bd91d05e summary: Simplify display of generators in let list
* 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.
2017-12-21 13:39:05 -05:00
Mike Gerwitz 61279a36dc summary: Remove parenthesis from let list symbol refs
* src/current/include/display.xsl: Remove parenthesis around let list
  symbols.
* src/current/summary.xsl: Remove parenthesis around generator symbol.
2017-12-21 13:32:09 -05:00
Mike Gerwitz aba2e7a5b2 summary: Add const description in let list
* src/current/include/display.xsl (summary:desc): Include const @desc in let
  list.
2017-12-21 13:28:17 -05:00
Mike Gerwitz 97977332d5 summary: Correct length notation
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.
2017-12-21 13:18:41 -05:00
Mike Gerwitz 93b3a14cfb summary: Remove link from generator name
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.
2017-12-21 11:03:22 -05:00
Mike Gerwitz 39e83a80d0 preproc: Add `param-sym-value' for templates
* src/current/include/preproc/template.xsl
  (preproc:gen-param-value)[lv:param-sym-value]: New template.
* src/current/rater.xsd (templateParamGenGroup): Add `param-sym-value'.
2017-12-21 10:42:20 -05:00
Mike Gerwitz 0f88b902a9 summary: Correct rendering of externs 2017-12-20 16:49:34 -05:00
Mike Gerwitz c59ed64d4e macros: Ignore preproc:tpl-barrier during class conversion
* src/current/include/preproc/macros.xsl
  (preproc:macros): Only consider lv:* in counts.  Ignore preproc:*.
2017-12-19 16:51:18 -05:00
Mike Gerwitz c99e4d00f6 symtable: Override local status of imported symbols
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.
2017-12-19 16:48:44 -05:00
Mike Gerwitz 60c01b22ba summary: Handle duplicate l:dep symbols during lookup
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.
2017-12-19 14:25:45 -05:00
Mike Gerwitz 62c4ce402c preproc: Copy rate-each/@dim only if it exists
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'.
2017-12-19 14:21:08 -05:00
Mike Gerwitz 872da96f9e summary: Allow empty symbol lookups
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.
2017-12-19 11:00:52 -05:00
Mike Gerwitz 87ab3ff468 summary: Wrap .entry-value
* src/current/summary.css: (.entry-value): Wrap whitespace.
2017-12-19 11:00:13 -05:00
Mike Gerwitz fd47e239ba Summary Page improvements 2017-12-18 10:23:49 -05:00
Mike Gerwitz d6d3283923 summary: Re-add N.B. section from old summary page
With corrections.

* src/current/summary.xsl (gen-pkg-menu): New menu item.
  (summary-info): Correct text.
2017-12-15 09:54:18 -05:00
Mike Gerwitz 03ffadb703 summary: Ignore invalid JSON data when loading page
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.
2017-12-15 09:38:21 -05:00
Mike Gerwitz 337153aaa7 summary: Correct rendering of externs in matches
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.
2017-12-15 09:34:11 -05:00
Mike Gerwitz dd42267bc9 summary: Render package descriptions on entry form 2017-12-14 12:13:21 -05:00
Mike Gerwitz eff8a01a42 summary: Correct math rendering on initial page load
Race condition.
2017-12-14 12:13:21 -05:00
Mike Gerwitz 5bdcffc221 summary: Filter internal values from menu
This really reduces noise, especially with all of the package eligibility
classifications.
2017-12-14 12:13:21 -05:00
Mike Gerwitz 43190ef6af summary: Add symbol refs to breakdown
This should be extremely helpful in understanding the breakdown.  And
convenient.
2017-12-14 12:13:21 -05:00
Mike Gerwitz c98ece9d68 summary: Group params on entry form by package
* src/current/include/entry-form.xsl: Group entry form params.
2017-12-14 12:13:21 -05:00
Mike Gerwitz dc5e5b74dc summary: Correct rendering of classifications using equations
* src/current/include/calc-display.xsl (calc-iversons)[recurse]: Add
    parameter.  Conditionally recurse.
* src/current/summary.xsl (match-desc): Properly process c:* children.
2017-12-14 12:13:21 -05:00
Mike Gerwitz 2ccf78544a summary: Angry fruit salad
This adds a great deal of colorful styling to make the Summary Page a bit
easier to understand at a glance.
2017-12-14 12:13:18 -05:00
Mike Gerwitz 22b4d37317 preproc: Optimize away c:{sum,product} containing preprocessed lv:*
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:*]'.
2017-12-13 13:50:24 -05:00
Mike Gerwitz 0f0e88d9fb summary: Correct casting for scalars
* src/current/scripts/entry-form.js: Ensure scalars are cast to numbers
    before outputting dfn.
2017-12-11 16:09:10 -05:00
Mike Gerwitz 4ebe81bcb6 Summary page changes to aid in testing 2017-12-11 15:29:16 -05:00
Mike Gerwitz 5e5458dd3b summary: Add param text case dfn below input
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'.
2017-12-11 15:25:31 -05:00
Mike Gerwitz f79deb725e summary: Add "percent*" to VOIs
* src/current/scripts/entry-form.js (updateVois): Add "percent"-prefixed
    values to VOI list.
2017-12-11 14:03:03 -05:00
Mike Gerwitz eb01129e24 summary: Filter internal classes from class overview
* src/current/scripts/entry-form.js (updateSummaryClasses): Hide
    "-"-prefixed classes from Classification Overview.
2017-12-11 14:03:03 -05:00
Mike Gerwitz d612c593b2 summary: Add param names and links aside desc in entry form
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.
2017-12-11 14:03:02 -05:00
Mike Gerwitz 3970659a81 summary.css: Fix header width in FF
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.
2017-12-11 11:38:23 -05:00
Mike Gerwitz 838ddb6e32 summary: Correct rendering of nested c:let expressions
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.
2017-12-11 10:50:51 -05:00
Mike Gerwitz e78c3cbe98 symtable: Add @lparent to let lparam symbols
* src/current/include/preproc/symtable.xsl (preproc:symtable)[c:let]:
    Add @lparam to symbol.
2017-12-11 10:50:49 -05:00
Mike Gerwitz a38327b505 expand: Continue macro expansion after @dim conversion
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).
2017-12-11 10:42:52 -05:00
Mike Gerwitz f38e6c896b Add template barriers for metadata
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.
2017-12-08 14:48:59 -05:00