From: Matt S Trout Date: Sat, 2 Apr 2016 19:09:39 +0000 (+0000) Subject: add fragment runner and output for diffing X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=11fecad8c232288af8042d45536aa435d1c73426;p=scpubgit%2FDX.git add fragment runner and output for diffing --- diff --git a/bin/fragrun b/bin/fragrun new file mode 100755 index 0000000..dc148e7 --- /dev/null +++ b/bin/fragrun @@ -0,0 +1,5 @@ +#!/bin/sh + +for i in $(cd fragments; ls); do + perl -Ilib bin/dx fragments/$i >fragment.output/$i +done diff --git a/fragment.output/bind b/fragment.output/bind new file mode 100644 index 0000000..7e050d4 --- /dev/null +++ b/fragment.output/bind @@ -0,0 +1,32 @@ +$ ? +? dict ?X +SetValue 0.X {{ }} +? eq ?Y X +? qact +SetValue 0.X {{ }} +? eq Y {{ foo 1 }} +BindValue 0.Y 0.X +? qact +SetValue 0.X {{ }} +BindValue 0.Y 0.X +? . +{{ X {{ }} Y {{ }} }} +$ ? +? dict ?X {{ foo {{ bar 1 }} }} +SetValue 0.X {{ foo {{ bar 1 }} }} +? member_at X 'foo' ?Y +? member_at Y 'bar' ?Z +BindValue 0.Y 0.X.foo +? eq Z 2 +BindValue 0.Z 0.Y.bar +? member_at Y 'baz' 4 +SetBoundValue 0.Z 2 +SetBoundValue 0.Y.bar 2 +SetValue 0.X.foo.bar 2 +? qact +SetValue 0.X {{ foo {{ bar 1 }} }} +SetValue 0.X.foo.bar 2 +BindValue 0.Y 0.X.foo +BindValue 0.Z 0.Y.bar +? . +{{ X {{ foo {{ bar 2 }} }} Y {{ bar 2 }} Z 2 }} diff --git a/fragment.output/const b/fragment.output/const new file mode 100644 index 0000000..5e4fc43 --- /dev/null +++ b/fragment.output/const @@ -0,0 +1,12 @@ +$ #trace +step +search +$ const systems {{ agaton 'debian' sherlock 'debian' hatebox 'rhel' }} +$ ? +? member_at systems ?Name ?OS +SetValue 0.Name 'agaton' +BindValue 0.OS systems.agaton +? eq OS 'debian' +? ... +{{ Name 'agaton' OS 'debian' }} +{{ Name 'hatebox' OS 'rhel' }} +{{ Name 'sherlock' OS 'debian' }} +No next solution diff --git a/fragment.output/member_at b/fragment.output/member_at new file mode 100644 index 0000000..3681421 --- /dev/null +++ b/fragment.output/member_at @@ -0,0 +1,26 @@ +$ ? +? eq ?X {{ a 1 b 2 c 3 }} +SetValue 0.X {{ a 1 b 2 c 3 }} +? member_at X ?Y ?Z +? ... +{{ X {{ a 1 b 2 c 3 }} Y unset Z unset }} +No next solution +$ qlist +eq ?X {{ a 1 b 2 c 3 }} +member_at X ?Y ?Z +$ ? +? eq ?X {{ a 1 b 2 c 3 }} +SetValue 0.X {{ a 1 b 2 c 3 }} +? member_at X ?Y ?Z +? eq Z 2 +SetValue 0.Y 'a' +BindValue 0.Z 0.X.a +? ... +{{ X {{ a 1 b 2 c 3 }} Y 'a' Z 1 }} +{{ X {{ a 1 b 2 c 3 }} Y 'b' Z 2 }} +{{ X {{ a 1 b 2 c 3 }} Y 'c' Z 3 }} +No next solution +$ qlist +eq ?X {{ a 1 b 2 c 3 }} +member_at X ?Y ?Z +eq Z 2