Commit Graph

1781 Commits (main)

Author SHA1 Message Date
Mike Gerwitz c64e8363fd program map: Use expanded (preprocessed) program
* src/current/compiler/map.xsl (lvmc:compile)[lvm:program-map]: Use
  `program.expanded', which is the preprocessed output.
2018-02-22 16:25:10 -05:00
Mike Gerwitz 79cc96e026 Merge branch 'progtest' 2018-02-19 15:21:16 -05:00
Mike Gerwitz 4b1a72db81 entry-form: Clear YAML filename after loading
This way the test case can be re-loaded; otherwise it is
not recognized as a change and does not trigger the event.
2018-02-19 15:21:14 -05:00
Mike Gerwitz a52cbcea41 Correct param initialization 2018-02-19 15:21:14 -05:00
Mike Gerwitz 9e421daf67 progtest: bug: constants are not initialized until rating
Ugh, this is nasty.
2018-02-19 15:21:14 -05:00
Mike Gerwitz b214945963 progtest: .gitignore: ignore compiled output 2018-02-19 15:21:14 -05:00
Mike Gerwitz 4e3a86866a progtest: Display reader errors in browser 2018-02-19 15:21:14 -05:00
Mike Gerwitz 0b433e86f4 progtest: Async run each test serially
If that makes sense.

The problem is that the browser needs to repaint after each test is
run.  See code comments.
2018-02-19 15:21:14 -05:00
Mike Gerwitz f788edd675 Initial embedding of YAML test case runner 2018-02-19 15:21:14 -05:00
Mike Gerwitz 253f845803 progtest: Generate index.js files 2018-02-19 15:21:14 -05:00
Mike Gerwitz 47f0f4039b progtest: Initial working console runner 2018-02-19 15:21:14 -05:00
Mike Gerwitz 0c020b736d Produce consts as part of rater object 2018-02-19 15:21:14 -05:00
Mike Gerwitz 7f26db41b2 Properly re-order classification predicates of any dimension
In order for the cmatch algorithm to work properly, predicates must be
re-ordered on @dim descending.

* src/current/compiler/js.xsl (compile)[lv:classify]: Order all different
  dimensions, not just scalars.
2018-02-19 13:56:08 -05:00
Mike Gerwitz 34b82e7f7e preproc: Fix lv:any-only conversion broken from last commit
Gah.

This system really needs tests.
2018-02-19 11:41:27 -05:00
Mike Gerwitz 1f545a11ff preproc: Expand templates in extracted classes
any/all blocks within classifications are extracted into their own
classifications.  When they have sibling nodes, the extracted
classifications did not have their templates expanded.  Ouch.
2018-02-19 11:30:49 -05:00
Mike Gerwitz f15a1bb063 Copyright update (R-T Specialty) 2018-02-01 13:11:52 -05:00
Mike Gerwitz 088a56c336 Add HACKING
* HACKING: New file.
* README.md: Copyright update.  Add mention of HACKING.
2018-02-01 13:08:03 -05:00
Mike Gerwitz cac38d5e06 lv:rate/@generates: Validation error (bugfix)
* src/current/compiler/validate.xsl (lvv:validate)[lv:rate[@generates]]:
  Throw validation error.
2018-02-01 13:08:03 -05:00
Mike Gerwitz c5fcc3ccd2 template: Add prefix and suffix conditional support (feature)
* src/current/include/preproc/template.xsl (preproc:apply-template-cmp): Add
  @prefix and @suffix.
2018-02-01 13:08:03 -05:00
Mike Gerwitz c0370690f4 validate: Error on nested rate blocks (bugfix)
* src/current/compiler/validate.xsl (lvv:validate)
    [lv:rate[ancestor::lv:rate]]: Error on nested rate block.
2018-02-01 13:08:03 -05:00
Mike Gerwitz 9c4fbdace9 symtable: Only consider first lv:rate ancestor for parent (bugfix)
This is a situation that should never happen (I haven't yet determined
whether or not we should support this type of thing in the future), but when
it does, do something intelligent.

* src/current/include/preproc/symtable.xsl (preproc:symtable)[c:*[@generates]]:
  Consider only first ancestor lv:rate.
2018-02-01 13:07:51 -05:00
Mike Gerwitz b36cc3a942 c:sum/@of: Support let values
It's not good that c:let is still doing its own logic for this.

* src/current/compiler/js-calc.xsl (compile-calc)[c:sum[@of]]: Support c:let
  values.
2018-01-30 12:10:11 -05:00
Mike Gerwitz f2a9cd6af8 calc.xsd: Allow ##other in consts
* src/current/calc.xsd (constType): Allow ##other
2018-01-29 16:30:56 -05:00
Mike Gerwitz 9747d16464 Permit matrix reference in c:length-of (bugfix)
* src/current/compiler/validate.xsl (lvv:validate)[c:value]: Allow direct
  matrix reference (without index) in `c:length-of'.
2018-01-29 13:14:02 -05:00
Mike Gerwitz 440b935dc0 Display error on non-scalar constant lv:match/@value (bugfix)
* src/current/compiler/js.xsl (compile)[lv:match]: Display error on bad
  match, as it was intended.
2018-01-29 13:14:02 -05:00
Mike Gerwitz 00ce03ab25 src/current/calc.xsd (nameType): Permit numeric literals (bugfix)
* src/current/calc.xsd (nameType): Permit numeric literals.

These have already been permitted, but the XSD disallowed.
They worked in templates.
2018-01-29 13:13:56 -05:00
Mike Gerwitz 854f87a60d template: Remove accidental debug output
* src/current/include/preproc/template.xsl (preproc:apply-template)[@*]:
  Remove debug output.
2018-01-25 15:39:20 -05:00
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