@apexdevtools/apex-parser 3.1.0 → 3.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,12 +1,20 @@
1
1
  # apex-parser - Changelog
2
2
 
3
+ ## 3.3.0 - 2023-04-30
4
+
5
+ - Update to ANTLR 4.9.1
6
+
7
+ ## 3.2.0 - 2023-01-24
8
+
9
+ - Adds user/system mode on DML and within SOQL queries
10
+
3
11
  ## 3.1.0 - 2022-11-17
4
12
 
5
- * Adds DISTANCE and GEOLOCATION literals for SOQL.
6
- * Removes support for modulus operator to match apex.
7
- * Use of `void.class` no longer causes syntax error.
8
- * Now supports newer Date literals from API 55.
13
+ - Adds DISTANCE and GEOLOCATION literals for SOQL.
14
+ - Removes support for modulus operator to match apex.
15
+ - Use of `void.class` no longer causes syntax error.
16
+ - Now supports newer Date literals from API 55.
9
17
 
10
18
  ## 3.0.0 - 2022-06-14
11
19
 
12
- * Initial github release.
20
+ - Initial github release.
package/README.md CHANGED
@@ -48,12 +48,12 @@ Maven
48
48
  <dependency>
49
49
  <groupId>io.github.apex-dev-tools</groupId>
50
50
  <artifactId>apex-parser</artifactId>
51
- <version>3.0.0</version>
51
+ <version>3.3.0</version>
52
52
  </dependency>
53
53
 
54
54
  NPM
55
55
 
56
- "@apexdevtools/apex-parser": "^3.0.0"
56
+ "@apexdevtools/apex-parser": "^3.3.0"
57
57
 
58
58
  ## Building
59
59
 
@@ -63,7 +63,7 @@ To build both distributions:
63
63
 
64
64
  ## Testing
65
65
 
