From 133ffd72b030d0d23ba7025b02c9029a3cdc92bf Mon Sep 17 00:00:00 2001 From: Austin Turner Date: Fri, 24 Apr 2020 07:33:20 -0700 Subject: [PATCH] updated nanoseconds regex --- src/parser/lexer.ts | 2 +- test/test-cases.ts | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/parser/lexer.ts b/src/parser/lexer.ts index a912a9c..0641bbb 100644 --- a/src/parser/lexer.ts +++ b/src/parser/lexer.ts @@ -714,7 +714,7 @@ export const Minus = createToken({ name: 'MINUS', pattern: '-', categories: [Sym export const DateTime = createToken({ name: 'DATETIME', - pattern: /[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\.[0-9]{3})?(\Z|\.[0-9]+Z|\+[0-9]{2}:[0-9]{2}|\-[0-9]{2}:[0-9]{2}|\+[0-9]{4}|\-[0-9]{4})/i, + pattern: /[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\.[0-9]+)?(\Z|\.[0-9]+Z|\+[0-9]{2}:[0-9]{2}|\-[0-9]{2}:[0-9]{2}|\+[0-9]{4}|\-[0-9]{4})/i, categories: [DateIdentifier], }); diff --git a/test/test-cases.ts b/test/test-cases.ts index 98e52f7..ff9c2a5 100644 --- a/test/test-cases.ts +++ b/test/test-cases.ts @@ -1877,12 +1877,18 @@ export const testCases: TestCase[] = [ }, { testCase: 101, - soql: 'SELECT Id FROM LoginHistory WHERE LoginTime > 2019-04-15T02:40:03.000+0000 AND LoginTime < 2020-04-15T02:40:03.000+0000', + soql: + 'SELECT Id FROM LoginHistory WHERE LoginTime > 2020-04-23T09:00:00.00000000000000000000000000000000+00:00 AND LoginTime < 2020-04-15T02:40:03.000+0000', output: { fields: [{ type: 'Field', field: 'Id' }], sObject: 'LoginHistory', where: { - left: { field: 'LoginTime', operator: '>', value: '2019-04-15T02:40:03.000+0000', literalType: 'DATETIME' }, + left: { + field: 'LoginTime', + operator: '>', + value: '2020-04-23T09:00:00.00000000000000000000000000000000+00:00', + literalType: 'DATETIME', + }, operator: 'AND', right: { left: { field: 'LoginTime', operator: '<', value: '2020-04-15T02:40:03.000+0000', literalType: 'DATETIME' } }, },