mirror of
https://github.com/Noratrieb/calculator.git
synced 2026-01-15 06:05:01 +01:00
this will calculate you
This commit is contained in:
parent
9f525cd2c7
commit
033db1664d
1 changed files with 3 additions and 3 deletions
6
calc.c
6
calc.c
|
|
@ -71,7 +71,6 @@ Expr parse_factor(char *input, size_t *offset) {
|
|||
const Expr lhs_expr = parse_literal(input, offset);
|
||||
|
||||
const char op = input[*offset];
|
||||
(*offset)++;
|
||||
|
||||
ExprKind kind;
|
||||
|
||||
|
|
@ -85,10 +84,11 @@ Expr parse_factor(char *input, size_t *offset) {
|
|||
kind = DIV;
|
||||
break;
|
||||
default:
|
||||
fprintf(stderr, "Invalid operator: %c\n", op);
|
||||
exit(1);
|
||||
return lhs_expr;
|
||||
}
|
||||
|
||||
(*offset)++;
|
||||
|
||||
const Expr rhs_expr = parse_factor(input, offset);
|
||||
|
||||
Expr *lhs = malloc(sizeof(Expr));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue