Commit Graph

1242 Commits (2954c591a1349cbca2c5811d15b363caeef03bd6)

Author SHA1 Message Date
Mike Gerwitz c68c2f41d5 core/vector/table: Add specification for main templates
* core/test/core/suite.xml: Import core/test/core/vector/table.
* core/test/core/vector/table.xml: New specification.
2019-02-04 10:22:46 -05:00
Mike Gerwitz a35844f3fb depgen: Do not recurse into templates
Same logic, more efficient implementation.

* src/current/include/depgen.xsl (preproc:depgen): Stop at lv:template.
2019-02-02 23:19:40 -05:00
Mike Gerwitz 07e5dbd94b Add expand-barrier and skip-child-expansion
It's going to be like TeX before you know it... ._.

* src/current/include/preproc/package.xsl (preproc:tpl-check)
  [lv:template|lv:const|lv:typedef|lv:param-copy]: Add lv:param-copy.
* src/current/include/preproc/template.xsl (preproc:apply-template)
 [lv:expand-barrier, lv:skip-child-expansion]: New expansion control
   structures.
2019-02-01 16:01:56 -05:00
Mike Gerwitz 7ac4c1ce9d Template variable expansion on (lv:param-value|lv:param-inherit)/@name
This allows for dynamically generated metadata names.

* src/current/include/preproc/template.xsl (preproc:apply-template)
  [lv:param-meta]: Expand @name.
  [lv:param-inherit]: Expand @meta.
2019-02-01 16:01:56 -05:00
Mike Gerwitz f719d391c7 Default short-hand constant description to c:value-of/@label
This is a much more useful description if present.

* src/current/include/preproc/macros.xsl (preproc:macros)[c:value-of...]:
    Default generated constant description to @label.
2019-02-01 16:01:56 -05:00
Mike Gerwitz 73d691273e core: Replace all occurrences of c:{set=>vector}
The former is deprecated and never made any sense at all.
2019-02-01 16:01:56 -05:00
Mike Gerwitz b725963722 Add c:vector as c:set alternative
The term "set" is all wrong---it is actally intended to be a vector, and can
absolutely have duplicate elements (and often does).

* src/current/calc.xsd (vector): Add, recommending in place of `set'.
* src/current/compiler/js-calc.xsl (compile-calc)[c:set|c:vector]:
    Add `c:vector' and provide deprecation notice for `c:set'.
* src/current/include/calc-display.xsl (c:set|c:vector): Likewise.
2019-02-01 16:01:56 -05:00
Mike Gerwitz e4ccf3e90a test/spec: Work around expand-sequence bug
* core/test/spec.xml (_describe_): Enclose aggregate classification in a
  series of nested expand-sequence to work around bug (described in
  comment), which was causing test cases to not be compiled.
2019-02-01 16:01:56 -05:00
Mike Gerwitz 304faa1f07 summary: Remove rate-group processing
* src/current/summary.css (.rate-group, .rate-groups): Remove.
* src/current/summary.xsl (gen-menu): Remove rate-group processing.
  (rate-group-title): Remove.
  (lv:rate-group): Remove.
2019-02-01 16:01:56 -05:00
Mike Gerwitz 22aa59b5cf map: Properly default value in translation
A better option is to pre-process all inputs, but I need a quick
fix to my stupidity.  0||""==="".

