Skip to content

Commit

Permalink
Merge branch '__rultor'
Browse files Browse the repository at this point in the history
  • Loading branch information
rultor committed Apr 13, 2023
2 parents f3eab25 + 79f91a9 commit 0ba2a0e
Show file tree
Hide file tree
Showing 3 changed files with 345 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,15 @@ SOFTWARE.
-->
<xsl:template match="/program/objects//o[../../@fence and @base='tuple']/o[1]">
<xsl:for-each select="../../o[@base='.write']/o[1]">
<xsl:variable name="name" select="../../../../@name"/>
<xsl:copy>
<xsl:attribute name="base">
<xsl:value-of select="concat(substring-after(@base, '.'), '.')"/>
</xsl:attribute>
<xsl:apply-templates select="@* except @base"/>
<xsl:element name="o">
<xsl:attribute name="base">
<xsl:value-of select="concat('.', ../../../../o[starts-with(@name, 'with_')][1]/@name)"/>
<xsl:value-of select="concat('.', ../../../../o[starts-with(@name, 'with_') and o/@base=$name or @name=concat('with_', $name)]/@name)"/>
</xsl:attribute>
<xsl:attribute name="name">
<xsl:value-of select="'tmp'"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,341 @@
before: |
[x] > fake_int
[s] > counter
memory > k
s
[] > next
seq > @
^
.k
.write
^
.k
.plus
1
^
.k
[] > app
counter > c
0
c
.next > x1
c
.next > x2
c
.next > x3
seq > @
QQ
.io
.stdout
QQ
.txt
.sprintf
"First: %d\nSecond: %d\nThird: %d\n"
x1
x2
x3
after: |
[x] > fake_int
[x] > with_fake_int
fake_int_spec_x_fake_int > @
x
[x] > with_counter
fake_int_spec_x_counter > @
x
[x] > with_counter_next
fake_int_spec_x_counter_next > @
x
[x] > with_app
fake_int_spec_x_app > @
x
[s] > counter
memory > k
s
[] > next
seq > @
^
.k
.write
^
.k
.plus
1
^
.k
[s] > with_fake_int
counter_spec_s_fake_int > @
s
[s] > with_counter
counter_spec_s_counter > @
s
[s] > with_counter_next
counter_spec_s_counter_next > @
s
[s] > with_app
counter_spec_s_app > @
s
[] > next_as_tuple
seq > @
TRUE
*
k.
^
.with_counter > tmp
^
.k
.plus
1
tmp
[] > app
counter > c
0
c
.next_as_tuple > x1_tuple
x1_tuple
.at > x1
0
x1_tuple
.at
1
.next_as_tuple > x2_tuple
x2_tuple
.at > x2
0
x2_tuple
.at
1
.next_as_tuple > x3_tuple
x3_tuple
.at > x3
0
seq > @
QQ
.io
.stdout
QQ
.txt
.sprintf
"First: %d\nSecond: %d\nThird: %d\n"
x1
x2
x3
[x] > fake_int_spec_x_fake_int
[x] > with_fake_int
fake_int_spec_x_fake_int > @
x
[x] > with_counter
fake_int_spec_x_counter > @
x
[x] > with_counter_next
fake_int_spec_x_counter_next > @
x
[x] > with_app
fake_int_spec_x_app > @
x
[x] > fake_int_spec_x_counter
[x] > with_fake_int
fake_int_spec_x_fake_int > @
x
[x] > with_counter
fake_int_spec_x_counter > @
x
[x] > with_counter_next
fake_int_spec_x_counter_next > @
x
[x] > with_app
fake_int_spec_x_app > @
x
[x] > fake_int_spec_x_counter_next
[x] > with_fake_int
fake_int_spec_x_fake_int > @
x
[x] > with_counter
fake_int_spec_x_counter > @
x
[x] > with_counter_next
fake_int_spec_x_counter_next > @
x
[x] > with_app
fake_int_spec_x_app > @
x
[x] > fake_int_spec_x_app
[x] > with_fake_int
fake_int_spec_x_fake_int > @
x
[x] > with_counter
fake_int_spec_x_counter > @
x
[x] > with_counter_next
fake_int_spec_x_counter_next > @
x
[x] > with_app
fake_int_spec_x_app > @
x
[s] > counter_spec_s_fake_int
memory > k
s
[] > next
seq > @
^
.k
.write
^
.k
.plus
1
^
.k
[s] > with_fake_int
counter_spec_s_fake_int > @
s
[s] > with_counter
counter_spec_s_counter > @
s
[s] > with_counter_next
counter_spec_s_counter_next > @
s
[s] > with_app
counter_spec_s_app > @
s
[] > next_as_tuple
seq > @
TRUE
*
k.
^
.with_fake_int > tmp
^
.k
.plus
1
tmp
[s] > counter_spec_s_counter
memory > k
s
[] > next
seq > @
^
.k
.write
^
.k
.plus
1
^
.k
[s] > with_fake_int
counter_spec_s_fake_int > @
s
[s] > with_counter
counter_spec_s_counter > @
s
[s] > with_counter_next
counter_spec_s_counter_next > @
s
[s] > with_app
counter_spec_s_app > @
s
[] > next_as_tuple
seq > @
TRUE
*
k.
^
.with_counter > tmp
^
.k
.plus
1
tmp
[s] > counter_spec_s_counter_next
memory > k
s
[] > next
seq > @
^
.k
.write
^
.k
.plus
1
^
.k
[s] > with_fake_int
counter_spec_s_fake_int > @
s
[s] > with_counter
counter_spec_s_counter > @
s
[s] > with_counter_next
counter_spec_s_counter_next > @
s
[s] > with_app
counter_spec_s_app > @
s
[] > next_as_tuple
seq > @
TRUE
*
k.
^
.with_counter_next > tmp
^
.k
.plus
1
tmp
[s] > counter_spec_s_app
memory > k
s
[] > next
seq > @
^
.k
.write
^
.k
.plus
1
^
.k
[s] > with_fake_int
counter_spec_s_fake_int > @
s
[s] > with_counter
counter_spec_s_counter > @
s
[s] > with_counter_next
counter_spec_s_counter_next > @
s
[s] > with_app
counter_spec_s_app > @
s
[] > next_as_tuple
seq > @
TRUE
*
k.
^
.with_app > tmp
^
.k
.plus
1
tmp
result: |
First: 1
Second: 2
Third: 3
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ after: |
*
k.
^
.with_counter > tmp
.with_counter_next > tmp
^
.k
.plus
Expand Down Expand Up @@ -206,7 +206,7 @@ after: |
*
k.
^
.with_counter > tmp
.with_app > tmp
^
.k
.plus
Expand Down

0 comments on commit 0ba2a0e

Please sign in to comment.