From 9ab907d014387ed45376725834a6c042f60ea2ec Mon Sep 17 00:00:00 2001 From: Sage Vaillancourt Date: Mon, 4 May 2020 02:24:36 +0100 Subject: [PATCH] Got results-as-operands working --- appinfo.json | 2 +- resources/images/appicon.png | Bin 7650 -> 891 bytes src/.pebblisp.c.swp | Bin 16384 -> 24576 bytes src/.pebblisp.h.swp | Bin 12288 -> 0 bytes src/calc.c | 30 ++++++++++++++++++++++++----- src/calc.h | 4 ++-- src/pebblisp.c | 36 +++++++++++++++++++++++++++++++---- src/pebblisp.h | 7 ++++--- 8 files changed, 64 insertions(+), 15 deletions(-) delete mode 100644 src/.pebblisp.h.swp diff --git a/appinfo.json b/appinfo.json index dcfa861..15793ef 100644 --- a/appinfo.json +++ b/appinfo.json @@ -3,7 +3,7 @@ "capabilities": [ "" ], - "companyName": "Save V.", + "companyName": "Sage V.", "enableMultiJS": false, "longName": "PebbLisp", "projectType": "native", diff --git a/resources/images/appicon.png b/resources/images/appicon.png index 65e044b9ae8deba597dd9d46f000282ecc319e57..58e43c6d9cd9962449c8342794b9076e696527f2 100644 GIT binary patch delta 847 zcmV-V1F-z!JNpKZ83+ad006}4g=3R^8zq0JDAFNAbr1_aKpb4GVi78YTEVJ=dGsM9 zX-HCB90k{cgXrRG&_6(Qb#N5~K@mh8{0n?7QsTKupha3QT+T0F&iT0ay8w5t%9_QIhIk&=x-w;9&J?O=#C|ky~Af(Z9eLo<;>V1NFweD-WI+VO60|B0RPBwo` zo47ZDl6P*;+& zZSK?W`Uo^9xn45O%%V)5qU!+m7Jq*;whH58o>P>ZLobf=F#v>jfm+pZevTcdb^-*S zfor`!U#1)N%y?GscX_6aJ2*UJsF}Yx>ArfS117QXY^b-pz983U-k0y z|Ks!#$Zi4YTVVeH7%YWFU8GbZ8()Y-w$9b7k&M7zY3V0YynfK~zY`?bf|6L_rk5 z@txyPIv-|R>Xf(Xe1I3pwQ{`iq&`kq7cz3B#4?QkZh>L*ILbNvbmXE zdw17XPI5B2=giE1&di)M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ir)|XEfvw5Oia$0n zkQe^tMWo=;rRxLMQ NB@=ertext != NULL) { @@ -62,11 +62,12 @@ Result parse(struct Slice *slices) } else { // todo error on closed paren return R(parseAtom(token), rest); } + printf("parse() END\n"); } Result readSeq(struct Slice *tokens) { - // printf("readSeq()\n"); + printf("readSeq() START\n"); Object res; res.forward = NULL; res.type = TYPE_LIST; @@ -80,13 +81,16 @@ Result readSeq(struct Slice *tokens) return R(res, rest); } Result r = parse(tokens); - march->forward = malloc(sizeof(Object)); + printf("readSeq() before malloc\n"); + march->forward = malloc(sizeof(struct Object)); + printf("readSeq() after malloc\n"); *march->forward = r.obj; // char out[MAX_TOK_LEN]; // printf("stringObj: %s\n", stringObj(out, &r.obj)); tokens = r.slices; march = march->forward; } + printf("readSeq() END\n"); } Object parseAtom(struct Slice *s) @@ -111,6 +115,8 @@ Object parseAtom(struct Slice *s) Object eval(Object *obj, struct Environment *env) { + printf("eval(): "); + printObj(obj); Object o = *obj; switch(obj->type) { case TYPE_NUMBER: @@ -122,7 +128,9 @@ Object eval(Object *obj, struct Environment *env) // printf("TYPE_LIST\n"); Object first_form = *obj->forward; Object first_eval = eval(&first_form, env); - return first_eval.func(*first_form.forward, *first_form.forward->forward); + Object arg1 = eval(first_form.forward, env); + Object arg2 = eval(first_form.forward->forward, env); + return first_eval.func(arg1, arg2); } case TYPE_SYMBOL: { @@ -145,6 +153,22 @@ char* stringObj(char *dest, Object *obj) return dest; } +void printObj(Object *obj) +{ + if(obj->type == TYPE_NUMBER) { + printf("TYPE_NUMBER"); + } else if(obj->type == TYPE_LIST) { + printf("TYPE_NUMBER"); + } else if(obj->type == TYPE_SYMBOL) { + printf("TYPE_NUMBER"); + } else { + printf("TYPE_OTHER"); + } + char temp[20]; + stringObj(temp, obj); + printf(": %s\n", temp); +} + Result resultFromObjAndSlices(Object obj, struct Slice *slices) { Result r; @@ -211,6 +235,9 @@ void addFunc(const char *name, Object (*func)(Object, Object), struct Environment defaultEnv() { struct Environment e; e.strings = malloc(sizeof(char*) * MAX_ENV_ELM); + for(int i = 0; i < MAX_ENV_ELM; i++) { + e.strings[i] = NULL; + } e.objects = malloc(sizeof(Object) * MAX_ENV_ELM); addFunc("+", &add, &e); addFunc("-", &sub, &e); @@ -248,6 +275,7 @@ Object parseEval(const char *input, struct Environment *env) // printf("parseEval() parse()\n"); #endif Object parsed = parse(tokens).obj; + free(tokens); return eval(&parsed, env); } diff --git a/src/pebblisp.h b/src/pebblisp.h index da97a6c..f1891e1 100644 --- a/src/pebblisp.h +++ b/src/pebblisp.h @@ -3,9 +3,9 @@ // #define STANDALONE -#define MAX_TOK_LEN 3 -#define MAX_TOK_CNT 7 // 128 -#define MAX_ENV_ELM 3 // 50 +#define MAX_TOK_LEN 4 +#define MAX_TOK_CNT 128 // 128 +#define MAX_ENV_ELM 15 // 50 // static const char* tokenFail = "Missing ')'\n"; @@ -69,6 +69,7 @@ Object parseAtom(struct Slice *slice); void copySlice(char * dest, struct Slice *src); Object parseEval(const char *input, struct Environment *env); struct Environment defaultEnv(); +void printObj(Object *obj); Result resultFromObjAndSlices(Object obj, struct Slice *slices); Object add(Object obj1, Object obj2);