* src/current/compiler/map.xsl (lvmc:compile)[lvm:map//lvm:from[*]]: Correct oval default.
2019-02-01 16:01:56 -05:00
Mike Gerwitz c7fec6a240 csv2xml: Import /rater/core{=>/base} directly
/rater/core is being removed.
2019-02-01 00:36:48 -05:00
Mike Gerwitz 9070d97e87 doc (Core Concepts): Initial stub section
I wanted to get this section started so that I can easily add to it when I
have small bits of time to do so.  Our documentation needs to improve.

* doc/Makefile.am (tame_TEXINFOS): Add `concept.texi'.
* doc/concept.texi: New file.
* doc/preproc.texi: Remove accidentally added input line.
* doc/tame.texi (menu): Add `Core Concepts' node.
2019-01-30 13:45:43 -05:00
Mike Gerwitz 01a420fd81 Revert "set_default: Allow empty vectors"
I need to revert this for now because it breaks YAML test cases.  The proper
fix is a more expressive type system with dependent types that would allow
it to know the proper number of indexes to initialize relative to other
inputs.  I wanted to implement this anyway to help catch iteration-related
bugs.

I'm tabling this for now, though, since I have other things that I need to
work on.

This reverts commit 4406cbe553.
2019-01-30 13:45:17 -05:00
Mike Gerwitz a985cf1f23 doc ({About=>Using} TAME): {about=>usage.tex}
* doc/Makefile.am (tame_TEXINFOS): {about=>usage}.texi.
* doc/tame.texi: Include {about=>usage}.texi
* doc/about.texi: Rename file.
* doc/usage.texi: New file (renamed from about).
2019-01-30 13:45:15 -05:00
Mike Gerwitz 0c67e85676 doc: Add cindex entries for existing About
* doc/about.texi: Add miscellaneous entries.
2019-01-30 13:44:43 -05:00
Mike Gerwitz 2e0a3fa62f doc/macros.texi: TODO adds dnindex entry
* doc/macros.texi (todo): Add dnindex entry.
2019-01-30 13:44:43 -05:00
Mike Gerwitz 290cf1b6e6 doc: Copied developer-related macros from Liza
This includes, notably, the Developer Notes feature.  I did not copy any
SRCUI stuff since this project uses literate documentation, but I'll add it
if it seems like it will be useful.  Barely any of the project is written
literately right now.

* .gitignore: `{=>/}config.*'.
* configure.ac (SET_DEVNOTES): New variable.
  (AC_CONFIG_FILES): Add `doc/config.texi'.
* doc/.gitignore (config.texi): Ignore (generated).
* doc/Makefile.am (tame_TEXINFOS): Add `macros.texi' and `config.texi'.
* doc/config.texi.in: New file.
* doc/macros.texi: New file containing some macros from `doc/tame.texi' and
  some from Liza's `doc/macros.texi'.
* doc/tame.texi: Adjust position of header comment.  Include `config.texi'
    and `macros.texi'.  Add devnotice to header.  Strip out macros.
  (menu): Add `Concept Index' and conditional `Developer Notes Index'.
  (Concept Index, Developer Notes Index): New nodes (latter conditional).
2019-01-30 13:44:24 -05:00
Mike Gerwitz 7f6961272c doc (Preprocessor): Extract into own file
* doc/Makefile.am (tame_TEXINFOS): Add `preproc.texi'.
* doc/preproc.texi: New file.
* doc/tame.texi: Extract `Preprocessing' section.
2019-01-29 15:46:21 -05:00
Mike Gerwitz e30e69d904 doc/tame.texi: Copyright year update 2019-01-29 15:44:22 -05:00
Mike Gerwitz f3aa38a0c1 doc: Convert most sections index appendicies
I want this manual to be useful both to developers and users of TAME,
so this distinction needs to be made clear.

* doc/tame.texi (Preprocessor): chapter=>appendix.
* src/graph.texi: Top to appendix and raise subsections.
* src/symtable.texi: Top to appendix.
2019-01-29 15:38:00 -05:00
Mike Gerwitz 4406cbe553 set_default: Allow empty vectors
This is an assumption that's existed since the Summary Page was first
devised---that all vectors have at least one value.  This is because the
bucket (originating from Liza) always has at least one value in its vectors.

Of course, we still have a problem in that the Summary Page initializes
everything to have a single value by default, and that's still the
case.  But this will at least allow for things _outside_ the Summary Page to
provide an empty array.  I'll have to address the Summary Page separately,
and that's going to be difficult, since we don't really want to change the
behavior across the board.

* src/current/compiler/js.xsl (set_defaults): Default max index to 0 if
    `length' is unavailable, rather than 1.
2019-01-29 10:07:36 -05:00
Mike Gerwitz c9ab302f53 map: Proper array check for translation iteration
The previous length check existed as a really bad array check (before
Array.isArray was a thing).  This has been broken since Nov 2012.

The problem manifests itself when you want an empty array.  We then have:
  [] => [[]] => [DEFAULT_VALUE]

* src/current/compiler/map.xsl (lvmc:compile)[lvm:map//lvm:from[*]]: Use
    `Array.isArray' in place of length check.
2019-01-28 14:15:10 -05:00
Mike Gerwitz 017ca1f437 suppmk-gen: Properly exit with non-zero status on failure
* build-aux/m4/calcdsl.m4: Exit on suppmk-gen.
* build-aux/suppmk-gen: Exit on failure.
2019-01-23 16:04:01 -05:00
Mike Gerwitz ce08086b15 doc: Remove todo.texi
TODOs shouldn't be stored here, and they will get out of sync.

* Makefile.am (tame_TEXINFOS): Remove todo.texi.
* tame.texi: Remove include and menu entry.
* todo.texi: Remove file.
2019-01-23 09:53:37 -05:00
Mike Gerwitz a7f186beff [BC BREAK] rater/core/insurance (_premium_): Add zero and negative assertions
This is a BC break since this generates assertions by default.  To maintain
BC, set `@allow-zero@' and `@allow-negative@' to `true' in existing template
applications.

* core/insurance.xml
  (assert_ignore_premium_zero, assert_ignore_premium_negative): New params.
  (_premium_): Generate assertions.
    [@allow-zero@, @allow-negative@]: New params.
2019-01-02 16:58:56 -05:00
Mike Gerwitz dec3f2ef35 rater/core/insurance (_factor_): gt{=>e} for negative assertions 2019-01-02 16:56:57 -05:00
Mike Gerwitz c3c7cfeeff map.xsl: Escape all output in strings 2018-12-20 14:31:14 -05:00
Mike Gerwitz fa378a654a Add lsimports and check-coupling
lsimports will be able to be used to replace the last remaining Ant script
that generates depfiles.

* build-aux/check-coupling:
* build-aux/lsimports: New files.
2018-12-19 14:20:24 -05:00
Mike Gerwitz 73f6b77771 [BC BREAK] check target supplier customization
This allows customizing from the command-line what suppliers should be
checked.  This motivation for this is both to run as part of a distributed
pipeline (where each supplier may be built individually), and for during
development of a single supplier.

BC BREAK: Note that this will now check for `package' in the test path for
UI tests.  To keep the old directory around, a symlink of `packages' to `ui'
would suffice.

* build-aux/Makefile (SUPPLIERS, suppliers_strip): New variables.
  (check-am): BC-BREAK: Build and check only requested suppliers.
* build-aux/progtest-runner: BC-BREAK: First argument is now test directory
    and all remaining arguments specify the supplier XML files to check.
2018-12-18 21:46:18 -05:00
Mike Gerwitz 32e3b16ec9 Makefile.am (program-ui): Remove standalones dep
We want to be able to build the UI independently of the
suppliers.  Historically, this did not provide much of a benefit, but this
change allows us to build independently as a job in a distributed pipeline,
and allows testing out the UI when rating is unneeded.

* build-aux/Makefile.am (program-ui): Remove `standalones'.
2018-12-18 20:58:29 -05:00
Mike Gerwitz f50b49542e Makefile.am (program-ui-immediate): Remove old target
This target has not been used for years.

* build-aux/Makefile.am (program-ui-immediate): Remove target.
  (program-ui): Use dependency of old `program-ui-immediate'.
  (.PHONY): Remove `program-ui-immediate'.
2018-12-18 20:53:58 -05:00
Mike Gerwitz 4105dc8fef Makefile.am: Add common target
* src/build-aux/Makefile.am (common): New target.
2018-12-18 16:40:35 -05:00
Mike Gerwitz c7e84f2e29 DslCompiler: Use s9api instead of JAXP
The difference is described here:

  http://www.saxonica.com/html/documentation/using-xsl/embedding/

And s9api here:

  http://www.saxonica.com/html/documentation/using-xsl/embedding/s9api-transformation.html

* Makefile.am (DSLC_CLASSPATH): Export for submakes.
* configure.ac (DSLC_CLASSPATH): Prefix with SAXON_CP.
* rater/rater.xsd (classNameType): Increase length 50=>75 (generated
    identifiers can now exceed that, it seems).
* src/current/rater.xsd: Likewise.  These files need to be combined.
* src/current/src/Makefile (CLASSPATH): Set to DSLC_CLASSPATH.
* src/current/src/com/lovullo/dslc/DslCompiler.java: Update imports.
  (DslCompiler)[_DslCompiler]: New members _processor and
    _xsltCompiler.  Convert to s9api.
2018-12-18 13:33:25 -05:00
Mike Gerwitz 044498f03f Makefile.am: Copy srv/!(rater).js to destination paths
Note that such files may not actually exist, which is why `nullglob' is set
and the `for' loop is used.

* build-aux/Makefile.am (SHELL): Set `nullglob'.
  (program-data-copy, lvroot): Copy srv/!(rater).js to destination JS paths.
2018-12-10 10:51:03 -05:00
Mike Gerwitz 219a4b521a summary: Remove reset button
This has been broken for years.  I don't object to fixing it, it's just that
I have better things to do right now and we've gotten complaints about it;
no use in keeping around something that's broken if there's no desire to fix
it.  Workaround: refresh the page.

This does keep around the reset logic because it is actually used in other
places.

* src/current/include/entry-form.xsl (entry-form)[lv:package]: Remove reset
    button.
* src/current/include/entry-form.js (clearTestCases): Remove broken function
    call `Prior.setPriorMessage(null)'.
2018-12-05 10:21:25 -05:00
Mike Gerwitz bcd8a67bd9 summary: Sans-serif font stack
It wasn't until recently that I realized that the default browser font was
being used, since I have mine customized.

* src/current/summary.css (body)[font-family]: Sans-serif font stack.
2018-12-05 10:14:08 -05:00
Mike Gerwitz fe14db7379 map: Correctly set translation defaults given the symbol dimensions
* src/current/compiler/map.xsl:
  (lvmc:gen-input-default): Add argument.
    [dim]: New param, defaulting to `$sym/@dim'.
  (lvmc:compile)[lvm:map//lvm:from[*]]: Provide appropriate dimension value
    to `set_defaults'.  Provide compile-time error if nesting of `from'
    nodes exceeds what is appropriate for the symbol dimensions.
2018-12-04 16:56:53 -05:00
Mike Gerwitz 6e4d42f926 DslCompiler: Properly output errors and termination line
This fixes a number of obnoxious miscellaneous issues, summarized below.

* src/current/src/com/lovullo/dslc/DslCompiler.java (DslCompiler)[compile]:
    Output termination line (DONE) on missing destination path
    error.  Always output exception message before termination
    line (otherwise it won't output to the user).  Output termination line
    and remove destination file for XSD failure.
2018-12-04 13:45:46 -05:00
Mike Gerwitz f62f2ccacb bin/tame: Shift arguments after -v
* bin/tame (main): Fix issue where -v did not shift arguments.
2018-12-04 13:45:36 -05:00
Mike Gerwitz 10106993b5 map: Always terminate on missing destination symbol
This was a bit of a nasty one.  Fortunately, this was only used as a
validation, so the code that the compiler produced was still correct.

The problem was that a version of Saxon sometime between 9.5 and 9.8 added
an optimization to eliminate conditionals with no body.  Consequently, the
kluge to force the variable to be evaluated was optimized away,
`lvmc:get-symbol' was never called, and no error was ever produced.

This would be best refactored, but that's not something I have time to take
up at the moment priority-wise.  This should be future-proof since this
would never be a noop.

* src/current/compiler/map.xsl (lvmc:compile)[lvm:map//lvm:from[*]]: Force
    evaluation of `$sym' by ensuring that the condition will not be a noop.
2018-12-04 12:06:40 -05:00
Mike Gerwitz cd5440b8da tamed: Clarify usage output shell example
* bin/tamed (usage): Clarify killing when run on a shell.
2018-12-03 16:46:06 -05:00
Mike Gerwitz 079d1dcfaf tamed: Do not stall if TAMED_SPAWER_PID is running
This will ensure that tamed does not stall while e.g. make is still
running.  This makes TAMED_STALL_SECONDS almost useless; maybe it'll be
removed in future versions.

* bin/tame (TAMED_SPAWNER_PID): Export variable.
* bin/tamed (TAMED_SPAWNER_PID): New variable, default to PPID.
  (spawner-dead): New function.
  (stall-monitor): Use it.
  (usage): Update documentation.
* build-aux/Makefile.am: Set TAMED_SPAWNER_PID to own id and export.
2018-12-03 16:25:25 -05:00
Mike Gerwitz 210693c22f [DEV-3958] c1map: Make output PHP namespace configurable
* src/current/c1map.xsl (lvm:c1map): Copy `@namespace' to generated
    `lvmp:root'.
* src/current/c1map/render.xsl (lvmp:render)[lvmp:root]: Output
    `@namespace' rather than using hardcoded string and dynamic program.
2018-11-28 16:42:04 -05:00
Mike Gerwitz cc7e09a700 Add new c1root and local c1-service copying to build
This maintains BC for existing raters that have not yet been migrated to use
the new c1-import service.

* build-aux/Makefile.am (path_c1root): New variable.
  (.PHONY): Add c1root target dependency.
  (program-data-copy): Copy to `@C1_IMPORT_MAPDEST@'.
  (c1root): New target.
* build-aux/m4/calcdsl.m4 (C1_IMPORT_MAPDEST): Configure depending on the
    existence of the `c1-import' directory.
2018-11-28 15:55:49 -05:00
Mike Gerwitz 7f3e279cfa anyValue: Always yield a matrix if any predicate is a matrix
This is a long-standing bug, apparently.  The location of this code makes it
difficult to test directly (that is in dire need of correcting), but
fortunately we have a number of tests in systems that use TAME that
indirectly test this.

The problem manifested when a matrix was already in the store, but then a
scalar or vector predicate was considered.  Without making the branch that
was modified here, it modified store such that it would always yield a
vector.

* src/current/compiler/js.xsl (anyValue): Consider store dimension when
    recursing.
2018-11-21 15:19:44 -05:00
Mike Gerwitz 98494edee5 core build
This is the start of a working build for core.

* .gitignore: Ignore generated files from configuration and build.
* build.xml: Copy from rater repo.  This is the last remaining ant-based
    dependency and can be gotten rid of; see comments.
* configure.ac: New file.
* rater/build-aux, rater/src: New symlinks.
2018-11-08 11:15:12 -05:00
Mike Gerwitz 62089877b2 Expose CALCROOT and new SRCPATHS to build scripts
This begins to decouple the rater directory conventions using an incremental
approach, defaulting to the existing structure.  Not all things were
modified (for example, cleaning will not work properly with a custom
SRCPATHS if those directories do not exist); WIP.

* build-aux/Makefile.am (path_dsl): Use `CALCROOT'.
  (suppliers.mk): Test for existence of program.dep and c1map directory
    before acting on them.
* build-aux/m4/calcdsl.m4: Default SRCPATHS.  Output it during configure.
    Expose CALCROOT and SRCPATHS using AC_SUBST.
    Invoke suppmk-gen using SRCPATHS.
* build-aux/suppmk-gen: Use arguments (SRCPATHS) in place of hard-coded paths.
2018-11-08 11:05:38 -05:00
Mike Gerwitz 5cb78cc47d dslc: Invoke with static rater path
This frees us from requiring a rater/ directory in the working
directory.  However, it is important that we continue using it if it
exists, since there are additional things that haven't yet been moved
into the tame repo.

* bin/dslc.in: Provide path to rater/ directory.
* src/current/src/com/lovullo/dslc/DslCompiler.java: Use provided rater/ path.
2018-11-08 09:26:07 -05:00
Mike Gerwitz 970c3531c5 core/COPYING: Remove duplicate
This is no longer necessary since tame-core was merged
with this repo.
2018-11-07 23:27:18 -05:00
Mike Gerwitz 1fb87106b0 core/test/core/insurance: Add missing descriptions
This was broken by a previous commit, but was not noticed because
the test cases aren't being compiled as part of the build yet!

Now that we have tamed, that is an option.

* test/core/insurance.xml: Add missing @desc@.
2018-10-29 11:55:34 -04:00