mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Lexer: Migrated from ISO8601d to Datetime
This commit is contained in:
parent
5450fae7c3
commit
769d4a2ebe
1 changed files with 3 additions and 2 deletions
|
@ -28,6 +28,7 @@
|
||||||
#include <Lexer.h>
|
#include <Lexer.h>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
#include <Datetime.h>
|
||||||
#include <ISO8601.h>
|
#include <ISO8601.h>
|
||||||
#include <utf8.h>
|
#include <utf8.h>
|
||||||
|
|
||||||
|
@ -553,12 +554,12 @@ bool Lexer::isString (std::string& token, Lexer::Type& type, const std::string&
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
// Lexer::Type::date
|
// Lexer::Type::date
|
||||||
// <ISO8601d>
|
// <Datetime>
|
||||||
bool Lexer::isDate (std::string& token, Lexer::Type& type)
|
bool Lexer::isDate (std::string& token, Lexer::Type& type)
|
||||||
{
|
{
|
||||||
// Try an ISO date parse.
|
// Try an ISO date parse.
|
||||||
std::size_t iso_i = 0;
|
std::size_t iso_i = 0;
|
||||||
ISO8601d iso;
|
Datetime iso;
|
||||||
if (iso.parse (_text.substr (_cursor), iso_i, Lexer::dateFormat))
|
if (iso.parse (_text.substr (_cursor), iso_i, Lexer::dateFormat))
|
||||||
{
|
{
|
||||||
type = Lexer::Type::date;
|
type = Lexer::Type::date;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue