Skip to content

Commit 072561d

Browse files
authored
Merge pull request #513 from asolove/blocks-add-defs
Blocks language supports benchmark program
2 parents fb16873 + 7ef5cdb commit 072561d

File tree

1 file changed

+36
-4
lines changed

1 file changed

+36
-4
lines changed

src/web/js/transpile.xml

Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,37 @@ else:
7373
<input type="%txt"/>
7474
</inputs>
7575
</block-definition>
76+
77+
<block-definition category="Variables" s="%'a' = %'b'" type="reporter">
78+
<header />
79+
<code>&lt;#1&gt; = &lt;#2&gt;</code>
80+
<translations />
81+
<inputs>
82+
<input type="%upvar">name</input>
83+
<input type="%s">val</input>
84+
</inputs>
85+
<script>
86+
<block s="doReport">
87+
<l />
88+
</block>
89+
</script>
90+
</block-definition>
91+
92+
<block-definition category="Maps" s="%'name' [ %'arg' ]"
93+
type="reporter">
94+
<header />
95+
<code>&lt;#1&gt;[&lt;#2&gt;]</code>
96+
<translations />
97+
<inputs>
98+
<input type="%var">map</input>
99+
<input type="%s">key</input>
100+
</inputs>
101+
<script>
102+
<block s="doReport">
103+
<l />
104+
</block>
105+
</script>
106+
</block-definition>
76107
<block-definition category="Numbers" s="%'a' + %'b'" type="reporter">
77108
<header/>
78109
<code>(&lt;#1&gt; + &lt;#2&gt;)</code>
@@ -101,6 +132,7 @@ else:
101132
</block>
102133
</script>
103134
</block-definition>
135+
104136
<block-definition category="Numbers" s="%'a' / %'b'" type="reporter">
105137
<header/>
106138
<code>(&lt;#1&gt; / &lt;#2&gt;)</code>
@@ -175,7 +207,7 @@ else:
175207
<translations/>
176208
<inputs>
177209
<input type="%upvar"></input>
178-
<input type="%upvar"></input>
210+
<input type="%mult%upvar"></input>
179211
<input type="%s"></input>
180212
</inputs>
181213
<script>
@@ -189,8 +221,8 @@ else:
189221
<code>&lt;#1&gt;(&lt;#2&gt;)</code>
190222
<translations/>
191223
<inputs>
192-
<input type="%upvar"></input>
193-
<input type="%s"></input>
224+
<input type="%txt"></input>
225+
<input type="%mult%s"></input>
194226
</inputs>
195227
<script>
196228
<block s="doReport">
@@ -749,7 +781,7 @@ else:
749781
<inputs>
750782
<input type="%s"/>
751783
<input type="%s"/>
752-
<input type="%mult%txt"/>
784+
<input type="%mult%upvar"/>
753785
</inputs>
754786
<script>
755787
<block s="doReport">

0 commit comments

Comments
 (0)