mirror of https://github.com/rusefi/bldc.git
Squashed 'lispBM/lispBM/' changes from da9fb6cd..0a69a489
0a69a489 small rephrasing of a conditional in eval_define 4a0d6b9f redefining any non-RUNTIME_SYMBOL is now an error. dbc4bb71 removed left over printf git-subtree-dir: lispBM/lispBM git-subtree-split: 0a69a4896c83c1dc0ef4577cf54d42b5614de5b9
This commit is contained in:
parent
501c754606
commit
98d71b26fa
|
@ -889,26 +889,27 @@ static inline void eval_define(eval_context_t *ctx) {
|
|||
lbm_value key = lbm_car(lbm_cdr(ctx->curr_exp));
|
||||
lbm_value val_exp = lbm_car(lbm_cdr(lbm_cdr(ctx->curr_exp)));
|
||||
|
||||
if (lbm_type_of(key) != LBM_VAL_TYPE_SYMBOL ||
|
||||
key == NIL) {
|
||||
error_ctx(lbm_enc_sym(SYM_EERROR));
|
||||
return;
|
||||
}
|
||||
if ((lbm_type_of(key) == LBM_VAL_TYPE_SYMBOL) &&
|
||||
(lbm_dec_sym(key) >= RUNTIME_SYMBOLS_START)) {
|
||||
|
||||
CHECK_STACK(lbm_push_u32_2(&ctx->K, key, lbm_enc_u(SET_GLOBAL_ENV)));
|
||||
ctx->curr_exp = val_exp;
|
||||
CHECK_STACK(lbm_push_u32_2(&ctx->K, key, lbm_enc_u(SET_GLOBAL_ENV)));
|
||||
ctx->curr_exp = val_exp;
|
||||
} else {
|
||||
error_ctx(lbm_enc_sym(SYM_EERROR));
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
static inline void eval_progn(eval_context_t *ctx) {
|
||||
lbm_value exps = lbm_cdr(ctx->curr_exp);
|
||||
lbm_value env = ctx->curr_env;
|
||||
|
||||
|
||||
if (lbm_type_of(exps) == LBM_VAL_TYPE_SYMBOL && exps == NIL) {
|
||||
ctx->r = NIL;
|
||||
ctx->app_cont = true;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (lbm_is_error(exps)) {
|
||||
error_ctx(exps);
|
||||
|
@ -920,7 +921,7 @@ static inline void eval_progn(eval_context_t *ctx) {
|
|||
}
|
||||
|
||||
static inline void eval_lambda(eval_context_t *ctx) {
|
||||
|
||||
|
||||
lbm_value env_cpy = lbm_env_copy_shallow(ctx->curr_env);
|
||||
|
||||
if (lbm_is_symbol_merror(env_cpy)) {
|
||||
|
|
|
@ -585,7 +585,6 @@ lbm_value lbm_get_next_token(lbm_tokenizer_char_stream_t *str) {
|
|||
int r = 0;
|
||||
if (sym_str[0] == '#') {
|
||||
r = lbm_add_variable_symbol(sym_str, &symbol_id);
|
||||
printf("added variable: %s as %d\n", sym_str, symbol_id - VARIABLE_SYMBOLS_START);
|
||||
} else {
|
||||
r = lbm_add_symbol(sym_str, &symbol_id);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue