Skip to content

Commit

Permalink
Merge pull request #30 from cesarParra/soql-time-literal-support
Browse files Browse the repository at this point in the history
Adds support for time literals in SOQL queries
  • Loading branch information
cesarParra authored Dec 9, 2024
2 parents 639690e + 191d26b commit 6d6bd12
Show file tree
Hide file tree
Showing 10 changed files with 3,763 additions and 3,720 deletions.
2 changes: 1 addition & 1 deletion js/apex-reflection-node/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cparra/apex-reflection",
"version": "2.16.0",
"version": "2.16.1",
"description": "",
"main": "index.js",
"scripts": {
Expand Down
3,644 changes: 1,827 additions & 1,817 deletions lib/src/antlr/grammars/apex/ApexLexer.dart

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions lib/src/antlr/grammars/apex/ApexLexer.g4
Original file line number Diff line number Diff line change
Expand Up @@ -232,9 +232,10 @@ NEXT_N_FISCAL_YEARS_N : 'next_n_fiscal_years';
LAST_N_FISCAL_YEARS_N : 'last_n_fiscal_years';
N_FISCAL_YEARS_AGO_N : 'n_fiscal_years_ago';

// SOQL Date literal
// SOQL Date and Time literals
DateLiteral: Digit Digit Digit Digit '-' Digit Digit '-' Digit Digit;
DateTimeLiteral: DateLiteral 't' Digit Digit ':' Digit Digit ':' Digit Digit ('z' | (('+' | '-') Digit+ ( ':' Digit+)? ));
TimeLiteral: Digit Digit ':' Digit Digit ':' Digit Digit ('.' Digit+ )? ('z' | (('+' | '-') Digit+ ( ':' Digit+)? ));
DateTimeLiteral: DateLiteral 't' TimeLiteral;

// SOQL Currency literal
// (NOTE: this is also a valid Identifier)
Expand Down
5 changes: 4 additions & 1 deletion lib/src/antlr/grammars/apex/ApexLexer.interp

Large diffs are not rendered by default.

285 changes: 143 additions & 142 deletions lib/src/antlr/grammars/apex/ApexLexer.tokens
Original file line number Diff line number Diff line change
Expand Up @@ -173,85 +173,86 @@ NEXT_N_FISCAL_YEARS_N=172
LAST_N_FISCAL_YEARS_N=173
N_FISCAL_YEARS_AGO_N=174
DateLiteral=175
DateTimeLiteral=176
IntegralCurrencyLiteral=177
FIND=178
EMAIL=179
NAME=180
PHONE=181
SIDEBAR=182
FIELDS=183
METADATA=184
PRICEBOOKID=185
NETWORK=186
SNIPPET=187
TARGET_LENGTH=188
DIVISION=189
RETURNING=190
LISTVIEW=191
FindLiteral=192
IntegerLiteral=193
LongLiteral=194
NumberLiteral=195
BooleanLiteral=196
StringLiteral=197
NullLiteral=198
LPAREN=199
RPAREN=200
LBRACE=201
RBRACE=202
LBRACK=203
RBRACK=204
SEMI=205
COMMA=206
DOT=207
ASSIGN=208
GT=209
LT=210
BANG=211
TILDE=212
QUESTIONDOT=213
QUESTION=214
COLON=215
EQUAL=216
TRIPLEEQUAL=217
NOTEQUAL=218
LESSANDGREATER=219
TRIPLENOTEQUAL=220
AND=221
OR=222
INC=223
DEC=224
ADD=225
SUB=226
MUL=227
DIV=228
BITAND=229
BITOR=230
CARET=231
MOD=232
MAPTO=233
NULL_COALESCE=234
ADD_ASSIGN=235
SUB_ASSIGN=236
MUL_ASSIGN=237
DIV_ASSIGN=238
AND_ASSIGN=239
OR_ASSIGN=240
XOR_ASSIGN=241
MOD_ASSIGN=242
LSHIFT_ASSIGN=243
RSHIFT_ASSIGN=244
URSHIFT_ASSIGN=245
ATSIGN=246
UNDERSCORE=247
Identifier=248
START_GROUP_COMMENT=249
END_GROUP_COMMENT=250
DOC_COMMENT=251
WS=252
COMMENT=253
LINE_COMMENT=254
TimeLiteral=176
DateTimeLiteral=177
IntegralCurrencyLiteral=178
FIND=179
EMAIL=180
NAME=181
PHONE=182
SIDEBAR=183
FIELDS=184
METADATA=185
PRICEBOOKID=186
NETWORK=187
SNIPPET=188
TARGET_LENGTH=189
DIVISION=190
RETURNING=191
LISTVIEW=192
FindLiteral=193
IntegerLiteral=194
LongLiteral=195
NumberLiteral=196
BooleanLiteral=197
StringLiteral=198
NullLiteral=199
LPAREN=200
RPAREN=201
LBRACE=202
RBRACE=203
LBRACK=204
RBRACK=205
SEMI=206
COMMA=207
DOT=208
ASSIGN=209
GT=210
LT=211
BANG=212
TILDE=213
QUESTIONDOT=214
QUESTION=215
COLON=216
EQUAL=217
TRIPLEEQUAL=218
NOTEQUAL=219
LESSANDGREATER=220
TRIPLENOTEQUAL=221
AND=222
OR=223
INC=224
DEC=225
ADD=226
SUB=227
MUL=228
DIV=229
BITAND=230
BITOR=231
CARET=232
MOD=233
MAPTO=234
NULL_COALESCE=235
ADD_ASSIGN=236
SUB_ASSIGN=237
MUL_ASSIGN=238
DIV_ASSIGN=239
AND_ASSIGN=240
OR_ASSIGN=241
XOR_ASSIGN=242
MOD_ASSIGN=243
LSHIFT_ASSIGN=244
RSHIFT_ASSIGN=245
URSHIFT_ASSIGN=246
ATSIGN=247
UNDERSCORE=248
Identifier=249
START_GROUP_COMMENT=250
END_GROUP_COMMENT=251
DOC_COMMENT=252
WS=253
COMMENT=254
LINE_COMMENT=255
'abstract'=1
'after'=2
'before'=3
Expand Down Expand Up @@ -426,66 +427,66 @@ LINE_COMMENT=254
'next_n_fiscal_years'=172
'last_n_fiscal_years'=173
'n_fiscal_years_ago'=174
'find'=178
'email'=179
'name'=180
'phone'=181
'sidebar'=182
'fields'=183
'metadata'=184
'pricebookid'=185
'network'=186
'snippet'=187
'target_length'=188
'division'=189
'returning'=190
'listview'=191
'('=199
')'=200
'{'=201
'}'=202
'['=203
']'=204
';'=205
','=206
'.'=207
'='=208
'>'=209
'<'=210
'!'=211
'~'=212
'?.'=213
'?'=214
':'=215
'=='=216
'==='=217
'!='=218
'<>'=219
'!=='=220
'&&'=221
'||'=222
'++'=223
'--'=224
'+'=225
'-'=226
'*'=227
'/'=228
'&'=229
'|'=230
'^'=231
'%'=232
'=>'=233
'??'=234
'+='=235
'-='=236
'*='=237
'/='=238
'&='=239
'|='=240
'^='=241
'%='=242
'<<='=243
'>>='=244
'>>>='=245
'@'=246
'_'=247
'find'=179
'email'=180
'name'=181
'phone'=182
'sidebar'=183
'fields'=184
'metadata'=185
'pricebookid'=186
'network'=187
'snippet'=188
'target_length'=189
'division'=190
'returning'=191
'listview'=192
'('=200
')'=201
'{'=202
'}'=203
'['=204
']'=205
';'=206
','=207
'.'=208
'='=209
'>'=210
'<'=211
'!'=212
'~'=213
'?.'=214
'?'=215
':'=216
'=='=217
'==='=218
'!='=219
'<>'=220
'!=='=221
'&&'=222
'||'=223
'++'=224
'--'=225
'+'=226
'-'=227
'*'=228
'/'=229
'&'=230
'|'=231
'^'=232
'%'=233
'=>'=234
'??'=235
'+='=236
'-='=237
'*='=238
'/='=239
'&='=240
'|='=241
'^='=242
'%='=243
'<<='=244
'>>='=245
'>>>='=246
'@'=247
'_'=248
Loading

0 comments on commit 6d6bd12

Please sign in to comment.