Skip to content

Commit 946999b

Browse files
committed
parser not asserting
1 parent ea6dc45 commit 946999b

File tree

3 files changed

+42
-1
lines changed

3 files changed

+42
-1
lines changed

assets/progs/newHS.mc

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
Page 1
2+
When press button_A Do show_image LED_image
3+
. . . . .
4+
. . . . .
5+
. . . . .
6+
. . . . .
7+
. . . . .
8+
LED_image
9+
. . . . .
10+
. . . . .
11+
. . . . .
12+
. . . . .
13+
. . . . .
14+
15+
16+
When press button_A Do play_sound happy
17+
18+
When press button_B Do show_image LED_image
19+
. . . . .
20+
. . . . .
21+
. . . . .
22+
. . . . .
23+
. . . . .
24+
LED_image
25+
. . . . .
26+
. . . . .
27+
. . . . .
28+
. . . . .
29+
. . . . .
30+
31+
32+
When press button_B Do play_sound sad
33+
34+
Page 2
35+
36+
Page 3
37+
38+
Page 4
39+
40+
Page 5

editor.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,7 @@ namespace microcode {
297297
// to string
298298
const progAsString = this.progdef.toString()
299299
const progFromString = parse(progAsString)
300+
console.log(progFromString.toString())
300301
// const progAsBuf = progFromString.toBuffer()
301302
// // compare buffers
302303
// if (buf.length == progAsBuf.length) {

mcparser.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ namespace microcode {
5454
currRule = undefined
5555
tok = tokens.shift()
5656
}
57-
for (; tokens.length > 0; tok = tokens.shift()) {
57+
for (; tok !== undefined; tok = tokens.shift()) {
5858
console.log(`tok2 = ${tok}`)
5959
if (!tok) continue
6060
if (!currRule) {

0 commit comments

Comments
 (0)