Skip to content

Commit

Permalink
Merge pull request #15 from cesarParra/null-coal
Browse files Browse the repository at this point in the history
Null coalesce support.
  • Loading branch information
cesarParra authored Feb 17, 2024
2 parents 175db8e + ac7ddee commit 7e31c39
Show file tree
Hide file tree
Showing 16 changed files with 3,343 additions and 3,263 deletions.
2 changes: 1 addition & 1 deletion js/apex-reflection-node/__tests__/end-to-end.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ describe('Class reflection', () => {
const classBody = `
public with sharing class MyClass {
public virtual String method1() {
return '';
return null ?? '';
}
}
`;
Expand Down
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.6.0",
"version": "2.7.0",
"description": "",
"main": "index.js",
"scripts": {
Expand Down
1 change: 1 addition & 0 deletions lib/src/antlr/grammars/apex/ApexLexer.g4
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,7 @@ BITOR : '|';
CARET : '^';
MOD : '%';
MAPTO : '=>';
NULL_COALESCE : '??';
ADD_ASSIGN : '+=';
SUB_ASSIGN : '-=';
Expand Down
1 change: 1 addition & 0 deletions lib/src/antlr/grammars/apex/ApexParser.g4
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,7 @@ expression
| expression BITOR expression # bitOrExpression
| expression AND expression # logAndExpression
| expression OR expression # logOrExpression
| expression NULL_COALESCE expression # nullCoalesceExpression
| <assoc=right> expression QUESTION expression COLON expression # condExpression
| <assoc=right> expression
( ASSIGN
Expand Down
3,378 changes: 1,691 additions & 1,687 deletions lib/src/antlr/lib/apex/ApexLexer.dart

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion lib/src/antlr/lib/apex/ApexLexer.interp

Large diffs are not rendered by default.

68 changes: 35 additions & 33 deletions lib/src/antlr/lib/apex/ApexLexer.tokens
Original file line number Diff line number Diff line change
Expand Up @@ -227,26 +227,27 @@ BITOR=226
CARET=227
MOD=228
MAPTO=229
ADD_ASSIGN=230
SUB_ASSIGN=231
MUL_ASSIGN=232
DIV_ASSIGN=233
AND_ASSIGN=234
OR_ASSIGN=235
XOR_ASSIGN=236
MOD_ASSIGN=237
LSHIFT_ASSIGN=238
RSHIFT_ASSIGN=239
URSHIFT_ASSIGN=240
ATSIGN=241
UNDERSCORE=242
Identifier=243
START_GROUP_COMMENT=244
END_GROUP_COMMENT=245
DOC_COMMENT=246
WS=247
COMMENT=248
LINE_COMMENT=249
NULL_COALESCE=230
ADD_ASSIGN=231
SUB_ASSIGN=232
MUL_ASSIGN=233
DIV_ASSIGN=234
AND_ASSIGN=235
OR_ASSIGN=236
XOR_ASSIGN=237
MOD_ASSIGN=238
LSHIFT_ASSIGN=239
RSHIFT_ASSIGN=240
URSHIFT_ASSIGN=241
ATSIGN=242
UNDERSCORE=243
Identifier=244
START_GROUP_COMMENT=245
END_GROUP_COMMENT=246
DOC_COMMENT=247
WS=248
COMMENT=249
LINE_COMMENT=250
'abstract'=1
'after'=2
'before'=3
Expand Down Expand Up @@ -466,16 +467,17 @@ LINE_COMMENT=249
'^'=227
'%'=228
'=>'=229
'+='=230
'-='=231
'*='=232
'/='=233
'&='=234
'|='=235
'^='=236
'%='=237
'<<='=238
'>>='=239
'>>>='=240
'@'=241
'_'=242
'??'=230
'+='=231
'-='=232
'*='=233
'/='=234
'&='=235
'|='=236
'^='=237
'%='=238
'<<='=239
'>>='=240
'>>>='=241
'@'=242
'_'=243
Loading

0 comments on commit 7e31c39

Please sign in to comment.