src/sys/dotnet/fanx/serial/Tokenizer.cs
/// <summary>
/// Process hex int/long literal starting with 0x
/// </summary>
Process hex int/long literal starting with 0x
Process hex int / long literal starting with 0x
int hex()
    {
      consume(); 
      consume(); 
      int type = Token.INT_LITERAL;
      long val = hex(cur);
      if (val < 0) throw err("Expecting hex number");
      consume();
      int nibCount = 1;
      while (true)
      {
        int nib = hex(cur);
        if (nib < 0)
        {
          if (cur == '_') { consume(); continue; }
          break;
        }
        nibCount++;
        if (nibCount > 16) throw err("Hex literal too big");
        val = (val << 4) + nib;
        consume();
      }
      m_val = Long.valueOf(val);
      return type;
    }
int hex ( ) { consume ( ) ; consume ( ) ; int type = Token . INT_LITERAL ; long val = hex ( cur ) ; if ( val < 0 ) throw err ( " " ) ; consume ( ) ; int nibCount = 1 ; while ( true ) { int nib = hex ( cur ) ; if ( nib < 0 ) { if ( cur == ' ' ) { consume ( ) ; continue ; } break ; } nibCount ++ ; if ( nibCount > 16 ) throw err ( " " ) ; val = ( val << 4 ) + nib ; consume ( ) ; } m_val = Long . valueOf ( val ) ; return type ; }
Process hex int/long literal starting with 0x
Process hex int / long literal starting with 0x
// 0 // x // read first hex