From 7641a86f235193c3edcfd25c93bdc86a41873540 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sat, 3 Oct 2015 19:37:30 -0400 Subject: [PATCH] Lexer: Migrated from Date to ISO8601d --- src/Lexer.cpp | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/src/Lexer.cpp b/src/Lexer.cpp index 93a74a34a..b0e210ce2 100644 --- a/src/Lexer.cpp +++ b/src/Lexer.cpp @@ -28,7 +28,6 @@ #include #include #include -#include #include static const std::string uuid_pattern = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"; @@ -432,7 +431,7 @@ bool Lexer::isString (std::string& token, Lexer::Type& type, const std::string& //////////////////////////////////////////////////////////////////////////////// // Lexer::Type::date -// | +// bool Lexer::isDate (std::string& token, Lexer::Type& type) { // Try an ISO date parse. @@ -440,7 +439,7 @@ bool Lexer::isDate (std::string& token, Lexer::Type& type) { std::size_t iso_i = 0; ISO8601d iso; - if (iso.parse (_text.substr (_cursor), iso_i)) + if (iso.parse (_text.substr (_cursor), iso_i, Lexer::dateFormat)) { type = Lexer::Type::date; token = _text.substr (_cursor, iso_i); @@ -449,23 +448,6 @@ bool Lexer::isDate (std::string& token, Lexer::Type& type) } } - // Try a legacy rc.dateformat parse here. - if (Lexer::dateFormat != "") - { - try - { - std::size_t legacy_i = 0; - Date legacyDate (_text.substr (_cursor), legacy_i, Lexer::dateFormat, false, false); - - type = Lexer::Type::date; - token = _text.substr (_cursor, legacy_i); - _cursor += legacy_i; - return true; - } - - catch (...) { /* Never mind. */ } - } - return false; }