summaryrefslogtreecommitdiff
path: root/ast.h
diff options
context:
space:
mode:
Diffstat (limited to 'ast.h')
-rw-r--r--ast.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/ast.h b/ast.h
index 6b7c3d5..5ae0d12 100644
--- a/ast.h
+++ b/ast.h
@@ -16,6 +16,18 @@ struct int_lit_node {
long long val;
};
+struct float_lit_node {
+ double val;
+};
+
+struct char_lit_node {
+ char val;
+};
+
+struct str_lit_node {
+ char* val;
+};
+
struct var_ref_node {
char* ident;
};
@@ -47,11 +59,17 @@ struct assign_node {
struct expr_node {
enum {
EXPR_INT_LIT,
+ EXPR_FLOAT_LIT,
+ EXPR_CHAR_LIT,
+ EXPR_STR_LIT,
EXPR_VAR_REF,
EXPR_ASSIGN,
} type;
union {
struct int_lit_node _int_lit;
+ struct float_lit_node _float_lit;
+ struct char_lit_node _char_lit;
+ struct str_lit_node _str_lit;
struct var_ref_node _var_ref;
struct assign_node _assign;
} as;