From 25bf40a71a8012cb2503a119b83704a7ca9b797c Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Sat, 7 Apr 2007 04:58:27 +0000 Subject: [PATCH] finish the break overloading and add some more tests (really need to get these automated) --- tools/qfcc/source/qc-parse.y | 3 ++- tools/qfcc/test/break.r | 9 +++++++++ tools/qfcc/test/vector_float.r | 8 ++++++++ 3 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 tools/qfcc/test/break.r create mode 100644 tools/qfcc/test/vector_float.r diff --git a/tools/qfcc/source/qc-parse.y b/tools/qfcc/source/qc-parse.y index cf9561d17..a628b8330 100644 --- a/tools/qfcc/source/qc-parse.y +++ b/tools/qfcc/source/qc-parse.y @@ -205,7 +205,7 @@ storage_class_t current_storage = st_global; %} -%expect 4 +%expect 5 %% @@ -1070,6 +1070,7 @@ unary_expr primary : NAME { $$ = new_name_expr ($1); } + | BREAK { $$ = new_name_expr (save_string ("break")); } | ARGS { $$ = new_name_expr (".args"); } | ARGC { $$ = argc_expr (); } | ARGV { $$ = argv_expr (); } diff --git a/tools/qfcc/test/break.r b/tools/qfcc/test/break.r new file mode 100644 index 000000000..cabe9d46b --- /dev/null +++ b/tools/qfcc/test/break.r @@ -0,0 +1,9 @@ +void () break = #0; + +void () foo = +{ + break (); + while (1) { + break; + } +}; diff --git a/tools/qfcc/test/vector_float.r b/tools/qfcc/test/vector_float.r new file mode 100644 index 000000000..950456843 --- /dev/null +++ b/tools/qfcc/test/vector_float.r @@ -0,0 +1,8 @@ +vector vec; +float f; + +void()foo = +{ + vec = f; + f = vec; +}