diff options
-rw-r--r-- | examples/badgoto.nl | 3 | ||||
-rw-r--r-- | examples/retur.nl | 15 | ||||
-rw-r--r-- | util.c | 2 |
3 files changed, 17 insertions, 3 deletions
diff --git a/examples/badgoto.nl b/examples/badgoto.nl index 21adb13..669120f 100644 --- a/examples/badgoto.nl +++ b/examples/badgoto.nl @@ -7,6 +7,5 @@ func () func(); @out_of_func: - - +goto middle_of_func; diff --git a/examples/retur.nl b/examples/retur.nl new file mode 100644 index 0000000..5143247 --- /dev/null +++ b/examples/retur.nl @@ -0,0 +1,15 @@ +func () -> label +{ + return print_100; + +@print_100: + print 100; + return done; +} + +goto func (); + +print "shouldn't happen"; + +@done: +print "done"; @@ -386,7 +386,7 @@ value_to_string (value_t *val, ast_type_spec_t *type) break; case AST_LABEL_TYPE: - return g_strdup_printf ("%p\n", val->label_val.label); + return g_strdup_printf ("<label %p>\n", val->label_val.label); break; case AST_ARRAY_TYPE: |