Changeset 18712 in webkit for trunk/JavaScriptCore/kjs/lexer.cpp


Ignore:
Timestamp:
Jan 9, 2007, 6:54:26 AM (18 years ago)
Author:
darin
Message:

JavaScriptCore:

Reviewed by Maciej.

  • wtf/unicode/icu/UnicodeIcu.h: Change parameter and return types to UChar32 and UChar. Removed unneeded type casts and added some const to functions that lacked it. Removed WTF::Unicode::memcmp. (WTF::Unicode::umemcasecmp): Renamed from strcasecmp since this doesn't work on 0-terminated strings as the str functions do.
  • wtf/unicode/qt4/UnicodeQt4.h: Ditto.
  • got rid of namespace prefixes from most uses of WTF::Unicode
  • kjs/function.cpp: (KJS::isStrWhiteSpace): (KJS::escapeStringForPrettyPrinting):
  • kjs/lexer.cpp: (KJS::Lexer::isWhiteSpace): (KJS::Lexer::isIdentStart): (KJS::Lexer::isIdentPart):
  • kjs/string_object.cpp: (KJS::StringProtoFunc::callAsFunction):

WebCore:

Reviewed by Maciej.

  • got rid of namespace prefixes from most uses of WTF::Unicode
  • updated for removal of WTF::Unicode::memcmp
  • updated for renaming of WTF::Unicode::strcasecmp to umemcasecmp.
  • unified constants for special Unicode characters in a new CharacterNames.h header
  • WebCore.xcodeproj/project.pbxproj:
  • css/cssparser.cpp: (WebCore::ParseString::lower):
  • dom/Document.cpp: (WebCore::isValidNameStart): (WebCore::isValidNamePart):
  • dom/Position.cpp: (WebCore::Position::leadingWhitespacePosition): (WebCore::Position::trailingWhitespacePosition):
  • editing/CompositeEditCommand.cpp: (WebCore::isWhitespace):
  • editing/HTMLInterchange.cpp:
  • editing/TextIterator.cpp: (WebCore::CircularSearchBuffer::CircularSearchBuffer): (WebCore::CircularSearchBuffer::append):
  • editing/htmlediting.cpp: (WebCore::stringWithRebalancedWhitespace): (WebCore::nonBreakingSpaceString):
  • editing/htmlediting.h:
  • html/HTMLFontElement.cpp: (WebCore::parseFontSizeNumber):
  • html/HTMLParser.cpp: (WebCore::HTMLParser::handleError):
  • html/HTMLSelectElement.cpp: (WebCore::stripLeadingWhiteSpace):
  • platform/Font.cpp: (WebCore::WidthIterator::advance): (WebCore::WidthIterator::normalizeVoicingMarks):
  • platform/GlyphMap.cpp: (WebCore::GlyphMap::locatePage):
  • platform/MimeTypeRegistry.h:
  • platform/StringHash.h:
  • platform/StringImpl.cpp: (WebCore::isSpace): (WebCore::StringImpl::append): (WebCore::StringImpl::insert): (WebCore::StringImpl::truncate): (WebCore::StringImpl::remove): (WebCore::parseLength): (WebCore::StringImpl::isLower): (WebCore::StringImpl::lower): (WebCore::StringImpl::upper): (WebCore::StringImpl::secure): (WebCore::StringImpl::foldCase): (WebCore::StringImpl::capitalize):t (WebCore::StringImpl::toInt): (WebCore::equalIgnoringCase): (WebCore::StringImpl::find):
  • platform/TextBoundaries.h:
  • platform/TextCodec.h:
  • platform/TextCodecLatin1.cpp:
  • platform/TextEncoding.h:
  • platform/TextEncodingRegistry.h:
  • platform/mac/PasteboardMac.mm: (WebCore::Pasteboard::writeSelection):
  • platform/mac/TextCodecMac.cpp: (WebCore::TextCodecMac::decode):
  • rendering/RenderBlock.cpp: (WebCore::RenderBlock::updateFirstLetter):
  • rendering/RenderListMarker.cpp: (WebCore::listMarkerText): (WebCore::RenderListMarker::paint):
  • rendering/RenderText.cpp: (WebCore::RenderText::widthFromCache): (WebCore::isSpaceAccordingToStyle): (WebCore::RenderText::setInternalString):
  • rendering/RenderTreeAsText.cpp: (WebCore::quoteAndEscapeNonPrintables): (WebCore::operator<<):
  • rendering/bidi.cpp: (WebCore::BidiState::BidiState): (WebCore::BidiContext::BidiContext): (WebCore::bidiNext): (WebCore::bidiFirst): (WebCore::BidiIterator::direction): (WebCore::appendRun): (WebCore::embed): (WebCore::RenderBlock::bidiReorderLine): (WebCore::RenderBlock::layoutInlineChildren): (WebCore::skipNonBreakingSpace): (WebCore::RenderBlock::findNextLineBreak):
  • rendering/break_lines.cpp: (WebCore::nextBreakablePosition):
  • rendering/break_lines.h:
  • xml/XPathParser.cpp: (WebCore::XPath::charCat):
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/lexer.cpp

    r17862 r18712  
    3232#include <wtf/unicode/Unicode.h>
    3333
    34 static bool isDecimalDigit(int);
     34using namespace WTF;
     35using namespace Unicode;
    3536
    3637// we can't specify the namespace in yacc's C output, so do it here
    3738using namespace KJS;
    38 
    39 static Lexer *currLexer = 0;
    4039
    4140#ifndef KDE_USE_FINAL
     
    5352  return Lexer::curr()->lex();
    5453}
     54
     55namespace KJS {
     56
     57static Lexer* currLexer = 0;
     58
     59static bool isDecimalDigit(int);
    5560
    5661Lexer::Lexer()
     
    566571bool Lexer::isWhiteSpace() const
    567572{
    568   return current == '\t' || current == 0x0b || current == 0x0c || WTF::Unicode::isSeparatorSpace(current);
     573  return current == '\t' || current == 0x0b || current == 0x0c || isSeparatorSpace(current);
    569574}
    570575
     
    582587bool Lexer::isIdentStart(int c)
    583588{
    584   return (WTF::Unicode::category(c) & (WTF::Unicode::Letter_Uppercase
    585         | WTF::Unicode::Letter_Lowercase
    586         | WTF::Unicode::Letter_Titlecase
    587         | WTF::Unicode::Letter_Modifier
    588         | WTF::Unicode::Letter_Other))
     589  return (category(c) & (Letter_Uppercase | Letter_Lowercase | Letter_Titlecase | Letter_Modifier | Letter_Other))
    589590    || c == '$' || c == '_';
    590591}
     
    592593bool Lexer::isIdentPart(int c)
    593594{
    594   return (WTF::Unicode::category(c) & (WTF::Unicode::Letter_Uppercase
    595         | WTF::Unicode::Letter_Lowercase
    596         | WTF::Unicode::Letter_Titlecase
    597         | WTF::Unicode::Letter_Modifier
    598         | WTF::Unicode::Letter_Other
    599         | WTF::Unicode::Mark_NonSpacing
    600         | WTF::Unicode::Mark_SpacingCombining
    601         | WTF::Unicode::Number_DecimalDigit
    602         | WTF::Unicode::Punctuation_Connector))
     595  return (category(c) & (Letter_Uppercase | Letter_Lowercase | Letter_Titlecase | Letter_Modifier | Letter_Other
     596        | Mark_NonSpacing | Mark_SpacingCombining | Number_DecimalDigit | Punctuation_Connector))
    603597    || c == '$' || c == '_';
    604598}
     
    912906  return string;
    913907}
     908
     909}
Note: See TracChangeset for help on using the changeset viewer.