jitcraft/Scanner.cpp
changeset 22 765ab1b672a3
parent 21 af5d8e985502
child 23 8a31742781c1
     1.1 --- a/jitcraft/Scanner.cpp	Sun Jul 01 14:52:57 2012 -0700
     1.2 +++ b/jitcraft/Scanner.cpp	Sun Jul 01 16:36:39 2012 -0700
     1.3 @@ -391,15 +391,33 @@
     1.4              return TOK_PLUS;
     1.5  
     1.6            case '&':
     1.7 +            c = getChar();
     1.8 +            if (c == '=')
     1.9 +                return TOK_ASSIGN_BITAND;
    1.10 +            putChar(c);
    1.11              return TOK_BITAND;
    1.12  
    1.13            case '|':
    1.14 +            c = getChar();
    1.15 +            if (c == '=')
    1.16 +                return TOK_ASSIGN_BITOR;
    1.17 +            putChar(c);
    1.18              return TOK_BITOR;
    1.19  
    1.20            case '^':
    1.21 +            c = getChar();
    1.22 +            if (c == '=')
    1.23 +                return TOK_ASSIGN_BITXOR;
    1.24 +            putChar(c);
    1.25              return TOK_BITXOR;
    1.26  
    1.27 -          case '-': return TOK_MINUS;
    1.28 +          case '-':
    1.29 +            c = getChar();
    1.30 +            if (c == '=')
    1.31 +                return TOK_ASSIGN_SUB;
    1.32 +            putChar(c);
    1.33 +            return TOK_MINUS;
    1.34 +
    1.35            case ',': return TOK_COMMA;
    1.36            case '\0': return TOK_EOF;
    1.37  
    1.38 @@ -429,8 +447,13 @@
    1.39                  return TOK_GE;
    1.40              if (c == '>') {
    1.41                  c = getChar();
    1.42 -                if (c == '>')
    1.43 +                if (c == '>') {
    1.44 +                    c = getChar();
    1.45 +                    if (c == '=')
    1.46 +                        return TOK_ASSIGN_USHR;
    1.47 +                    putChar(c);
    1.48                      return TOK_USHR;
    1.49 +                }
    1.50                  return TOK_SHR;
    1.51              }
    1.52              putChar(c);