Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions antlr/BaseApexLexer.g4
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,9 @@ HAVING : 'having';
ROLLUP : 'rollup';
TOLABEL : 'tolabel';
OFFSET : 'offset';
OPTIONS : 'options';
DATASPACE : 'dataspace';
HONOR_EMPTY_STRINGS : 'honoremptystrings';
DATA : 'data';
CATEGORY : 'category';
AT : 'at';
Expand Down
19 changes: 19 additions & 0 deletions antlr/BaseApexParser.g4
Original file line number Diff line number Diff line change
Expand Up @@ -598,6 +598,7 @@ query
allRowsClause?
forClauses
(UPDATE updateList)?
setOptionsClause?
;

subQuery
Expand Down Expand Up @@ -819,6 +820,18 @@ forClauses
boundExpression
: COLON expression;

// SET OPTIONS is terminal. Literal options are for standalone SOQL, not inline Apex.
// explicitNamespace is configured through Database.QueryOptions, not a literal option.
setOptionsClause
: SET OPTIONS ({this.isStandaloneQuery()}? LPAREN queryOption (COMMA queryOption)* RPAREN
| boundExpression)
;

queryOption
: DATASPACE ASSIGN StringLiteral
| HONOR_EMPTY_STRINGS ASSIGN BooleanLiteral
;

dateFormula
: YESTERDAY
| TODAY
Expand Down Expand Up @@ -1007,6 +1020,9 @@ id
| ROLLUP
| TOLABEL
| OFFSET
| OPTIONS
| DATASPACE
| HONOR_EMPTY_STRINGS
| DATA
| CATEGORY
| AT
Expand Down Expand Up @@ -1210,6 +1226,9 @@ anyId
| ROLLUP
| TOLABEL
| OFFSET
| OPTIONS
| DATASPACE
| HONOR_EMPTY_STRINGS
| DATA
| CATEGORY
| AT
Expand Down
Loading
Loading