From f5792a03fb2cb1a9e85f08125c267fa023e599cb Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sun, 26 Jul 2015 22:58:02 -0400 Subject: [PATCH] Lexer: Captures minimumMatchLength for abbreviated attribute matching --- src/Context.cpp | 1 + src/Lexer.cpp | 4 +++- src/Lexer.h | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Context.cpp b/src/Context.cpp index fb4a4c144..9edbbc495 100644 --- a/src/Context.cpp +++ b/src/Context.cpp @@ -617,6 +617,7 @@ void Context::getLimits (int& rows, int& lines) void Context::staticInitialization () { CLI2::minimumMatchLength = config.getInteger ("abbreviation.minimum"); + Lexer::minimumMatchLength = config.getInteger ("abbreviation.minimum"); Task::defaultProject = config.get ("default.project"); Task::defaultDue = config.get ("default.due"); diff --git a/src/Lexer.cpp b/src/Lexer.cpp index a4360003e..d841b6b97 100644 --- a/src/Lexer.cpp +++ b/src/Lexer.cpp @@ -34,10 +34,12 @@ static const std::string uuid_pattern = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"; static const unsigned int uuid_min_length = 8; -std::map Lexer::attributes; std::string Lexer::dateFormat = ""; bool Lexer::isoEnabled = true; +int Lexer::minimumMatchLength = 3; +std::map Lexer::attributes; + //////////////////////////////////////////////////////////////////////////////// Lexer::Lexer (const std::string& text) diff --git a/src/Lexer.h b/src/Lexer.h index 75c2fe59b..f92582131 100644 --- a/src/Lexer.h +++ b/src/Lexer.h @@ -41,6 +41,7 @@ public: // These are overridable. static std::string dateFormat; static bool isoEnabled; + static int minimumMatchLength; static std::map attributes; enum class Type { uuid, number, hex,