Fixed & bugs

git-svn-id: svn://10.0.0.236/trunk@59811 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
waldemar%netscape.com 2000-02-04 23:54:29 +00:00
parent 00f4b3f751
commit 2b6f70d530
4 changed files with 22 additions and 22 deletions

View File

@ -582,7 +582,7 @@ bool JS::Lexer::lexNumeral()
if (ch == '0') {
reader.recordChar('0');
ch = getChar();
if (ch&~0x20 == 'X') {
if ((ch&~0x20) == 'X') {
uint32 pos = reader.charPos();
char16orEOF ch2 = getChar();
if (isASCIIHexDigit(char16orEOFToChar16(ch2), digit)) {
@ -603,7 +603,7 @@ bool JS::Lexer::lexNumeral()
reader.recordChar(char16orEOFToChar16(ch));
ch = getChar();
}
if (ch&~0x20 == 'E') {
if ((ch&~0x20) == 'E') {
uint32 pos = reader.charPos();
char16orEOF ch2 = getChar();
char16 sign = 0;

View File

@ -184,9 +184,9 @@ namespace JavaScript {
NonIdGroup, // 0 May not be part of an identifier
FormatGroup, // 1 Format control
IdGroup, // 2 May start or continue a JS identifier (includes $ and _)
IdContinueGroup, // 3 May continue a JS identifier [IdContinueGroup & -2 == IdGroup]
IdContinueGroup, // 3 May continue a JS identifier [(IdContinueGroup & -2) == IdGroup]
WhiteGroup, // 4 White space character (but not line break)
LineBreakGroup // 5 Line break character [LineBreakGroup & -2 == WhiteGroup]
LineBreakGroup // 5 Line break character [(LineBreakGroup & -2) == WhiteGroup]
};
CharInfo() {}
@ -198,26 +198,26 @@ namespace JavaScript {
friend bool isAlpha(const CharInfo &ci)
{
return ((((1 << UppercaseLetter) | (1 << LowercaseLetter) | (1 << TitlecaseLetter) | (1 << ModifierLetter) | (1 << OtherLetter))
>> cType(ci)) & 1) != 0;
return ((1<<UppercaseLetter | 1<<LowercaseLetter | 1<<TitlecaseLetter | 1<<ModifierLetter | 1<<OtherLetter)
>> cType(ci) & 1) != 0;
}
friend bool isAlphanumeric(const CharInfo &ci)
{
return ((((1 << UppercaseLetter) | (1 << LowercaseLetter) | (1 << TitlecaseLetter) | (1 << ModifierLetter) | (1 << OtherLetter) |
(1 << DecimalDigitNumber) | (1 << LetterNumber))
>> cType(ci)) & 1) != 0;
return ((1<<UppercaseLetter | 1<<LowercaseLetter | 1<<TitlecaseLetter | 1<<ModifierLetter | 1<<OtherLetter |
1<<DecimalDigitNumber | 1<<LetterNumber)
>> cType(ci) & 1) != 0;
}
// Return true if this character can start a JavaScript identifier
friend bool isIdLeading(const CharInfo &ci) {return cGroup(ci) == IdGroup;}
// Return true if this character can continue a JavaScript identifier
friend bool isIdContinuing(const CharInfo &ci) {return cGroup(ci) & -2 == IdGroup;}
friend bool isIdContinuing(const CharInfo &ci) {return (cGroup(ci) & -2) == IdGroup;}
// Return true if this character is a Unicode decimal digit (Nd) character
friend bool isDecimalDigit(const CharInfo &ci) {return cType(ci) == DecimalDigitNumber;}
// Return true if this character is a Unicode white space or line break character
friend bool isSpace(const CharInfo &ci) {return cGroup(ci) & -2 == WhiteGroup;}
friend bool isSpace(const CharInfo &ci) {return (cGroup(ci) & -2) == WhiteGroup;}
// Return true if this character is a Unicode line break character (LF, CR, LS, or PS)
friend bool isLineBreak(const CharInfo &ci) {return cGroup(ci) == LineBreakGroup;}
// Return true if this character is a Unicode format control character (Cf)

View File

@ -582,7 +582,7 @@ bool JS::Lexer::lexNumeral()
if (ch == '0') {
reader.recordChar('0');
ch = getChar();
if (ch&~0x20 == 'X') {
if ((ch&~0x20) == 'X') {
uint32 pos = reader.charPos();
char16orEOF ch2 = getChar();
if (isASCIIHexDigit(char16orEOFToChar16(ch2), digit)) {
@ -603,7 +603,7 @@ bool JS::Lexer::lexNumeral()
reader.recordChar(char16orEOFToChar16(ch));
ch = getChar();
}
if (ch&~0x20 == 'E') {
if ((ch&~0x20) == 'E') {
uint32 pos = reader.charPos();
char16orEOF ch2 = getChar();
char16 sign = 0;

View File

@ -184,9 +184,9 @@ namespace JavaScript {
NonIdGroup, // 0 May not be part of an identifier
FormatGroup, // 1 Format control
IdGroup, // 2 May start or continue a JS identifier (includes $ and _)
IdContinueGroup, // 3 May continue a JS identifier [IdContinueGroup & -2 == IdGroup]
IdContinueGroup, // 3 May continue a JS identifier [(IdContinueGroup & -2) == IdGroup]
WhiteGroup, // 4 White space character (but not line break)
LineBreakGroup // 5 Line break character [LineBreakGroup & -2 == WhiteGroup]
LineBreakGroup // 5 Line break character [(LineBreakGroup & -2) == WhiteGroup]
};
CharInfo() {}
@ -198,26 +198,26 @@ namespace JavaScript {
friend bool isAlpha(const CharInfo &ci)
{
return ((((1 << UppercaseLetter) | (1 << LowercaseLetter) | (1 << TitlecaseLetter) | (1 << ModifierLetter) | (1 << OtherLetter))
>> cType(ci)) & 1) != 0;
return ((1<<UppercaseLetter | 1<<LowercaseLetter | 1<<TitlecaseLetter | 1<<ModifierLetter | 1<<OtherLetter)
>> cType(ci) & 1) != 0;
}
friend bool isAlphanumeric(const CharInfo &ci)
{
return ((((1 << UppercaseLetter) | (1 << LowercaseLetter) | (1 << TitlecaseLetter) | (1 << ModifierLetter) | (1 << OtherLetter) |
(1 << DecimalDigitNumber) | (1 << LetterNumber))
>> cType(ci)) & 1) != 0;
return ((1<<UppercaseLetter | 1<<LowercaseLetter | 1<<TitlecaseLetter | 1<<ModifierLetter | 1<<OtherLetter |
1<<DecimalDigitNumber | 1<<LetterNumber)
>> cType(ci) & 1) != 0;
}
// Return true if this character can start a JavaScript identifier
friend bool isIdLeading(const CharInfo &ci) {return cGroup(ci) == IdGroup;}
// Return true if this character can continue a JavaScript identifier
friend bool isIdContinuing(const CharInfo &ci) {return cGroup(ci) & -2 == IdGroup;}
friend bool isIdContinuing(const CharInfo &ci) {return (cGroup(ci) & -2) == IdGroup;}
// Return true if this character is a Unicode decimal digit (Nd) character
friend bool isDecimalDigit(const CharInfo &ci) {return cType(ci) == DecimalDigitNumber;}
// Return true if this character is a Unicode white space or line break character
friend bool isSpace(const CharInfo &ci) {return cGroup(ci) & -2 == WhiteGroup;}
friend bool isSpace(const CharInfo &ci) {return (cGroup(ci) & -2) == WhiteGroup;}
// Return true if this character is a Unicode line break character (LF, CR, LS, or PS)
friend bool isLineBreak(const CharInfo &ci) {return cGroup(ci) == LineBreakGroup;}
// Return true if this character is a Unicode format control character (Cf)