From fafbf3921eae6c53539f4c5de24e801365ec4af3 Mon Sep 17 00:00:00 2001 From: Mike Gerwitz Date: Tue, 15 May 2018 16:47:21 -0400 Subject: [PATCH 1/4] list2typedef: Remove trailing newline from preimage Oops---we do not want a newline as part of the preimage, which is what `<<<' does. * build-aux/list2typedef (output-item)[value]: Remove newline from preimage. * build-aux/test/test-list2typedef (test-typedef-gen): Update hashes. (test-collision-value-check): Add new collisions. --- build-aux/list2typedef | 2 +- build-aux/test/test-list2typedef | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/build-aux/list2typedef b/build-aux/list2typedef index fdb5c59a..3a18cf39 100755 --- a/build-aux/list2typedef +++ b/build-aux/list2typedef @@ -66,7 +66,7 @@ output-item() local name; read -r name local -r const=$( constify "$typedef" <<< "$name" ) - local -r value=$( hash-name "$bytes" <<< "$name" ) + local -r value=$( echo -n "$name" | hash-name "$bytes" ) assert-collision "$const" "$value" diff --git a/build-aux/test/test-list2typedef b/build-aux/test/test-list2typedef index e417c022..62a5bd8d 100755 --- a/build-aux/test/test-list2typedef +++ b/build-aux/test/test-list2typedef @@ -41,9 +41,9 @@ Second'\''s @ @Line title="FooType Type"> - - - + + + ' @@ -79,11 +79,11 @@ test-collision-value-check() # we can easily force a collision by reducing the number of bytes to 1 and # calculating hashes from /usr/share/dict/words; this is one example - local err=$( ../list2typedef Foo 1 2>&1 >/dev/null <<< 'abacist -abatis + local err=$( ../list2typedef Foo 1 2>&1 >/dev/null <<< 'abase +abate ' && echo 'EXPECTED FAILURE' ) - [[ "$err" =~ ABATIS && "$err" =~ '44' ]] || { + [[ "$err" =~ ABATE && "$err" =~ '157' ]] || { echo 'expecting useful error message for value collion' >&2 return 1 } From 2a9196d9408304567f7501f7d692be3b42cf702f Mon Sep 17 00:00:00 2001 From: Mike Gerwitz Date: Tue, 29 May 2018 10:50:31 -0400 Subject: [PATCH 2/4] Add __path-root param * src/current/include/dslc-base.xsl (__path-root): New param. * src/current/src/com/lovullo/dslc/DslCompiler.java (DslCompiler)[compile]: Resolve TAME root path. [_transform]: Set it. DEV-3115 --- src/current/include/dslc-base.xsl | 10 ++++++++++ src/current/src/com/lovullo/dslc/DslCompiler.java | 11 ++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/current/include/dslc-base.xsl b/src/current/include/dslc-base.xsl index b7a0447a..ab501e7e 100644 --- a/src/current/include/dslc-base.xsl +++ b/src/current/include/dslc-base.xsl @@ -29,6 +29,16 @@ xmlns="http://www.w3.org/1999/xhtml" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> + + + + + + + + + + + + + + + + + + + + + + + @@ -752,27 +782,71 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +