iris

small scheme interpreter
git clone git://git.2f30.org/iris.git
Log | Files | Refs | LICENSE

commit 5946df9521a60a0c33754f09152e929da1d465d4
parent 73a398f3d5456712cf432a8d98f298cc8d29e0a8
Author: sin <sin@2f30.org>
Date:   Wed May 14 17:29:34 +0100

No need to export these, treat them as opaque

Diffstat:
parser.c | 44++++++++++++++++++++++++++++++++++++++++++++
parser.h | 44--------------------------------------------
2 files changed, 44 insertions(+), 44 deletions(-)
diff --git a/parser.c b/parser.c @@ -8,6 +8,50 @@ #include "sym.h" #include "util.h" +enum objtype { + OError = -2, + OEof = -1, + OIdentifier, + OBoolean, + ONumber, + OCharacter, + OString, +}; + +struct object { + enum objtype type; + union { + /* error */ + struct { + char *s; + } err; + /* eof */ + struct { + char *s; + } eof; + /* identifier */ + struct { + char *s; + } i; + /* boolean */ + struct { + bool v; + } b; + /* number */ + struct { + long v; + } n; + /* character */ + struct { + char v; + } c; + /* string */ + struct { + char *s; + } s; + } d; +}; + static struct object * newobject(void) { diff --git a/parser.h b/parser.h @@ -1,48 +1,4 @@ /* See LICENSE file for copyright and license details. */ -enum objtype { - OError = -2, - OEof = -1, - OIdentifier, - OBoolean, - ONumber, - OCharacter, - OString, -}; - -struct object { - enum objtype type; - union { - /* error */ - struct { - char *s; - } err; - /* eof */ - struct { - char *s; - } eof; - /* identifier */ - struct { - char *s; - } i; - /* boolean */ - struct { - bool v; - } b; - /* number */ - struct { - long v; - } n; - /* character */ - struct { - char v; - } c; - /* string */ - struct { - char *s; - } s; - } d; -}; - struct object *sexpression(FILE *); struct object *eval(struct object *); void print(struct object *);