aboutsummaryrefslogtreecommitdiff
path: root/src/program.c
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2020-01-25 09:54:37 +0100
committerdec05eba <dec05eba@protonmail.com>2020-01-25 09:54:37 +0100
commit5df950e0b35207930c645e8ce0c3e9ed1c9fcea5 (patch)
tree8264595bea95b6d0dcc530566168f2030dfe06ff /src/program.c
parent4b2b8d3176e84f76510cc69a627dbfa089c1dd35 (diff)
string view > string ref
Diffstat (limited to 'src/program.c')
-rw-r--r--src/program.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/program.c b/src/program.c
index dc7fe8d..78533f6 100644
--- a/src/program.c
+++ b/src/program.c
@@ -61,6 +61,7 @@ static TslProgramResult tsl_value_create_from_stack_value(TslProgram *self, TslS
break;
}
case TSL_STACK_VALUE_TYPE_STRING: {
+ #if 0
TslString *str = GC_MALLOC_ATOMIC(sizeof(TslString));
str->data = GC_MALLOC_ATOMIC(src->data.str.size + 1);
if(!str) {
@@ -82,6 +83,9 @@ static TslProgramResult tsl_value_create_from_stack_value(TslProgram *self, TslS
dst->data.string = str;
dst->type = TSL_TYPE_STRING;
+ #endif
+ dst->data.string_ref = src->data.str;
+ dst->type = TSL_TYPE_STRING_REF;
break;
}
case TSL_STACK_VALUE_TYPE_FUNCTION: {
@@ -92,8 +96,8 @@ static TslProgramResult tsl_value_create_from_stack_value(TslProgram *self, TslS
case TSL_STACK_VALUE_TYPE_VARIABLE: {
TslValue *var;
TslValue map_key;
- map_key.type = TSL_TYPE_STRING_VIEW;
- map_key.data.string_view = src->data.str;
+ map_key.type = TSL_TYPE_STRING_REF;
+ map_key.data.string_ref = src->data.str;
var = tsl_hash_map_get(self->variables, &map_key);
if(!var) {
@@ -278,8 +282,8 @@ TslProgramResult tsl_program_run(TslProgram *self) {
TslStackValue *stack_value = tsl_buffer_pop(&self->stack_values, sizeof(TslStackValue));
TslValue map_key;
TslValue *map_value;
- map_key.type = TSL_TYPE_STRING_VIEW;
- map_key.data.string_view = instruction_type4->value;
+ map_key.type = TSL_TYPE_STRING_REF;
+ map_key.data.string_ref = instruction_type4->value;
map_value = tsl_hash_map_get_or_create(self->variables, &map_key);
cleanup_if_error(map_value);