Ignore:
Timestamp:
Jan 12, 2011, 4:57:06 AM (14 years ago)
Author:
[email protected]
Message:

2011-01-12 Peter Varga <[email protected]>

Reviewed by Gavin Barraclough.

Add Yarr.h to YARR
https://bugs.webkit.org/show_bug.cgi?id=51021

Move other common constants and functions from YARR's different files
to Yarr.h.
Use Yarr.h header instead of including other YARR headers where it
is possible.

  • JavaScriptCore.gypi:
  • JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  • JavaScriptCore.xcodeproj/project.pbxproj:
  • runtime/RegExp.cpp:
  • yarr/Yarr.h: Added.
  • yarr/YarrInterpreter.cpp:
  • yarr/YarrInterpreter.h:
  • yarr/YarrJIT.cpp: (JSC::Yarr::jitCompile): (JSC::Yarr::execute):
  • yarr/YarrJIT.h:
  • yarr/YarrParser.h:
  • yarr/YarrPattern.cpp: (JSC::Yarr::YarrPattern::compile): (JSC::Yarr::YarrPattern::YarrPattern):
  • yarr/YarrPattern.h:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/yarr/YarrPattern.cpp

    r75597 r75602  
    2828#include "YarrPattern.h"
    2929
    30 #include "YarrInterpreter.h"
     30#include "Yarr.h"
     31#include "YarrParser.h"
    3132#include <wtf/Vector.h>
    3233
     
    930931};
    931932
    932 
    933 static const char* compile(const UString& patternString, YarrPattern& pattern)
     933const char* YarrPattern::compile(const UString& patternString)
    934934{
    935     YarrPatternConstructor constructor(pattern);
     935    YarrPatternConstructor constructor(*this);
    936936
    937937    if (const char* error = parse(constructor, patternString))
     
    942942    //      "Note: if the number of left parentheses is less than the number specified
    943943    //       in \#, the \# is taken as an octal escape as described in the next row."
    944     if (pattern.containsIllegalBackReference()) {
    945         unsigned numSubpatterns = pattern.m_numSubpatterns;
     944    if (containsIllegalBackReference()) {
     945        unsigned numSubpatterns = m_numSubpatterns;
    946946
    947947        constructor.reset();
     
    952952
    953953        ASSERT(!error);
    954         ASSERT(numSubpatterns == pattern.m_numSubpatterns);
     954        ASSERT(numSubpatterns == m_numSubpatterns);
    955955    }
    956956
     
    962962
    963963    return 0;
    964 };
     964}
    965965
    966966YarrPattern::YarrPattern(const UString& pattern, bool ignoreCase, bool multiline, const char** error)
     
    980980    , nonwordcharCached(0)
    981981{
    982     *error = compile(pattern, *this);
     982    *error = compile(pattern);
    983983}
    984984
Note: See TracChangeset for help on using the changeset viewer.