summaryrefslogtreecommitdiffstats
path: root/lldb/source/Utility/RegularExpression.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Utility/RegularExpression.cpp')
-rw-r--r--lldb/source/Utility/RegularExpression.cpp16
1 files changed, 0 insertions, 16 deletions
diff --git a/lldb/source/Utility/RegularExpression.cpp b/lldb/source/Utility/RegularExpression.cpp
index bfbd101622e..71fe301c451 100644
--- a/lldb/source/Utility/RegularExpression.cpp
+++ b/lldb/source/Utility/RegularExpression.cpp
@@ -12,10 +12,8 @@
#include <string>
-//----------------------------------------------------------------------
// Enable enhanced mode if it is available. This allows for things like \d for
// digit, \s for space, and many more, but it isn't available everywhere.
-//----------------------------------------------------------------------
#if defined(REG_ENHANCED)
#define DEFAULT_COMPILE_FLAGS (REG_ENHANCED | REG_EXTENDED)
#else
@@ -28,10 +26,8 @@ RegularExpression::RegularExpression() : m_re(), m_comp_err(1), m_preg() {
memset(&m_preg, 0, sizeof(m_preg));
}
-//----------------------------------------------------------------------
// Constructor that compiles "re" using "flags" and stores the resulting
// compiled regular expression into this object.
-//----------------------------------------------------------------------
RegularExpression::RegularExpression(llvm::StringRef str)
: m_re(), m_comp_err(1), m_preg() {
memset(&m_preg, 0, sizeof(m_preg));
@@ -50,15 +46,12 @@ operator=(const RegularExpression &rhs) {
return *this;
}
-//----------------------------------------------------------------------
// Destructor
//
// Any previously compiled regular expression contained in this object will be
// freed.
-//----------------------------------------------------------------------
RegularExpression::~RegularExpression() { Free(); }
-//----------------------------------------------------------------------
// Compile a regular expression using the supplied regular expression text and
// flags. The compiled regular expression lives in this object so that it can
// be readily used for regular expression matches. Execute() can be called
@@ -68,7 +61,6 @@ RegularExpression::~RegularExpression() { Free(); }
// RETURNS
// True if the regular expression compiles successfully, false
// otherwise.
-//----------------------------------------------------------------------
bool RegularExpression::Compile(llvm::StringRef str) {
Free();
@@ -79,13 +71,11 @@ bool RegularExpression::Compile(llvm::StringRef str) {
return m_comp_err == 0;
}
-//----------------------------------------------------------------------
// Execute a regular expression match using the compiled regular expression
// that is already in this object against the match string "s". If any parens
// are used for regular expression matches "match_count" should indicate the
// number of regmatch_t values that are present in "match_ptr". The regular
// expression will be executed using the "execute_flags".
-//---------------------------------------------------------------------
bool RegularExpression::Execute(llvm::StringRef str, Match *match) const {
int err = 1;
if (m_comp_err == 0) {
@@ -154,19 +144,13 @@ bool RegularExpression::Match::GetMatchSpanningIndices(
return false;
}
-//----------------------------------------------------------------------
// Returns true if the regular expression compiled and is ready for execution.
-//----------------------------------------------------------------------
bool RegularExpression::IsValid() const { return m_comp_err == 0; }
-//----------------------------------------------------------------------
// Returns the text that was used to compile the current regular expression.
-//----------------------------------------------------------------------
llvm::StringRef RegularExpression::GetText() const { return m_re; }
-//----------------------------------------------------------------------
// Free any contained compiled regular expressions.
-//----------------------------------------------------------------------
void RegularExpression::Free() {
if (m_comp_err == 0) {
m_re.clear();
OpenPOWER on IntegriCloud