git @ Cat's Eye Technologies SixtyPical / 9e9284b
`goto` may only occur at the end of a block. Chris Pressey 3 years ago
3 changed file(s) with 19 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
379379 self.scanner.expect('{')
380380 while not self.scanner.on('}'):
381381 instrs.append(self.instr())
382 if isinstance(instrs[-1], SingleOp) and instrs[-1].opcode == 'goto':
383 break
382384 self.scanner.expect('}')
383385 return Block(self.scanner.line_number, instrs=instrs)
384386
29892989 | }
29902990 |
29912991 | define main routine trashes x, z, n {
2992 | goto bar
2992 | ld x, 0
2993 | if z {
2994 | ld x, 1
2995 | goto bar
2996 | }
29932997 | ld x, 0
29942998 | }
29952999 ? IllegalJumpError
570570 | }
571571 ? SyntaxError
572572
573 `goto` may only be the final instruction in a block.
574
575 | define bar routine trashes x, z, n {
576 | ld x, 200
577 | }
578 |
579 | define main routine trashes x, z, n {
580 | goto bar
581 | ld x, 0
582 | }
583 ? Expected '}', but found 'ld'
584
573585 Buffers and pointers.
574586
575587 | buffer[2048] buf