commit 73186a4f5e6596496612cc9154cd2ce8263d9e41
parent 3fb2c6c94ccbb7c4e11d74053a2f3cdeecffda1b
Author: Amin Mesbah <dev@aminmesbah.com>
Date: Sun, 25 Jul 2021 15:14:45 -0700
Clean up a few things
Diffstat:
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/calc.c b/calc.c
@@ -18,7 +18,7 @@ struct BufHdr {
void *cmalloc(size_t num_bytes) {
void *ptr = malloc(num_bytes);
if (!ptr) {
- fprintf(stderr, "crealloc failed\n");
+ fprintf(stderr, "cmalloc failed\n");
exit(1);
}
return ptr;
@@ -477,13 +477,13 @@ int32_t eval_expr(Expr *e) {
}
}
-// precedence climbing
+// Precedence Climbing
// op_unary = "-" | "~".
// op_mul = "*" | "/" | "%" | "<<" | ">>" | "&".
// op_add = "+" | "-" | "|" | "^".
// expr_operand = number.
-// expr_grouping = "(" expr ")"
-// expr_unary = ([op_unary] exp_unary) | exp_base.
+// expr_grouping = "(" expr ") | expr_operand."
+// expr_unary = ([op_unary] expr_unary) | expr_grouping.
// expr_mul = expr_unary {op_mul expr_unary}.
// expr_add = expr_mul {op_add expr_mul}.
// expr = expr_add.