Commit Graph

192 Commits (e4ccf3e90aa47e03cbce29958d0a903ef474e6da)

Author SHA1 Message Date
Mike Gerwitz 189751d5cc Mark generated symbols as local
We need to cut down on symbol imports as much as possible; the whole system
starts dragging if we are importing thousands of symbols into a single
package.

* src/current/include/preproc/symtable.xsl (preproc:symtable)[lv:rate,c:*]: Mark
  as local if `@preproc:generated`.
* src/current/include/preproc/template.xsl (preproc:macros)[lv:inline-template]:
  Mark generated templates as such.
* src/symtable/symbols.xsl (preproc:symtable)[lv:template]: Mark as local if
  `@preproc:generated'.
2018-03-28 14:22:57 -04:00
Mike Gerwitz 852c42e340 symtable: Detect duplicate symbols in the same package
* src/symtable.xsl (symtable:find-duplicates):
  Update description.  Find duplicates in same package.
* test/symtable.xspec: Update test case accordingly.
2018-03-28 10:30:15 -04:00
Mike Gerwitz d284d75f39 js compiler: Prevent octals in generated code
* src/current/compiler/js.xsl (compiler:js-number): New function to
    remove leading zeroes.
  (compile)[lv:const]: Use it.
* src/current/compiler/js-calc.xsl (compile-calc)[c:const]: Use it.
2018-03-28 10:30:12 -04:00
Shelly Shaver 67d0cd69ec c1map: Add lvm:if/@eq 2018-03-21 14:46:10 -04:00
Mike Gerwitz a3fcaa8737 rate-each: Gentle @no
* src/current/compiler/js.xsl (compile-class-condtion)[lv:rate]: Do not
  consider @no's in predicate generation when `@preproc:gentle-no' is set.
* src/current/include/preproc/macros.xsl (preproc:macros)[lv:rate-each]: Set
  `@preproc:gentle-no' on generated `lv:rate', since the generator handles
  `@no' itself.
2018-03-19 15:23:41 -04:00
Mike Gerwitz 2960f2d0b3 linker, summary: Reduce runlog output 2018-03-19 15:08:17 -04:00
Mike Gerwitz 5b5055db6d preproc/template: Add param-sym-value/@ignore-missing
* src/current/include/preproc/template.xsl
  (preproc:gen-param-value)[lv:param-sym-value]: Suppress warning for
  missing symbol and yield empty string if `@ignore-missing='true'`.
2018-03-16 16:24:06 -04:00
Mike Gerwitz abca20b02d depgen: Include enum constants as typedef dependencies
This ensures that they are compiled into the `consts' object.

* src/current/include/depgen.xsl (preproc:depgen)[lv:typedef]: Include
  `lv:enum/lv:item/@name' as dependencies.
2018-02-28 15:29:49 -05:00
Mike Gerwitz b70cbb9eae standlone: Correct consts reference for worksheet
This was broken in 0c020b7.

* src/current/standalone.xsl (/): {rater_results=>rater}.consts.
2018-02-26 10:39:03 -05:00
Mike Gerwitz 5b256e0268 symtable: Do not mark symbols with generated yields as generated
The problem with this implementation was that, any time a generator had an
associated generated @yields (which is common), it wouldn't be included in
the summary page.

We can address this in the future.  It's not necessarily that it was
incorrect; it's just how the system made use of it.

* src/current/include/preproc/symtable.xsl (preproc:symtable)[lv:rate]:
  Do not mark @preproc:yields-generated symbols as @preproc:generated.
2018-02-26 10:31:04 -05:00
Mike Gerwitz d8cbee12b2 validtor: Remove unresolved extern warning
See diff comment.

* src/current/compiler/validate.xsl (lvv:validate)[c:*[@name or @of]]:
  Remove unresolved extern warning.
2018-02-26 10:30:42 -05:00
Mike Gerwitz 6b7e75c886 entry-form: Integrate YAML test case console output as HTML 2018-02-23 14:20:16 -05:00
Mike Gerwitz 3bf15ebcc1 depgen: Ignore template bodies
Templates can expand into unexpected places, so sometimes warnings are
inappropriately issued.

* src/current/include/depgen.xsl (preproc:depgen)[lv:template]: Ignore.
  [lv:template/lv:param]: Remove (now unnecessary with above).
2018-02-23 13:45:07 -05:00
Mike Gerwitz 3384c95bc9 Revert "program map: Use expanded (preprocessed) program"
This map is used for more than the program.xml!

This reverts commit c64e8363fd.
2018-02-22 16:42:26 -05:00
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 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 4e3a86866a progtest: Display reader errors in browser 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 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 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 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 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 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
Mike Gerwitz 75aa0fab7e Summary Page: Render template expansion points
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.
2017-12-08 14:48:57 -05:00
Mike Gerwitz 2f8ce0f234 Mark toplevel nodes affected by template expansion
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.
2017-12-08 13:53:12 -05:00
Mike Gerwitz 65890f7156 Clean up unused JS compiler code
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.
2017-12-08 13:51:43 -05:00
Mike Gerwitz c5e67861c9 depgen: Do not perform dependency generation within templates
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.
2017-12-06 14:39:54 -05:00
Mike Gerwitz 2878d1099c Defer inline-templates with sym-set until symtable is available
Other code relied on expand-sequence, but this really should be implicit,
since it is deceptively useless otherwise.

* src/current/include/preproc/template.xsl (preproc:macros): Defer
    processing of inline-template with sym-set until symbol table is
    available.
2017-12-05 15:07:29 -05:00
Mike Gerwitz c207fad008 Allow ##other nodes in apply nodes
The primary motivation for this is to allow for template conditionals.

* src/current/calc.xsd (applyArgs): New group.
  (apply,recurse): Use it in sequence.
2017-12-04 13:40:12 -05:00
Mike Gerwitz 0fb1bae487 Add c:sum/@dim
This allows the result of a rate block to be a matrix; there was previously
no way for a named value to be assigned a matrix unless it was a parameter.

This is a bit of a kluge---the compiler won't discover the proper type
information and won't perform the proper safeguards.

* src/current/calc.xsd (sum)[@dim]: Add attribute.
* src/current/compiler/js-calc.xsl: Add xs namespace.
  (compile-calc): Do not perform casting when @dim > 1.
* src/current/include/preproc/expand.xsl
  (lv:rate-each): Include @dim in c:sum expansion.
* src/current/include/preproc/macros.xsl:
  (c:*/@generates): Use @dim to determine symbol dimensions.
* src/current/include/preproc/expand.xsl: Parse @dim aliases (e.g. "vector",
  "matrix").
2017-12-04 13:39:55 -05:00
Mike Gerwitz ef1e6735b6 entry-form: Correct rendering of params using imported typedefs
If a param referenced a typedef that was imported from another package, the
summary page displayed an error rather than rendering the field.  This is a
problem for testing using summary pages!

Long-standing bug with a fairly easy fix.

* src/current/include/entry-form.xsl:
  (entry-form-field lv:param): Consider correct symbol (was using param
    symbol, not typedef).
  [typesrc]: Modernize syntax.
  [typedef]: Allow for non-root-child elements.  The old version of TAME
    required toplevel typedefs; that's no longer the case.
2017-11-29 13:22:29 -05:00
Mike Gerwitz e52d6c1eb0 depgen: Add error for rate block name conflicts
This can occur during template expansion if the user is not careful in
ensuring that all generated blocks will have unique names.  The error was
not useful: it failed type validation, which results in an internal error in
the compiler (from the user's perspective) and outputs no useful information
to aid in debugging.

* src/current/include/depgen.xsl
  (preproc:depgen preproc:sym): User-friendly error if more than one rate
    element.
  [rate]: Allow multiple rate elements.
2017-11-29 13:19:41 -05:00
Mike Gerwitz df4d976277 csvm2csv: Add support for date->ts conversion
* src/current/tools/csvm2csv: Modify example to include date.
  (rangeout, parseLine): Renamed from `rangeout'.  Add date->timestamp
    parsing.
