diff --git a/src/parser/ComponentClass.cpp b/src/parser/ComponentClass.cpp index d90d7db2..4570734d 100644 --- a/src/parser/ComponentClass.cpp +++ b/src/parser/ComponentClass.cpp @@ -420,7 +420,7 @@ unique_ptr 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() { } diff --git a/src/parser/ComponentClass.h b/src/parser/ComponentClass.h index 21b51202..ce3b49f3 100644 --- a/src/parser/ComponentClass.h +++ b/src/parser/ComponentClass.h @@ -245,9 +245,6 @@ public: bool isNegated() const { return m_negate; } - void setFirstChar(char c) { firstChar = c; } - char getFirstChar() const { return firstChar; } - std::vector first() const override = 0; std::vector 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 diff --git a/src/parser/Parser.rl b/src/parser/Parser.rl index 37beb765..a0378dce 100644 --- a/src/parser/Parser.rl +++ b/src/parser/Parser.rl @@ -1094,9 +1094,6 @@ unichar readUtf8CodePoint4c(const u8 *ts) { # Literal character (any - ']') => { - if (currentCls->class_empty()) { - currentCls->setFirstChar(*ts); - } currentCls->add(*ts); };