Skip to content

Commit

Permalink
Remove TEXT_LABEL semantics off CLEO_CALL (#86)
Browse files Browse the repository at this point in the history
  • Loading branch information
thelink2012 committed Dec 17, 2016
1 parent ffd0a3d commit 13a19b8
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
5 changes: 4 additions & 1 deletion src/script.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ void Script::handle_special_commands(const std::vector<shared_ptr<Script>>& scri
auto& argvar = *opt_arg_var;

if(argvar->type != lvar->type
&& !(is_cleo_call && argvar->is_text_var() && lvar->type == VarType::Int))
&& !(false && is_cleo_call && argvar->is_text_var() && lvar->type == VarType::Int))
{
program.error(arg_node, "type mismatch in target label");
// TODO more info
Expand Down Expand Up @@ -359,7 +359,10 @@ void Script::handle_special_commands(const std::vector<shared_ptr<Script>>& scri
if((**arginput).maybe_annotation<const int32_t&>())
break;
if(is_cleo_call && (**arginput).maybe_annotation<const TextLabelAnnotation&>())
{
program.error(**arginput, "CLEO_CALL semantics for TEXT_LABEL inputs are still unspecified");
break;
}
handle_script_input(**arginput, lvar, is_cleo_call);
break;
case VarType::Float:
Expand Down
8 changes: 4 additions & 4 deletions test/codegen/cleo_call.sc
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ LVAR_TEXT_LABEL text
// CHECK-L: CLEO_CALL %MAIN_1 2i8 5i8 5i8 0@
CLEO_CALL sum 0 5 5 a

// CHECK-L: CLEO_CALL %MAIN_1 2i8 "TEXT" 1@s 0@
CLEO_CALL sum 0 text $text a // sums two pointers
// /////CHECK-L: CLEO_CALL %MAIN_1 2i8 "TEXT" 1@s 0@
//CLEO_CALL sum 0 text $text a // sums two pointers

// CHECK-L: CLEO_CALL %MAIN_1 2i8 "Test Case" 1@s 0@
CLEO_CALL sum 0 "Test Case" $text a // sums two pointers
// /////CHECK-L: CLEO_CALL %MAIN_1 2i8 "Test Case" 1@s 0@
//CLEO_CALL sum 0 "Test Case" $text a // sums two pointers

TERMINATE_THIS_CUSTOM_SCRIPT
}
Expand Down
6 changes: 3 additions & 3 deletions test/semantics/cleo_call_text2.sc
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ LVAR_TEXT_LABEL textvar

CLEO_CALL receives_text1 0 "text" // expected-error {{LVAR_TEXT_LABEL is not allowed}}

CLEO_CALL receives_text2 0 "text"
CLEO_CALL receives_text2 0 text
CLEO_CALL receives_text2 0 $textvar
CLEO_CALL receives_text2 0 "text" // expected-error {{unspecified}}
CLEO_CALL receives_text2 0 text // expected-error {{unspecified}}
CLEO_CALL receives_text2 0 $textvar // expected-error {{mismatch}}

TERMINATE_THIS_CUSTOM_SCRIPT
}
Expand Down

0 comments on commit 13a19b8

Please sign in to comment.