Remove dead ComponentClass::{get,set}FirstChar

This commit is contained in:
Justin Viiret 2015-11-09 10:49:19 +11:00 committed by Matthew Barr
parent 9a7b912a5d
commit b1f6a539c7
3 changed files with 2 additions and 14 deletions

View File

@ -420,7 +420,7 @@ unique_ptr<ComponentClass> getLiteralComponentClass(unsigned char c,
ComponentClass::ComponentClass(const ParseMode &mode_in)
: m_negate(false), mode(mode_in), in_cand_range(false),
range_start(INVALID_UNICODE), finalized(false), firstChar('\0') {}
range_start(INVALID_UNICODE), finalized(false) {}
ComponentClass::~ComponentClass() { }

View File

@ -245,9 +245,6 @@ public:
bool isNegated() const { return m_negate; }
void setFirstChar(char c) { firstChar = c; }
char getFirstChar() const { return firstChar; }
std::vector<PositionInfo> first() const override = 0;
std::vector<PositionInfo> last() const override = 0;
bool empty() const override { return false; } /* always 1 codepoint wide */
@ -263,19 +260,13 @@ protected:
unichar range_start;
bool finalized;
/** Literal character at the start of this character class, e.g. '.' for
* the class [.abc]. Used to identify (unsupported) POSIX collating
* elements. */
char firstChar;
virtual void createRange(unichar) = 0;
// Protected copy ctor. Use clone instead.
ComponentClass(const ComponentClass &other)
: Component(other), m_negate(other.m_negate), mode(other.mode),
in_cand_range(other.in_cand_range), range_start(other.range_start),
finalized(other.finalized),
firstChar(other.firstChar) {}
finalized(other.finalized) {}
};
} // namespace ue2

View File

@ -1094,9 +1094,6 @@ unichar readUtf8CodePoint4c(const u8 *ts) {
# Literal character
(any - ']') => {
if (currentCls->class_empty()) {
currentCls->setFirstChar(*ts);
}
currentCls->add(*ts);
};