--- bc-1.06.orig/bc/bc.y +++ bc-1.06/bc/bc.y @@ -79,7 +79,7 @@ /* 'scale', 'ibase', 'obase', 'auto', 'read' */ %token Scale Ibase Obase Auto Read /* 'warranty', 'halt', 'last', 'continue', 'print', 'limits' */ -%token Warranty, Halt, Last, Continue, Print, Limits +%token Warranty Halt Last Continue Print Limits /* 'history' */ %token UNARY_MINUS HistoryVar @@ -203,7 +203,7 @@ { if ($4 & 2) warn ("Comparison in first for expression"); - if ($4 >= 0) + if ($4 <= 0) generate ("p"); $4 = next_label++; sprintf (genstr, "N%1d:", $4); @@ -211,7 +211,7 @@ } opt_expression ';' { - if ($7 < 0) generate ("1"); + if ($7 &16 ) generate ("1"); $7 = next_label++; sprintf (genstr, "B%1d:J%1d:", $7, break_label); generate (genstr); @@ -424,7 +424,6 @@ generate (genstr); $$ = 0; } - ; | expression AND { warn("&& operator");