Fixed type_of
This commit is contained in:
parent
c9f15fceb9
commit
1fa6f4ec2a
|
|
@ -2131,14 +2131,23 @@ Boolean builtin_tan(InterpreterState *interpreter_state) {
|
||||||
}
|
}
|
||||||
|
|
||||||
Boolean builtin_type_of(InterpreterState *interpreter_state) {
|
Boolean builtin_type_of(InterpreterState *interpreter_state) {
|
||||||
if (interpreter_state->stack == NULL) return FALSE;
|
if (interpreter_state->stack == NULL)
|
||||||
return push_token(interpreter_state, (Token){
|
return FALSE;
|
||||||
|
|
||||||
|
StackItem *node = interpreter_state->stack;
|
||||||
|
interpreter_state->stack = interpreter_state->stack->next;
|
||||||
|
node->next = NULL;
|
||||||
|
|
||||||
|
Boolean return_value = push_token(interpreter_state, (Token){
|
||||||
.type = TOKEN_IDENTIFIER,
|
.type = TOKEN_IDENTIFIER,
|
||||||
.identifier = (Identifier){
|
.identifier = (Identifier){
|
||||||
.is_literal = TRUE,
|
.is_literal = TRUE,
|
||||||
.name = sls_str_malloc(STACK_TYPES_TYPES[interpreter_state->stack->type], TYPE_NAMES_SAFE_LENGTH),
|
.name = sls_str_malloc(STACK_TYPES_TYPES[node->type], TYPE_NAMES_SAFE_LENGTH),
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
clean_stack(node);
|
||||||
|
return return_value;
|
||||||
}
|
}
|
||||||
|
|
||||||
Boolean builtin_while(InterpreterState *interpreter_state) {
|
Boolean builtin_while(InterpreterState *interpreter_state) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue