summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibRegex/RegexParser.cpp
diff options
context:
space:
mode:
authorTimothy Flynn <trflynn89@pm.me>2021-08-18 14:10:08 -0400
committerAndreas Kling <kling@serenityos.org>2021-08-19 23:49:25 +0200
commit5ff9596678fa7ca427baf554179a412b69c3c38f (patch)
tree0c5dc9dffba8cec97dbe453b11bb423d690d3b16 /Userland/Libraries/LibRegex/RegexParser.cpp
parentdd44a5e9488eb0758d8bf29f112d01b6837f7215 (diff)
downloadserenity-5ff9596678fa7ca427baf554179a412b69c3c38f.zip
LibRegex: Convert regex::Lexer to inherit from GenericLexer
This will allow regex::Lexer users to invoke GenericLexer consumption methods, such as GenericLexer::consume_escaped_codepoint(). This also allows for de-duplicating common methods between the lexers.
Diffstat (limited to 'Userland/Libraries/LibRegex/RegexParser.cpp')
-rw-r--r--Userland/Libraries/LibRegex/RegexParser.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/Userland/Libraries/LibRegex/RegexParser.cpp b/Userland/Libraries/LibRegex/RegexParser.cpp
index c36979a097..0e85f3a2c6 100644
--- a/Userland/Libraries/LibRegex/RegexParser.cpp
+++ b/Userland/Libraries/LibRegex/RegexParser.cpp
@@ -101,7 +101,7 @@ ALWAYS_INLINE bool Parser::try_skip(StringView str)
size_t potentially_go_back { 0 };
for (auto ch : str) {
- if (!m_parser_state.lexer.try_skip(ch)) {
+ if (!m_parser_state.lexer.consume_specific(ch)) {
m_parser_state.lexer.back(potentially_go_back);
return false;
}
@@ -129,7 +129,7 @@ ALWAYS_INLINE char Parser::skip()
ch = m_parser_state.current_token.value()[0];
} else {
m_parser_state.lexer.back(m_parser_state.current_token.value().length());
- ch = m_parser_state.lexer.skip();
+ ch = m_parser_state.lexer.consume();
}
m_parser_state.current_token = m_parser_state.lexer.next();