diff options
author | Himbeer <himbeer@disroot.org> | 2024-09-25 19:20:04 +0200 |
---|---|---|
committer | Himbeer <himbeer@disroot.org> | 2024-09-25 19:20:04 +0200 |
commit | 91730d20c1c2befe5ccb52f63f2d4200393ae291 (patch) | |
tree | c8410e69b5ab477a200ff9f9f7731f472f8592e7 /include | |
parent | b740cc6f1e4c4ac77b4720316ef2e2854cb73a12 (diff) |
Implement expression parsing
Diffstat (limited to 'include')
-rw-r--r-- | include/expr.h | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/include/expr.h b/include/expr.h index 93b9204..8b4d8b0 100644 --- a/include/expr.h +++ b/include/expr.h @@ -4,10 +4,6 @@ #include "lex.h" #include "type.h" -struct grouping_e { - struct disjunction_e *inner; -}; - struct number_e { struct number value; struct type type; @@ -30,7 +26,7 @@ struct literal_e { enum literal kind; union { bool b; - const char *str; + char *str; struct number_e num; struct array_e arr; } lit; @@ -57,7 +53,7 @@ enum primary { struct primary_e { enum primary kind; union { - struct grouping_e grp; + struct disjunction_e *grp; struct literal_e lit; struct call_e call; struct path path; @@ -65,6 +61,7 @@ struct primary_e { }; enum unary_postfix { + UPS_NONE, UPS_DEREF, UPS_TRY, UPS_ASSERT, @@ -76,9 +73,10 @@ struct unarypost_e { }; enum unary_prefix { - UPR_NUMNEG, - UPR_BOOLNEG, - UPR_BITNEG, + UPR_NONE, + UPR_NEG, + UPR_INVERT, + UPR_BNEG, }; struct unarypre_e { @@ -142,7 +140,7 @@ enum term { struct term_e { enum term term; - struct num_e lhs, rhs; + struct num_e lhs, *rhs; }; enum comparison { @@ -165,7 +163,7 @@ struct cmp_e { struct eq_e { bool invert; - struct cmp_e lhs, rhs; + struct cmp_e lhs, *rhs; }; enum boolean { |