66
- Unit tests are executed during the respective package builds. The system tests require both packages to be built, as the js test also spawns the jar version. They use a collection of sample projects located in the [apex-samples](https://github.com/apex-dev-tools/apex-samples) repository. Follow the README instructions in apex-samples to checkout the submodules or use `git clone --recurse-submodules <repo-url>`. To run the tests:
66
+ Unit tests are executed during the respective package builds. The system tests require both packages to be built, as the js test also spawns the jar version. They use a collection of sample projects located in the [apex-samples](https://github.com/apex-dev-tools/apex-samples) repository. Follow the README instructions in apex-samples to checkout the submodules. To run the tests:
67
67
 
68
68
  # Set SAMPLES env var to samples repo location
69
69
  export SAMPLES=<abs path to apex-samples>
@@ -73,30 +73,8 @@ Unit tests are executed during the respective package builds. The system tests r
73
73
 
74
74
  System test failures relating to the snapshots may highlight regressions. Though if an error is expected or the samples have changed, instead use `npm run test-snapshot` to update the snapshots, then commit the changes.
75
75
 
76
- ## History
77
-
78
- 3.0.0 - Move to @apexdevtools/apex-parser
79
- 2.14.0 - Change npm api to replace ANTLRInputStream with CharStream, for Unicode char positions
80
- 2.13.0 - Fixes for negative numerics & Currency literals in SOQL
81
- 2.12.0 - Replace deprecated ANTLRInputStream, DateTime & Currency literals fixes (contrib Aaron Hurst)
82
- 2.11.0 - Fix for SOQL UPDATE VIEWSTAT/TRACKING & removal of class type arguments
83
- 2.10.0 - Allow type arguments on Classes (non-standard!)
84
- 2.9.2 - Generate .d.ts files
85
- 2.9.1 - JVM build and npm dependency updates
86
- 2.9.0 - Add SOQL Fields function
87
- 2.8.0 - Apex cast priority fix, SOSL & SOQL query format fixes, Added SOQL Date functions
88
- 2.7.1 - Bugfix for 'Network' identifier
89
- 2.7.0 - Support inline SOSL queries
90
- 2.6.1 - Dependency security fixes
91
- 2.6.0 - Add SOQL parsing support
92
- 2.5.0 - Allow safe navigation operator ?.
93
- 2.4.0 - Enable Listener & Visitor use
94
- 2.3.0 - Removed modifers from enhanced for loop
95
- 2.2.1 - Dependency security fixes
96
- 2.2.0 - Parser performance improvements
97
- 2.1.0 - Supports trigger parsing and switch statement parsing syntax was corrected
98
- 1.0.0 - Initial version
76
+ The tag version of apex-samples used by builds is set in the [build file](.github/workflows/Build.yml).
99
77
 
100
78
  ## Source & Licenses
101
79
 
102
- All the source code included uses a 3-clause BSD license. The only third-party component included is the Apex Antlr4 grammar originally from [Tooling-force.com](https://github.com/neowit/tooling-force.com), although this version used is now markedly different from the original.
80
+ All the source code included uses a 3-clause BSD license. The only third-party component included is the Apex Antlr4 grammar originally from [Tooling-force.com](https://github.com/neowit/tooling-force.com), although this version used is now markedly different from the original.
@@ -59,193 +59,197 @@ export declare class ApexLexer extends Lexer {
59
59
  static readonly WITHOUT = 54;
60
60
  static readonly LIST = 55;
61
61
  static readonly MAP = 56;
62
- static readonly SELECT = 57;
63
- static readonly COUNT = 58;
64
- static readonly FROM = 59;
65
- static readonly AS = 60;
66
- static readonly USING = 61;
67
- static readonly SCOPE = 62;
68
- static readonly WHERE = 63;
69
- static readonly ORDER = 64;
70
- static readonly BY = 65;
71
- static readonly LIMIT = 66;
72
- static readonly SOQLAND = 67;
73
- static readonly SOQLOR = 68;
74
- static readonly NOT = 69;
75
- static readonly AVG = 70;
76
- static readonly COUNT_DISTINCT = 71;
77
- static readonly MIN = 72;
78
- static readonly MAX = 73;
79
- static readonly SUM = 74;
80
- static readonly TYPEOF = 75;
81
- static readonly END = 76;
82
- static readonly THEN = 77;
83
- static readonly LIKE = 78;
84
- static readonly IN = 79;
85
- static readonly INCLUDES = 80;
86
- static readonly EXCLUDES = 81;
87
- static readonly ASC = 82;
88
- static readonly DESC = 83;
89
- static readonly NULLS = 84;
90
- static readonly FIRST = 85;
91
- static readonly LAST = 86;
92
- static readonly GROUP = 87;
93
- static readonly ALL = 88;
94
- static readonly ROWS = 89;
95
- static readonly VIEW = 90;
96
- static readonly HAVING = 91;
97
- static readonly ROLLUP = 92;
98
- static readonly TOLABEL = 93;
99
- static readonly OFFSET = 94;
100
- static readonly DATA = 95;
101
- static readonly CATEGORY = 96;
102
- static readonly AT = 97;
103
- static readonly ABOVE = 98;
104
- static readonly BELOW = 99;
105
- static readonly ABOVE_OR_BELOW = 100;
106
- static readonly SECURITY_ENFORCED = 101;
107
- static readonly REFERENCE = 102;
108
- static readonly CUBE = 103;
109
- static readonly FORMAT = 104;
110
- static readonly TRACKING = 105;
111
- static readonly VIEWSTAT = 106;
112
- static readonly CUSTOM = 107;
113
- static readonly STANDARD = 108;
114
- static readonly DISTANCE = 109;
115
- static readonly GEOLOCATION = 110;
116
- static readonly CALENDAR_MONTH = 111;
117
- static readonly CALENDAR_QUARTER = 112;
118
- static readonly CALENDAR_YEAR = 113;
119
- static readonly DAY_IN_MONTH = 114;
120
- static readonly DAY_IN_WEEK = 115;
121
- static readonly DAY_IN_YEAR = 116;
122
- static readonly DAY_ONLY = 117;
123
- static readonly FISCAL_MONTH = 118;
124
- static readonly FISCAL_QUARTER = 119;
125
- static readonly FISCAL_YEAR = 120;
126
- static readonly HOUR_IN_DAY = 121;
127
- static readonly WEEK_IN_MONTH = 122;
128
- static readonly WEEK_IN_YEAR = 123;
129
- static readonly CONVERT_TIMEZONE = 124;
130
- static readonly YESTERDAY = 125;
131
- static readonly TODAY = 126;
132
- static readonly TOMORROW = 127;
133
- static readonly LAST_WEEK = 128;
134
- static readonly THIS_WEEK = 129;
135
- static readonly NEXT_WEEK = 130;
136
- static readonly LAST_MONTH = 131;
137
- static readonly THIS_MONTH = 132;
138
- static readonly NEXT_MONTH = 133;
139
- static readonly LAST_90_DAYS = 134;
140
- static readonly NEXT_90_DAYS = 135;
141
- static readonly LAST_N_DAYS_N = 136;
142
- static readonly NEXT_N_DAYS_N = 137;
143
- static readonly N_DAYS_AGO_N = 138;
144
- static readonly NEXT_N_WEEKS_N = 139;
145
- static readonly LAST_N_WEEKS_N = 140;
146
- static readonly N_WEEKS_AGO_N = 141;
147
- static readonly NEXT_N_MONTHS_N = 142;
148
- static readonly LAST_N_MONTHS_N = 143;
149
- static readonly N_MONTHS_AGO_N = 144;
150
- static readonly THIS_QUARTER = 145;
151
- static readonly LAST_QUARTER = 146;
152
- static readonly NEXT_QUARTER = 147;
153
- static readonly NEXT_N_QUARTERS_N = 148;
154
- static readonly LAST_N_QUARTERS_N = 149;
155
- static readonly N_QUARTERS_AGO_N = 150;
156
- static readonly THIS_YEAR = 151;
157
- static readonly LAST_YEAR = 152;
158
- static readonly NEXT_YEAR = 153;
159
- static readonly NEXT_N_YEARS_N = 154;
160
- static readonly LAST_N_YEARS_N = 155;
161
- static readonly N_YEARS_AGO_N = 156;
162
- static readonly THIS_FISCAL_QUARTER = 157;
163
- static readonly LAST_FISCAL_QUARTER = 158;
164
- static readonly NEXT_FISCAL_QUARTER = 159;
165
- static readonly NEXT_N_FISCAL_QUARTERS_N = 160;
166
- static readonly LAST_N_FISCAL_QUARTERS_N = 161;
167
- static readonly N_FISCAL_QUARTERS_AGO_N = 162;
168
- static readonly THIS_FISCAL_YEAR = 163;
169
- static readonly LAST_FISCAL_YEAR = 164;
170
- static readonly NEXT_FISCAL_YEAR = 165;
171
- static readonly NEXT_N_FISCAL_YEARS_N = 166;
172
- static readonly LAST_N_FISCAL_YEARS_N = 167;
173
- static readonly N_FISCAL_YEARS_AGO_N = 168;
174
- static readonly DateLiteral = 169;
175
- static readonly DateTimeLiteral = 170;
176
- static readonly IntegralCurrencyLiteral = 171;
177
- static readonly FIND = 172;
178
- static readonly EMAIL = 173;
179
- static readonly NAME = 174;
180
- static readonly PHONE = 175;
181
- static readonly SIDEBAR = 176;
182
- static readonly FIELDS = 177;
183
- static readonly METADATA = 178;
184
- static readonly PRICEBOOKID = 179;
185
- static readonly NETWORK = 180;
186
- static readonly SNIPPET = 181;
187
- static readonly TARGET_LENGTH = 182;
188
- static readonly DIVISION = 183;
189
- static readonly RETURNING = 184;
190
- static readonly LISTVIEW = 185;
191
- static readonly FindLiteral = 186;
192
- static readonly FindLiteralAlt = 187;
193
- static readonly IntegerLiteral = 188;
194
- static readonly LongLiteral = 189;
195
- static readonly NumberLiteral = 190;
196
- static readonly BooleanLiteral = 191;
197
- static readonly StringLiteral = 192;
198
- static readonly NullLiteral = 193;
199
- static readonly LPAREN = 194;
200
- static readonly RPAREN = 195;
201
- static readonly LBRACE = 196;
202
- static readonly RBRACE = 197;
203
- static readonly LBRACK = 198;
204
- static readonly RBRACK = 199;
205
- static readonly SEMI = 200;
206
- static readonly COMMA = 201;
207
- static readonly DOT = 202;
208
- static readonly ASSIGN = 203;
209
- static readonly GT = 204;
210
- static readonly LT = 205;
211
- static readonly BANG = 206;
212
- static readonly TILDE = 207;
213
- static readonly QUESTIONDOT = 208;
214
- static readonly QUESTION = 209;
215
- static readonly COLON = 210;
216
- static readonly EQUAL = 211;
217
- static readonly TRIPLEEQUAL = 212;
218
- static readonly NOTEQUAL = 213;
219
- static readonly LESSANDGREATER = 214;
220
- static readonly TRIPLENOTEQUAL = 215;
221
- static readonly AND = 216;
222
- static readonly OR = 217;
223
- static readonly INC = 218;
224
- static readonly DEC = 219;
225
- static readonly ADD = 220;
226
- static readonly SUB = 221;
227
- static readonly MUL = 222;
228
- static readonly DIV = 223;
229
- static readonly BITAND = 224;
230
- static readonly BITOR = 225;
231
- static readonly CARET = 226;
232
- static readonly MAPTO = 227;
233
- static readonly ADD_ASSIGN = 228;
234
- static readonly SUB_ASSIGN = 229;
235
- static readonly MUL_ASSIGN = 230;
236
- static readonly DIV_ASSIGN = 231;
237
- static readonly AND_ASSIGN = 232;
238
- static readonly OR_ASSIGN = 233;
239
- static readonly XOR_ASSIGN = 234;
240
- static readonly LSHIFT_ASSIGN = 235;
241
- static readonly RSHIFT_ASSIGN = 236;
242
- static readonly URSHIFT_ASSIGN = 237;
243
- static readonly ATSIGN = 238;
244
- static readonly Identifier = 239;
245
- static readonly WS = 240;
246
- static readonly DOC_COMMENT = 241;
247
- static readonly COMMENT = 242;
248
- static readonly LINE_COMMENT = 243;
62
+ static readonly SYSTEM = 57;
63
+ static readonly USER = 58;
64
+ static readonly SELECT = 59;
65
+ static readonly COUNT = 60;
66
+ static readonly FROM = 61;
67
+ static readonly AS = 62;
68
+ static readonly USING = 63;
69
+ static readonly SCOPE = 64;
70
+ static readonly WHERE = 65;
71
+ static readonly ORDER = 66;
72
+ static readonly BY = 67;
73
+ static readonly LIMIT = 68;
74
+ static readonly SOQLAND = 69;
75
+ static readonly SOQLOR = 70;
76
+ static readonly NOT = 71;
77
+ static readonly AVG = 72;
78
+ static readonly COUNT_DISTINCT = 73;
79
+ static readonly MIN = 74;
80
+ static readonly MAX = 75;
81
+ static readonly SUM = 76;
82
+ static readonly TYPEOF = 77;
83
+ static readonly END = 78;
84
+ static readonly THEN = 79;
85
+ static readonly LIKE = 80;
86
+ static readonly IN = 81;
87
+ static readonly INCLUDES = 82;
88
+ static readonly EXCLUDES = 83;
89
+ static readonly ASC = 84;
90
+ static readonly DESC = 85;
91
+ static readonly NULLS = 86;
92
+ static readonly FIRST = 87;
93
+ static readonly LAST = 88;
94
+ static readonly GROUP = 89;
95
+ static readonly ALL = 90;
96
+ static readonly ROWS = 91;
97
+ static readonly VIEW = 92;
98
+ static readonly HAVING = 93;
99
+ static readonly ROLLUP = 94;
100
+ static readonly TOLABEL = 95;
101
+ static readonly OFFSET = 96;
102
+ static readonly DATA = 97;
103
+ static readonly CATEGORY = 98;
104
+ static readonly AT = 99;
105
+ static readonly ABOVE = 100;
106
+ static readonly BELOW = 101;
107
+ static readonly ABOVE_OR_BELOW = 102;
108
+ static readonly SECURITY_ENFORCED = 103;
109
+ static readonly SYSTEM_MODE = 104;
110
+ static readonly USER_MODE = 105;
111
+ static readonly REFERENCE = 106;
112
+ static readonly CUBE = 107;
113
+ static readonly FORMAT = 108;
114
+ static readonly TRACKING = 109;
115
+ static readonly VIEWSTAT = 110;
116
+ static readonly CUSTOM = 111;
117
+ static readonly STANDARD = 112;
118
+ static readonly DISTANCE = 113;
119
+ static readonly GEOLOCATION = 114;
120
+ static readonly CALENDAR_MONTH = 115;
121
+ static readonly CALENDAR_QUARTER = 116;
122
+ static readonly CALENDAR_YEAR = 117;
123
+ static readonly DAY_IN_MONTH = 118;
124
+ static readonly DAY_IN_WEEK = 119;
125
+ static readonly DAY_IN_YEAR = 120;
126
+ static readonly DAY_ONLY = 121;
127
+ static readonly FISCAL_MONTH = 122;
128
+ static readonly FISCAL_QUARTER = 123;
129
+ static readonly FISCAL_YEAR = 124;
130
+ static readonly HOUR_IN_DAY = 125;
131
+ static readonly WEEK_IN_MONTH = 126;
132
+ static readonly WEEK_IN_YEAR = 127;
133
+ static readonly CONVERT_TIMEZONE = 128;
134
+ static readonly YESTERDAY = 129;
135
+ static readonly TODAY = 130;
136
+ static readonly TOMORROW = 131;
137
+ static readonly LAST_WEEK = 132;
138
+ static readonly THIS_WEEK = 133;
139
+ static readonly NEXT_WEEK = 134;
140
+ static readonly LAST_MONTH = 135;
141
+ static readonly THIS_MONTH = 136;
142
+ static readonly NEXT_MONTH = 137;
143
+ static readonly LAST_90_DAYS = 138;
144
+ static readonly NEXT_90_DAYS = 139;
145
+ static readonly LAST_N_DAYS_N = 140;
146
+ static readonly NEXT_N_DAYS_N = 141;
147
+ static readonly N_DAYS_AGO_N = 142;
148
+ static readonly NEXT_N_WEEKS_N = 143;
149
+ static readonly LAST_N_WEEKS_N = 144;
150
+ static readonly N_WEEKS_AGO_N = 145;
151
+ static readonly NEXT_N_MONTHS_N = 146;
152
+ static readonly LAST_N_MONTHS_N = 147;
153
+ static readonly N_MONTHS_AGO_N = 148;
154
+ static readonly THIS_QUARTER = 149;
155
+ static readonly LAST_QUARTER = 150;
156
+ static readonly NEXT_QUARTER = 151;
157
+ static readonly NEXT_N_QUARTERS_N = 152;
158
+ static readonly LAST_N_QUARTERS_N = 153;
159
+ static readonly N_QUARTERS_AGO_N = 154;
160
+ static readonly THIS_YEAR = 155;
161
+ static readonly LAST_YEAR = 156;
162
+ static readonly NEXT_YEAR = 157;
163
+ static readonly NEXT_N_YEARS_N = 158;
164
+ static readonly LAST_N_YEARS_N = 159;
165
+ static readonly N_YEARS_AGO_N = 160;
166
+ static readonly THIS_FISCAL_QUARTER = 161;
167
+ static readonly LAST_FISCAL_QUARTER = 162;
168
+ static readonly NEXT_FISCAL_QUARTER = 163;
169
+ static readonly NEXT_N_FISCAL_QUARTERS_N = 164;
170
+ static readonly LAST_N_FISCAL_QUARTERS_N = 165;
171
+ static readonly N_FISCAL_QUARTERS_AGO_N = 166;
172
+ static readonly THIS_FISCAL_YEAR = 167;
173
+ static readonly LAST_FISCAL_YEAR = 168;
174
+ static readonly NEXT_FISCAL_YEAR = 169;
175
+ static readonly NEXT_N_FISCAL_YEARS_N = 170;
176
+ static readonly LAST_N_FISCAL_YEARS_N = 171;
177
+ static readonly N_FISCAL_YEARS_AGO_N = 172;
178
+ static readonly DateLiteral = 173;
179
+ static readonly DateTimeLiteral = 174;
180
+ static readonly IntegralCurrencyLiteral = 175;
181
+ static readonly FIND = 176;
182
+ static readonly EMAIL = 177;
183
+ static readonly NAME = 178;
184
+ static readonly PHONE = 179;
185
+ static readonly SIDEBAR = 180;
186
+ static readonly FIELDS = 181;
187
+ static readonly METADATA = 182;
188
+ static readonly PRICEBOOKID = 183;
189
+ static readonly NETWORK = 184;
190
+ static readonly SNIPPET = 185;
191
+ static readonly TARGET_LENGTH = 186;
192
+ static readonly DIVISION = 187;
193
+ static readonly RETURNING = 188;
194
+ static readonly LISTVIEW = 189;
195
+ static readonly FindLiteral = 190;
196
+ static readonly FindLiteralAlt = 191;
197
+ static readonly IntegerLiteral = 192;
198
+ static readonly LongLiteral = 193;
199
+ static readonly NumberLiteral = 194;
200
+ static readonly BooleanLiteral = 195;
201
+ static readonly StringLiteral = 196;
202
+ static readonly NullLiteral = 197;
203
+ static readonly LPAREN = 198;
204
+ static readonly RPAREN = 199;
205
+ static readonly LBRACE = 200;
206
+ static readonly RBRACE = 201;
207
+ static readonly LBRACK = 202;
208
+ static readonly RBRACK = 203;
209
+ static readonly SEMI = 204;
210
+ static readonly COMMA = 205;
211
+ static readonly DOT = 206;
212
+ static readonly ASSIGN = 207;
213
+ static readonly GT = 208;
214
+ static readonly LT = 209;
215
+ static readonly BANG = 210;
216
+ static readonly TILDE = 211;
217
+ static readonly QUESTIONDOT = 212;
218
+ static readonly QUESTION = 213;
219
+ static readonly COLON = 214;
220
+ static readonly EQUAL = 215;
221
+ static readonly TRIPLEEQUAL = 216;
222
+ static readonly NOTEQUAL = 217;
223
+ static readonly LESSANDGREATER = 218;
224
+ static readonly TRIPLENOTEQUAL = 219;
225
+ static readonly AND = 220;
226
+ static readonly OR = 221;
227
+ static readonly INC = 222;
228
+ static readonly DEC = 223;
229
+ static readonly ADD = 224;
230
+ static readonly SUB = 225;
231
+ static readonly MUL = 226;
232
+ static readonly DIV = 227;
233
+ static readonly BITAND = 228;
234
+ static readonly BITOR = 229;
235
+ static readonly CARET = 230;
236
+ static readonly MAPTO = 231;
237
+ static readonly ADD_ASSIGN = 232;
238
+ static readonly SUB_ASSIGN = 233;
239
+ static readonly MUL_ASSIGN = 234;
240
+ static readonly DIV_ASSIGN = 235;
241
+ static readonly AND_ASSIGN = 236;
242
+ static readonly OR_ASSIGN = 237;
243
+ static readonly XOR_ASSIGN = 238;
244
+ static readonly LSHIFT_ASSIGN = 239;
245
+ static readonly RSHIFT_ASSIGN = 240;
246
+ static readonly URSHIFT_ASSIGN = 241;
247
+ static readonly ATSIGN = 242;
248
+ static readonly Identifier = 243;
249
+ static readonly WS = 244;
250
+ static readonly DOC_COMMENT = 245;
251
+ static readonly COMMENT = 246;
252
+ static readonly LINE_COMMENT = 247;
249
253
  static readonly WHITESPACE_CHANNEL = 2;
250
254
  static readonly COMMENT_CHANNEL = 3;
251
255
  static readonly channelNames: string[];