2017-11-22 13:05:02 -05:00
Mike Gerwitz 481346b237 Include package eligibility classes during linking
This is important to include all terminating classifications, which
include assertions.  This is essential now that @keep support has been
removed; this essentially does the same thing, but in a more
sane/strict manner.

* src/current/compiler/linker.xsl (l:depgen)[preproc:symtable]:
  Include package-level eligibility class in initial dependency list.
2017-08-07 13:07:06 -04:00
Mike Gerwitz 90c9893a9e Remove include of now-missing defnote-attr
This was removed recently.

* src/current/dot/defnode-attr.xsl: Remove include.
2017-07-21 15:26:05 -04:00
Mike Gerwitz fe7849224d js-calc.xsl: Remove now-unneeded worksheet ns declaration
* src/current/compiler/js-calc.xsl: Remove `w' ns prefix from root node.
  Style root node.
2017-07-18 10:27:42 -04:00
Mike Gerwitz d1dbea91ac Remove debug collection from compiled function calls
This will hopefully provide a performance boost, and is a cheap
optimization to make.  The information it collected was pretty useless
in practice.

* src/current/compiler/js-calc.xsl (compile) [c:*]:
  Do not encase calculations with function ancestors in debug
  collection functions.
2017-07-18 10:14:22 -04:00
Mike Gerwitz 666b9d6a97 Remove broken calc debug worksheet predicates 2017-07-18 10:06:34 -04:00
Mike Gerwitz 52809c5148 src/current/compiler/js-calc.xsl: Strip xsl ns prefix
* src/current/compiler/js-calc.xsl: Strip xsl namespace prefix.
  Update copyright year.
  Set XSLT version to 2.0.
2017-07-18 10:04:27 -04:00
Mike Gerwitz aeded560f4 Include meta automatically in link list
These used to be automatically added via @keep.

* src/current/compiler/linker.xsl (l:depgen): Include meta symbols.
* src/symtable/symbols.xsl (lv:meta): @pollute instead of @keep.
2017-07-13 15:24:30 -04:00
Mike Gerwitz 32afebd631 Preprocess input map nodes
In particular, I want it to handle absolute import paths.  It does
this for the return map; I forgot to add it here.

* src/current/compiler/map.xsl (lvmc:compile) [lvm:program-map]:
  Preprocess nodes.
2017-07-13 09:42:20 -04:00
Mike Gerwitz dbb368ab34 macros.xsl: Remove unnused param boolean class generation
A classification used to be generated for each param for convenience;
this has been deprecated by the progui package generation (when `q:'
is used).

* src/current/include/preproc/macros.xsl: Remove template.
2017-07-12 15:58:39 -04:00