Permalink
Browse files

drop operator '%' from stage 0

  • Loading branch information...
1 parent 24c1ee2 commit 65668f8da0e10c5afbdab7841ac99858216f5bc8 @NotFound committed May 25, 2012
Showing with 2 additions and 29 deletions.
  1. +1 −28 winxedst0.cpp
  2. +1 −1 winxedst1.winxed
View
@@ -3511,31 +3511,6 @@ class OpDivExpr : public CommonBinOpExpr
//**********************************************************************
-class OpModExpr : public CommonBinOpExpr
-{
-public:
- OpModExpr(BlockBase &block,
- Token t, Expr *first, Expr *second) :
- CommonBinOpExpr(block, t, first, second)
- {
- }
-private:
- void emit(Emit &e, const std::string &result)
- {
- char type= lexpr->isinteger() && rexpr->isinteger() ? REGint : REGvar;
- std::string res= result.empty() ? gentemp(type) : result;
- std::string op1= gentemp(type);
- std::string op2= gentemp(type);
- lexpr->emit(e, op1);
- rexpr->emit(e, op2);
- e << op_mod(res, op1, op2);
- if (!result.empty())
- e << '\n';
- }
-};
-
-//**********************************************************************
-
class OpShiftleftExpr : public CommonBinOpExpr
{
public:
@@ -4606,15 +4581,13 @@ Expr * parseExpr_5(BlockBase &block, Tokenizer &tk)
{
Expr *subexpr= parseExpr_4(block, tk);
Token t;
- while ((t= tk.get()).isop('*') || t.isop('/') || t.isop('%'))
+ while ((t= tk.get()).isop('*') || t.isop('/'))
{
Expr *subexpr2= parseExpr_4(block, tk);
if (t.isop('*'))
subexpr= new OpMulExpr(block, t, subexpr, subexpr2);
else if (t.isop('/'))
subexpr= new OpDivExpr(block, t, subexpr, subexpr2);
- else if (t.isop('%'))
- subexpr= new OpModExpr(block, t, subexpr, subexpr2);
}
tk.unget(t);
return subexpr;
View
@@ -21,7 +21,7 @@ function isdigit(string c)
function hexdigit(string c)
{
int i = indexof("0123456789abcdef0123456789ABCDEF", c);
- if (i >= 0) i = i % 16;
+ if (i >= 16) i = i - 16;
return i;
}

0 comments on commit 65668f8

Please sign in to comment.