forked from ground/ground
Closures in Ground
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
#ifndef INTERPRETER_H
|
||||
#define INTERPRETER_H
|
||||
#define MAX_ID_LEN 64
|
||||
|
||||
#include "types.h"
|
||||
#include "parser.h"
|
||||
@@ -14,24 +13,6 @@ typedef enum GroundDebugInstructionType {
|
||||
DUMP, INSPECT, EVAL, CONTINUE, EXIT, STEP, VIEW, HELP, UNKNOWN
|
||||
} GroundDebugInstructionType;
|
||||
|
||||
typedef struct GroundLabel {
|
||||
char id[MAX_ID_LEN];
|
||||
int lineNum;
|
||||
UT_hash_handle hh;
|
||||
} GroundLabel;
|
||||
|
||||
typedef struct GroundVariable {
|
||||
char id[MAX_ID_LEN];
|
||||
GroundValue value;
|
||||
UT_hash_handle hh;
|
||||
} GroundVariable;
|
||||
|
||||
typedef struct GroundScope {
|
||||
GroundLabel** labels;
|
||||
GroundVariable** variables;
|
||||
bool isMainScope;
|
||||
} GroundScope;
|
||||
|
||||
typedef struct GroundDebugInstruction {
|
||||
GroundDebugInstructionType type;
|
||||
char* arg;
|
||||
@@ -42,7 +23,6 @@ GroundFunction* parseFunction(GroundProgram* in, size_t errorOffset);
|
||||
GroundValue interpretGroundProgram(GroundProgram* in, GroundScope* inScope);
|
||||
GroundValue interpretGroundInstruction(GroundInstruction inst, GroundScope* scope);
|
||||
|
||||
void addVariable(GroundVariable **head, const char *id, GroundValue data);
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user