Modified gitignore file and added the Value Type definition.
This commit is contained in:
parent
1bf170d70c
commit
0ddbe79d25
2 changed files with 19 additions and 1 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -3,3 +3,5 @@ src/parser.tab.c
|
|||
src/parser.tab.h
|
||||
sloth
|
||||
vgcore*
|
||||
.vscode
|
||||
.vscode/*
|
16
src/node.h
16
src/node.h
|
@ -34,6 +34,22 @@ struct Variable {
|
|||
double value;
|
||||
};
|
||||
|
||||
typedef union typeval {
|
||||
long num;
|
||||
double dec;
|
||||
} TypeVal;
|
||||
|
||||
struct Value {
|
||||
int type;
|
||||
TypeVal value;
|
||||
};
|
||||
|
||||
// Value functions
|
||||
int get_int(struct Value* val);
|
||||
double get_double(struct Value* val);
|
||||
void set_int(struct Value* val);
|
||||
void set_double(struct Value* val);
|
||||
|
||||
// Variable Functions
|
||||
struct Variable* make_variable(char* id, double value);
|
||||
void set_value(struct Variable* var, double value);
|
||||
|
|
Reference in a new issue