git @ Cat's Eye Technologies SixtyPical / 04678ca
Block-level decls are visible in inner blocks. Cat's Eye Technologies 8 years ago
3 changed file(s) with 35 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
239239 | }
240240 | }
241241 ? undeclared location
242
243 Block-level declarations are visible in inner blocks.
244
245 | routine main {
246 | reserve byte lives
247 | with sei {
248 | if beq {
249 | lda #3
250 | repeat bne {
251 | sta lives
252 | }
253 | } else {
254 | sta lives
255 | }
256 | }
257 | }
258 = True
259
260 A block-level `reserve` may not supply an initial value.
261
262 | routine main {
263 | reserve byte lives : 3
264 | lda lives
265 | }
266 ? block-level 'lives' cannot supply initial value
242267
243268 All routines jsr'ed to must be defined, or external.
244269
3131 reserve vector dispatch_state
3232
3333 reserve byte[18] press_fire_msg: "PRESS FIRE TO PLAY"
34
35 reserve byte save_x // TODO: SHOULD BE BLOCK LOCAL!
3634
3735 routine calculate_new_position outputs (new_position) {
3836 clc
169167 }
170168
171169 routine state_play_game {
172 // reserve byte save_x
170 reserve byte save_x
173171 ldx #0
174172 repeat bne {
175173 stx save_x
211211 mapInstrName n1 n2 (DELTA sl1 v) =
212212 DELTA (mapStorageLocationName n1 n2 sl1) v
213213
214 mapInstrName n1 n2 (IF id branch b1 b2) =
215 IF id branch (mapBlockNames n1 n2 b1) (mapBlockNames n1 n2 b2)
216
217 mapInstrName n1 n2 (REPEAT id branch b1) =
218 REPEAT id branch (mapBlockNames n1 n2 b1)
219
220 mapInstrName n1 n2 (WITH instr b1) =
221 WITH instr (mapBlockNames n1 n2 b1)
222
214223 {-
215 | IF InternalID Branch Block Block
216 | REPEAT InternalID Branch Block
217 | WITH WithInstruction Block
218224 | COPYROUTINE RoutineName StorageLocation
219225 -}
220226