diff --git a/PLASMA/src/parse.c b/PLASMA/src/parse.c index da5bc5f7..9ba23843 100755 --- a/PLASMA/src/parse.c +++ b/PLASMA/src/parse.c @@ -634,7 +634,8 @@ int parse_expr() } int parse_stmnt(void) { - int tag_prevbrk, tag_else, tag_endif, tag_while, tag_wend, tag_repeat, tag_for, tag_choice, type, addr, step; + int tag_prevbrk, tag_else, tag_endif, tag_while, tag_wend, tag_repeat, tag_for, tag_choice, tag_of; + int type, addr, step; char *idptr; /* @@ -802,6 +803,7 @@ int parse_stmnt(void) tag_prevbrk = break_tag; break_tag = tag_new(BRANCH_TYPE); tag_choice = tag_new(BRANCH_TYPE); + tag_of = tag_new(BRANCH_TYPE); if (!parse_expr()) { parse_error("Bad CASE expression"); @@ -818,14 +820,19 @@ int parse_stmnt(void) return (0); } emit_brne(tag_choice); + emit_codetag(tag_of); while (parse_stmnt()) next_line(); - emit_brnch(break_tag); + //emit_brnch(break_tag); + tag_of = tag_new(BRANCH_TYPE); + emit_brnch(tag_of); emit_codetag(tag_choice); tag_choice = tag_new(BRANCH_TYPE); } else if (scantoken == DEFAULT_TOKEN) { scan(); + emit_codetag(tag_of); + tag_of = 0; while (parse_stmnt()) next_line(); if (scantoken != ENDCASE_TOKEN) { @@ -839,6 +846,8 @@ int parse_stmnt(void) return (0); } } + if (tag_of) + emit_codetag(tag_of); emit_codetag(break_tag); emit_drop(); break_tag = tag_prevbrk; diff --git a/PLASMA/src/test.pla b/PLASMA/src/test.pla index b4c8beb7..ae2b514a 100755 --- a/PLASMA/src/test.pla +++ b/PLASMA/src/test.pla @@ -17,6 +17,7 @@ byte a2e[] = "//e" byte a2c[] = "//c" byte a3[] = "///" word struct[] = 1, 10, 100, 1000, 10000 +word ptr byte spaces[] = " " ; @@ -61,21 +62,36 @@ export def main(range) when MACHID & $C8 is $08 puts(@a1) + break is $00 puts(@a2) + break is $40 puts(@a2p) + break is $80 puts(@a2e) + break is $88 puts(@a2c) + break is $C0 puts(@a3) + break otherwise putc('?') wend putln end +ptr=@struct main(@struct:6) +puti((ptr):6) +putln +puti(ptr=>6) +putln +puti((ptr).6) +putln +puti(ptr->6) +putln done