ratio

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

commit c6e99cf4336785ee4f3ef6b97a9562aa6944a2c8
parent ba3c25934e3a3db84382233671ff6ff57487a267
Author: William Casarin <jb55@jb55.com>
Date:   Fri, 29 Sep 2017 23:18:36 -0700

fix parens bug

Diffstat:
Mparser.y | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/parser.y b/parser.y @@ -37,12 +37,12 @@ line: T_NEWLINE | expr T_NEWLINE { mpq_out_str(stdout, 10, $1); printf("\n"); } ; -expr: T_RATIOw { mpq_set($$, $1); } +expr: T_RATIO { mpq_set($$, $1); } | expr T_PLUS expr { mpq_add($$, $1, $3); } | expr T_MINUS expr { mpq_sub($$, $1, $3); } | expr T_MULTIPLY expr { mpq_mul($$, $1, $3); } | expr T_DIVIDE expr { mpq_div($$, $1, $3); } - | T_LEFT expr T_RIGHT { mpq_set($$, $2); } + | T_LEFT expr T_RIGHT { mpq_init($$); mpq_set($$, $2); } ; %%