unsigned frameLocation;
bool m_capture : 1;
bool m_invert : 1;
- int inputPosition;
+ unsigned inputPosition;
- ByteTerm(UChar ch, int inputPos, unsigned frameLocation, unsigned quantityCount, QuantifierType quantityType)
+ ByteTerm(UChar ch, int inputPos, unsigned frameLocation, Checked<unsigned> quantityCount, QuantifierType quantityType)
: frameLocation(frameLocation)
, m_capture(false)
, m_invert(false)
atom.patternCharacter = ch;
atom.quantityType = quantityType;
- atom.quantityCount = quantityCount;
+ atom.quantityCount = quantityCount.unsafeGet();
inputPosition = inputPos;
}
- ByteTerm(UChar lo, UChar hi, int inputPos, unsigned frameLocation, unsigned quantityCount, QuantifierType quantityType)
+ ByteTerm(UChar lo, UChar hi, int inputPos, unsigned frameLocation, Checked<unsigned> quantityCount, QuantifierType quantityType)
: frameLocation(frameLocation)
, m_capture(false)
, m_invert(false)
atom.casedCharacter.lo = lo;
atom.casedCharacter.hi = hi;
atom.quantityType = quantityType;
- atom.quantityCount = quantityCount;
+ atom.quantityCount = quantityCount.unsafeGet();
inputPosition = inputPos;
}
return term;
}
- static ByteTerm CheckInput(unsigned count)
+ static ByteTerm CheckInput(Checked<unsigned> count)
{
ByteTerm term(TypeCheckInput);
- term.checkInputCount = count;
+ term.checkInputCount = count.unsafeGet();
return term;
}
- static ByteTerm UncheckInput(unsigned count)
+ static ByteTerm UncheckInput(Checked<unsigned> count)
{
ByteTerm term(TypeUncheckInput);
- term.checkInputCount = count;
+ term.checkInputCount = count.unsafeGet();
return term;
}
Vector<CharacterClass*> m_userCharacterClasses;
};
+JS_EXPORT_PRIVATE PassOwnPtr<BytecodePattern> byteCompile(YarrPattern&, BumpPointerAllocator*);
+JS_EXPORT_PRIVATE unsigned interpret(BytecodePattern*, const UString& input, unsigned start, unsigned* output);
+unsigned interpret(BytecodePattern*, const LChar* input, unsigned length, unsigned start, unsigned* output);
+unsigned interpret(BytecodePattern*, const UChar* input, unsigned length, unsigned start, unsigned* output);
+
} } // namespace JSC::Yarr
#endif // YarrInterpreter_h