]> Nishi Git Mirror - serenade.git/commitdiff
define-var to define-variable, define-func to define-subroutine
authornishi <nishi@0f02c867-ac3d-714e-8a88-971ba1f6efcf>
Sat, 27 Apr 2024 02:19:35 +0000 (02:19 +0000)
committernishi <nishi@0f02c867-ac3d-714e-8a88-971ba1f6efcf>
Sat, 27 Apr 2024 02:19:35 +0000 (02:19 +0000)
git-svn-id: file:///raid/svn-main/nishi-serenade/trunk@69 0f02c867-ac3d-714e-8a88-971ba1f6efcf

Serenade/interpreter.c
Serenade/run.c

index 58c9a30f035540e9b91acb2d89cde8d2fbdef715..993d808494d621f991b85aba025c9f3a9777cfb0 100644 (file)
@@ -152,7 +152,7 @@ void sn_stdlib_init(struct sn_interpreter* sn) {
        sn_set_handler(sn, "/", math_handler);
        sn_set_handler(sn, "print", print_handler);
        sn_set_handler(sn, "eval", eval_handler);
-       sn_set_handler(sn, "define-var", defvar_handler);
+       sn_set_handler(sn, "define-variable", defvar_handler);
        sn_set_handler(sn, "source", source_handler);
 }
 
index d7037e41136735b75e6db63d829cce4fbb27d354..705c93fa695a0785a51f62ec5088e84d862cb9ba 100644 (file)
@@ -77,7 +77,7 @@ struct sn_generic* _sn_run(struct sn_interpreter* sn, struct sn_generic* gen) {
                                r->string = sn_strdup(SERENADE_VERSION);
                                r->string_length = strlen(r->string);
                                return r;
-                       } else if(strcmp(op->name, "define-func") == 0) {
+                       } else if(strcmp(op->name, "define-subroutine") == 0) {
                                char* name = malloc(gen->tree->args[1]->string_length + 1);
                                memcpy(name, gen->tree->args[1]->string, gen->tree->args[1]->string_length);
                                name[gen->tree->args[1]->string_length] = 0;