File tree Expand file tree Collapse file tree 1 file changed +9
-10
lines changed Expand file tree Collapse file tree 1 file changed +9
-10
lines changed Original file line number Diff line number Diff line change @@ -33,40 +33,39 @@ namespace microcode {
3333 i = i + 4
3434 continue
3535 }
36- const line = lines [ 0 ] . split ( " " )
37- if ( line [ 0 ] == "Page" ) {
36+ const tokens = lines [ i ] . split ( " " )
37+ if ( tokens [ 0 ] == "Page" ) {
3838 currPage = new PageDefn ( )
39- } else if ( line [ 0 ] == "EOP" ) {
39+ } else if ( tokens [ 0 ] == "EOP" ) {
4040 prog . pages . push ( currPage )
4141 currPage = undefined
42- } else if ( line [ 0 ] == "EOR" ) {
42+ } else if ( tokens [ 0 ] == "EOR" ) {
4343 currPage . rules . push ( currRule )
4444 currRule = undefined
4545 } else {
4646 if ( ! currRule ) {
4747 currRule = new RuleDefn ( )
48- currRule . sensors . push ( token2tile ( line [ 0 ] ) as number )
49- line . shift ( )
48+ currRule . sensors . push ( token2tile ( tokens [ 0 ] ) as number )
49+ tokens . shift ( )
5050 }
51- let tok = line . shift ( )
51+ let tok = tokens . shift ( )
5252 while ( tok ) {
5353 if ( ! currTile ) {
5454 currTile = token2tile ( tok )
5555 placeTile ( currTile , currRule )
56- tok = line . shift ( )
5756 } else if ( currTile instanceof IconEditor ) {
5857 break
5958 } else if ( currTile instanceof DigitEditor ) {
6059 currTile . field = currTile . fieldEditor . fromString ( tok )
6160 currTile = undefined
62- tok = line . shift ( )
6361 } else if ( currTile instanceof MelodyEditor ) {
6462 currTile . field = currTile . fieldEditor . fromString (
65- tok + line . join ( " " )
63+ tok + tokens . join ( " " )
6664 )
6765 currTile = undefined
6866 break
6967 }
68+ tok = tokens . shift ( )
7069 }
7170 }
7271 }
You can’t perform that action at this time.
0 commit comments