From 63acd96fb5581d69f7bd87f291e426c35b578bcd Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Tue, 20 Sep 2022 18:15:24 +0100 Subject: Move hyphens to the end of groups to avoid it thinking they're ranges --- gentoobrowse-api/service/depend.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gentoobrowse-api/service/depend.cpp b/gentoobrowse-api/service/depend.cpp index 37f09e5..4cfc1b4 100644 --- a/gentoobrowse-api/service/depend.cpp +++ b/gentoobrowse-api/service/depend.cpp @@ -11,7 +11,7 @@ namespace Portage::Utils { AdHoc::Lexer::PatternPtr WhenUse_Begin( - AdHoc::LexerMatchers::regex(R"(\s*(!?[[:alnum:]-_@]+)\?\s*\(\s*)", G_REGEX_OPTIMIZE)); + AdHoc::LexerMatchers::regex(R"(\s*(!?[[:alnum:]_@-]+)\?\s*\(\s*)", G_REGEX_OPTIMIZE)); AdHoc::Lexer::PatternPtr WhenUse_End(AdHoc::LexerMatchers::regex(R"(\s*\)\s*)", G_REGEX_OPTIMIZE)); AdHoc::Lexer::PatternPtr Or_Begin(AdHoc::LexerMatchers::regex(R"(\s*\|\|\s*\(\s*)", G_REGEX_OPTIMIZE)); AdHoc::Lexer::PatternPtr Or_Group(AdHoc::LexerMatchers::regex(R"(\s*\(\s*)", G_REGEX_OPTIMIZE)); @@ -19,7 +19,7 @@ namespace Portage::Utils { AdHoc::Lexer::PatternPtr AtomSpec(AdHoc::LexerMatchers::regex( "\\s*" "([[:punct:]]+)?" // op - "([[:alnum:]-_]+)\\/" // cat + "([[:alnum:]_-]+)\\/" // cat "([^ ]+)" // package "(-([0-9][.0-9]*[[:alpha:]]?\\*?((_(alpha|beta|pre|rc|p))?[[:digit:]]*)*(-r[[:digit:]]+)?))?" // version "(:([^/ []+(\\/[^ []+)?))?" // slot -- cgit v1.2.3