abl-tmlanguage 1.3.20 → 1.3.21

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,3 +1,7 @@
1
+ 1.3.21
2
+ ======
3
+ - ✨ Safe navigation operator
4
+
1
5
  1.3.20
2
6
  ======
3
7
 
package/README.md CHANGED
@@ -87,7 +87,7 @@ The ABL-specific scopes produced by the ABL grammar listed in the table below. T
87
87
  |entity.other.attribute-name.abl | Annotation attribute names |
88
88
  |keyword.control.directive.conditional.abl | `&if` , `&else`, `&elsif` `&end` |
89
89
  |keyword.control.directive.define.abl | `&scoped-define`, `&global-define`, `&undefine` |
90
- |keyword.operator.source.abl | `contains`, `begins`, `matches`, `eq`, `le`, `lt`, `ge`, `gt`, `ne`, `<=`, `<>`, `>=`, `=`, `+`, `-`, `/`, `<`, `>`, `*`, `+=`, `-=`, `/=`, `*=` |
90
+ |keyword.operator.source.abl | `contains`, `begins`, `matches`, `eq`, `le`, `lt`, `ge`, `gt`, `ne`, `<=`, `<>`, `>=`, `=`, `+`, `-`, `/`, `<`, `>`, `*`, `+=`, `-=`, `/=`, `*=`, `?:` |
91
91
  |keyword.other.abl | Any ABL keyword (incl those covered by other scopes like `support.function.abl` and `entity.name.function.abl`) |
92
92
  |punctuation.definition.bracket.square.begin.abl | `[` used for array arguments |
93
93
  |punctuation.definition.bracket.square.end.abl | `]` used for array arguments |
@@ -1439,7 +1439,7 @@
1439
1439
  },
1440
1440
  "type-argument-function": {
1441
1441
  "name": "meta.function-call.abl",
1442
- "begin": "(?i)\\s*(cast|type-of)\\s*(?=\\()",
1442
+ "begin": "\\s*([Cc][Aa][Ss][Tt]|[Tt][Yy][Pp][Ee]-[Oo][Ff])\\s*(?=\\()",
1443
1443
  "beginCaptures": {
1444
1444
  "1": {
1445
1445
  "name": "support.function.abl"
@@ -3002,15 +3002,18 @@
3002
3002
  ]
3003
3003
  },
3004
3004
  "event-un-subscribe": {
3005
- "begin": "(?i)(:)(unsubscribe|subscribe)\\s*(\\()",
3005
+ "begin": "(?i)((\\?:)|(:))(unsubscribe|subscribe)\\s*(\\()",
3006
3006
  "beginCaptures": {
3007
- "1": {
3007
+ "2": {
3008
+ "name": "keyword.operator.source.abl"
3009
+ },
3010
+ "3": {
3008
3011
  "name": "punctuation.separator.colon.abl"
3009
3012
  },
3010
- "2": {
3013
+ "4": {
3011
3014
  "name": "entity.name.function.abl"
3012
3015
  },
3013
- "3": {
3016
+ "5": {
3014
3017
  "name": "meta.brace.round.js"
3015
3018
  }
3016
3019
  },
@@ -3631,6 +3634,15 @@
3631
3634
  {
3632
3635
  "include": "#function-arguments"
3633
3636
  },
3637
+ {
3638
+ "include": "#comment"
3639
+ },
3640
+ {
3641
+ "include": "#operator"
3642
+ },
3643
+ {
3644
+ "include": "#array-literal"
3645
+ },
3634
3646
  {
3635
3647
  "include": "#constant"
3636
3648
  },
@@ -3670,15 +3682,6 @@
3670
3682
  {
3671
3683
  "include": "#expression"
3672
3684
  },
3673
- {
3674
- "include": "#comment"
3675
- },
3676
- {
3677
- "include": "#operator"
3678
- },
3679
- {
3680
- "include": "#array-literal"
3681
- },
3682
3685
  {
3683
3686
  "include": "#punctuation-comma"
3684
3687
  },
@@ -3689,7 +3692,7 @@
3689
3692
  },
3690
3693
  "static-object-property-call": {
3691
3694
  "comment": "This rule only captures dotted type name and not single class names. Type names are files, so support unicode.",
3692
- "match": "(?i)\\s*(([\\w#$%\\-]+|progress)(\\.[\\w#$%\\-]+)+)\\s*(:)([\\w\\-]+)\\s*",
3695
+ "match": "(?i)\\s*(([\\w#$%\\-]+|progress)(\\.[\\w#$%\\-]+)+)\\s*((\\?:)|(:))([\\w\\-]+)\\s*",
3693
3696
  "captures": {
3694
3697
  "1": {
3695
3698
  "name": "entity.name.type.abl"
@@ -3697,7 +3700,7 @@
3697
3700
  "4": {
3698
3701
  "name": "punctuation.separator.colon.abl"
3699
3702
  },
3700
- "5": {
3703
+ "7": {
3701
3704
  "name": "entity.name.function.abl"
3702
3705
  }
3703
3706
  }
@@ -3711,12 +3714,15 @@
3711
3714
  }
3712
3715
  },
3713
3716
  "property-call": {
3714
- "match": "(:)([a-zA-Z_][a-zA-Z0-9_#$\\-%&]*)\\b",
3717
+ "match": "((\\?:)|(:))([a-zA-Z_][a-zA-Z0-9_#$\\-%&]*)\\b",
3715
3718
  "captures": {
3716
- "1": {
3719
+ "2": {
3720
+ "name": "keyword.operator.source.abl"
3721
+ },
3722
+ "3": {
3717
3723
  "name": "punctuation.separator.colon.abl"
3718
3724
  },
3719
- "2": {
3725
+ "4": {
3720
3726
  "name": "entity.name.function.abl"
3721
3727
  }
3722
3728
  }
@@ -3736,7 +3742,7 @@
3736
3742
  },
3737
3743
  "variable-name": {
3738
3744
  "comment": "1 to 128 characters; can consist of any combination of letters (a-z or A-Z), numbers (0-9), and these special characters: #$-_%& Names must begin with a letter (from https://docs.progress.com/bundle/openedge-abl-manage-applications/page/Name-limits.html)",
3739
- "match": "(?<=^|\\s|\\[|\\(|,)([a-zA-Z_][a-zA-Z0-9_#$\\-%&]*)(?=\\.\\s|\\.$|,|:|\\s|\\)|\\]|\\[|$)",
3745
+ "match": "(?<=^|\\s|\\[|\\(|,)([a-zA-Z_][a-zA-Z0-9_#$\\-%&]*)(?=\\.\\s|\\.$|,|:|\\?:|\\s|\\)|\\]|\\[|$)",
3740
3746
  "name": "variable.other.abl"
3741
3747
  },
3742
3748
  "extent": {
@@ -4109,7 +4115,7 @@
4109
4115
  "name": "constant.language.abl"
4110
4116
  },
4111
4117
  "constant": {
4112
- "match": "(?i)(?<=^|\\b|\\s|\\()(true|false|yes|no|\\?)(?![a-zA-Z0-9_\\-#$%])",
4118
+ "match": "(?i)(?<=^|\\b|\\s|\\()(true|false|yes|no|\\?)(?![a-zA-Z0-9_\\-#$%:])",
4113
4119
  "name": "constant.language.abl"
4114
4120
  },
4115
4121
  "punctuation-colon": {
@@ -4178,7 +4184,7 @@
4178
4184
  ]
4179
4185
  },
4180
4186
  "operator-no-space": {
4181
- "match": "(\\+=|-=|\\\\=|\\*=|<=|<>|>=|=|\\+|-|/|<|>|\\*)",
4187
+ "match": "(\\+=|-=|\\\\=|\\*=|<=|<>|>=|=|<|>)",
4182
4188
  "captures": {
4183
4189
  "1": {
4184
4190
  "name": "keyword.operator.source.abl"
@@ -4186,7 +4192,7 @@
4186
4192
  }
4187
4193
  },
4188
4194
  "operator-with-space": {
4189
- "match": "(?i)(?<=\\s)(contains|begins|matches|eq|le|lt|ge|gt|ne)(?=\\s|\\()",
4195
+ "match": "(?i)(?<=\\s)(contains|begins|matches|eq|le|lt|ge|gt|ne|\\+|-|\\*|/)(?=\\s|\\()",
4190
4196
  "comment": "Lookahead and -behind for the spaces",
4191
4197
  "captures": {
4192
4198
  "1": {
@@ -4335,31 +4341,14 @@
4335
4341
  ]
4336
4342
  },
4337
4343
  "buffer-copy": {
4338
- "begin": "(?i)\\b(buffer-copy)\\s+([a-zA-Z_][a-zA-Z0-9_\\-#$%]+(\\.[a-zA-Z][a-zA-Z0-9_\\-#$%]*)?)",
4344
+ "begin": "(?i)\\s*(buffer-copy)\\s*(?!\\()",
4339
4345
  "beginCaptures": {
4340
4346
  "1": {
4341
4347
  "name": "keyword.other.abl"
4342
- },
4343
- "2": {
4344
- "name": "storage.data.table.abl"
4345
4348
  }
4346
4349
  },
4347
- "end": "(?=\\.)",
4350
+ "end": "(?=\\s*[Aa][Ss][Ss][Ii][Gg][Nn]|\\.)",
4348
4351
  "patterns": [
4349
- {
4350
- "match": "\\b([Tt][Oo])\\s+([a-zA-Z_][a-zA-Z0-9_\\-#$%]+(\\.[a-zA-Z][a-zA-Z0-9_\\-#$%]*)?)",
4351
- "captures": {
4352
- "1": {
4353
- "name": "keyword.other.abl"
4354
- },
4355
- "2": {
4356
- "name": "storage.data.table.abl"
4357
- }
4358
- }
4359
- },
4360
- {
4361
- "include": "#using-except"
4362
- },
4363
4352
  {
4364
4353
  "include": "#comment"
4365
4354
  },
@@ -4367,7 +4356,7 @@
4367
4356
  "include": "#preprocessors"
4368
4357
  },
4369
4358
  {
4370
- "match": "(?i)\\b(assign|no-lobs|no-error)\\b",
4359
+ "match": "(?i)\\s*(using|except|to|no-lobs|no-error)\\s*",
4371
4360
  "captures": {
4372
4361
  "1": {
4373
4362
  "name": "keyword.other.abl"
@@ -4378,13 +4367,10 @@
4378
4367
  "include": "#db-dot-table-dot-field"
4379
4368
  },
4380
4369
  {
4381
- "include": "#assign-statment"
4382
- },
4383
- {
4384
- "include": "#keywords"
4370
+ "include": "#db-dot-table"
4385
4371
  },
4386
4372
  {
4387
- "include": "#expression"
4373
+ "include": "#field-name"
4388
4374
  }
4389
4375
  ]
4390
4376
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "abl-tmlanguage",
3
- "version": "1.3.20",
3
+ "version": "1.3.21",
4
4
  "description": "TextMate grammar for Progress OpenEdge ABL Language",
5
5
  "main": "",
6
6
  "type": "commonjs",
@@ -150,8 +150,9 @@ describe('', () => {
150
150
  { "startIndex": 28, "endIndex": 29, "scopes": ["source.abl", "meta.preprocessor.abl", "punctuation.definition.preprocessor.abl"] }, // '&'
151
151
  { "startIndex": 29, "endIndex": 33, "scopes": ["source.abl", "meta.preprocessor.abl", "entity.name.function.preprocessor.abl"] }, // 'file'
152
152
  { "startIndex": 33, "endIndex": 34, "scopes": ["source.abl", "meta.preprocessor.abl", "punctuation.section.abl"] }, // '}'
153
- { "startIndex": 34, "endIndex": 35, "scopes": ["source.abl", "keyword.operator.source.abl"] }, // '-'
154
- { "startIndex": 35, "endIndex": 45, "scopes": ["source.abl"] }, // 'archive '
153
+ { "startIndex": 34, "endIndex": 35, "scopes": ["source.abl"] }, // '-'
154
+ { "startIndex": 35, "endIndex": 42, "scopes": ["source.abl", "storage.data.table.abl"] }, // 'archive'
155
+ { "startIndex": 42, "endIndex": 45, "scopes": ["source.abl"] }, // ' '
155
156
  { "startIndex": 45, "endIndex": 46, "scopes": ["source.abl", "punctuation.terminator.abl"] } // '.'
156
157
  ];
157
158
  shared.itShouldMatchExpectedScopes(statement, expectedTokens);
@@ -159,8 +159,7 @@ describe('', () => {
159
159
  { "startIndex": 27, "endIndex": 28, "scopes": ["source.abl", "punctuation.terminator.abl"] }, // '.'
160
160
  { "startIndex": 28, "endIndex": 33, "scopes": ["source.abl"] }, // 'name '
161
161
  { "startIndex": 33, "endIndex": 35, "scopes": ["source.abl", "keyword.operator.source.abl"] }, // '<>'
162
- { "startIndex": 35, "endIndex": 39, "scopes": ["source.abl"] }, // ' old'
163
- { "startIndex": 39, "endIndex": 40, "scopes": ["source.abl", "keyword.operator.source.abl"] }, // '-'
162
+ { "startIndex": 35, "endIndex": 40, "scopes": ["source.abl"] }, // ' old-'
164
163
  { "startIndex": 40, "endIndex": 41, "scopes": ["source.abl", "meta.preprocessor.abl", "punctuation.section.abl"] }, // '{'
165
164
  { "startIndex": 41, "endIndex": 42, "scopes": ["source.abl", "meta.preprocessor.abl", "punctuation.definition.preprocessor.abl"] }, // '&'
166
165
  { "startIndex": 42, "endIndex": 46, "scopes": ["source.abl", "meta.preprocessor.abl", "entity.name.function.preprocessor.abl"] }, // 'file'
@@ -191,8 +190,7 @@ describe('', () => {
191
190
  { "startIndex": 25, "endIndex": 26, "scopes": ["source.abl", "punctuation.terminator.abl"] }, // '.'
192
191
  { "startIndex": 26, "endIndex": 31, "scopes": ["source.abl"] }, // 'name '
193
192
  { "startIndex": 31, "endIndex": 33, "scopes": ["source.abl", "keyword.operator.source.abl"] }, // '<>'
194
- { "startIndex": 33, "endIndex": 37, "scopes": ["source.abl"] }, // ' old'
195
- { "startIndex": 37, "endIndex": 38, "scopes": ["source.abl", "keyword.operator.source.abl"] }, // '-'
193
+ { "startIndex": 33, "endIndex": 38, "scopes": ["source.abl"] }, // ' old-'
196
194
  { "startIndex": 38, "endIndex": 39, "scopes": ["source.abl", "meta.preprocessor.abl", "punctuation.section.abl"] }, // '{'
197
195
  { "startIndex": 39, "endIndex": 40, "scopes": ["source.abl", "meta.preprocessor.abl", "punctuation.definition.preprocessor.abl"] }, // '&'
198
196
  { "startIndex": 40, "endIndex": 44, "scopes": ["source.abl", "meta.preprocessor.abl", "entity.name.function.preprocessor.abl"] }, // 'file'
@@ -215,8 +213,7 @@ describe('', () => {
215
213
  { "startIndex": 7, "endIndex": 18, "scopes": ["source.abl", "storage.data.table.abl"] }, // 'buf-{&file}'
216
214
  { "startIndex": 18, "endIndex": 19, "scopes": ["source.abl"] }, // ' '
217
215
  { "startIndex": 19, "endIndex": 21, "scopes": ["source.abl", "keyword.other.abl"] }, // 'or'
218
- { "startIndex": 21, "endIndex": 25, "scopes": ["source.abl"] }, // ' buf'
219
- { "startIndex": 25, "endIndex": 26, "scopes": ["source.abl", "keyword.operator.source.abl"] }, // '-'
216
+ { "startIndex": 21, "endIndex": 26, "scopes": ["source.abl"] }, // ' buf-'
220
217
  { "startIndex": 26, "endIndex": 27, "scopes": ["source.abl", "meta.preprocessor.abl", "punctuation.section.abl"] }, // '{'
221
218
  { "startIndex": 27, "endIndex": 28, "scopes": ["source.abl", "meta.preprocessor.abl", "punctuation.definition.preprocessor.abl"] }, // '&'
222
219
  { "startIndex": 28, "endIndex": 32, "scopes": ["source.abl", "meta.preprocessor.abl", "entity.name.function.preprocessor.abl"] }, // 'file'
@@ -224,8 +221,7 @@ describe('', () => {
224
221
  { "startIndex": 33, "endIndex": 34, "scopes": ["source.abl", "punctuation.terminator.abl"] }, // '.'
225
222
  { "startIndex": 34, "endIndex": 39, "scopes": ["source.abl"] }, // 'name '
226
223
  { "startIndex": 39, "endIndex": 41, "scopes": ["source.abl", "keyword.operator.source.abl"] }, // '<>'
227
- { "startIndex": 41, "endIndex": 45, "scopes": ["source.abl"] }, // ' old'
228
- { "startIndex": 45, "endIndex": 46, "scopes": ["source.abl", "keyword.operator.source.abl"] }, // '-'
224
+ { "startIndex": 41, "endIndex": 46, "scopes": ["source.abl"] }, // ' old-'
229
225
  { "startIndex": 46, "endIndex": 47, "scopes": ["source.abl", "meta.preprocessor.abl", "punctuation.section.abl"] }, // '{'
230
226
  { "startIndex": 47, "endIndex": 48, "scopes": ["source.abl", "meta.preprocessor.abl", "punctuation.definition.preprocessor.abl"] }, // '&'
231
227
  { "startIndex": 48, "endIndex": 52, "scopes": ["source.abl", "meta.preprocessor.abl", "entity.name.function.preprocessor.abl"] }, // 'file'
@@ -378,7 +378,7 @@ describe('', () => {
378
378
  })
379
379
 
380
380
  describe('', () => {
381
- let statement = `var decimal pie = 22/3, piIsh = 3.1415927.`;
381
+ let statement = `var decimal pie = 22 / 3, piIsh = 3.1415927.`;
382
382
  let expectedTokens = [
383
383
  { "startIndex": 0, "endIndex": 3, "scopes": ["source.abl", "meta.define.abl", "keyword.other.abl"] }, // 'var'
384
384
  { "startIndex": 3, "endIndex": 4, "scopes": ["source.abl", "meta.define.abl"] }, // ' '
@@ -389,16 +389,18 @@ describe('', () => {
389
389
  { "startIndex": 16, "endIndex": 17, "scopes": ["source.abl", "keyword.operator.source.abl"] }, // '='
390
390
  { "startIndex": 17, "endIndex": 18, "scopes": ["source.abl"] }, // ' '
391
391
  { "startIndex": 18, "endIndex": 20, "scopes": ["source.abl", "constant.numeric.source.abl"] }, // '22'
392
- { "startIndex": 20, "endIndex": 21, "scopes": ["source.abl", "keyword.operator.source.abl"] }, // '/'
393
- { "startIndex": 21, "endIndex": 22, "scopes": ["source.abl", "constant.numeric.source.abl"] }, // '3'
394
- { "startIndex": 22, "endIndex": 23, "scopes": ["source.abl", "punctuation.separator.comma.abl"] }, // ','
395
- { "startIndex": 23, "endIndex": 24, "scopes": ["source.abl"] }, // ' '
396
- { "startIndex": 24, "endIndex": 29, "scopes": ["source.abl", "variable.other.abl"] }, // 'piIsh'
397
- { "startIndex": 29, "endIndex": 30, "scopes": ["source.abl"] }, // ' '
398
- { "startIndex": 30, "endIndex": 31, "scopes": ["source.abl", "keyword.operator.source.abl"] }, // '='
392
+ { "startIndex": 20, "endIndex": 21, "scopes": ["source.abl"] }, // ' '
393
+ { "startIndex": 21, "endIndex": 22, "scopes": ["source.abl", "keyword.operator.source.abl"] }, // '/'
394
+ { "startIndex": 22, "endIndex": 23, "scopes": ["source.abl"] }, // ' '
395
+ { "startIndex": 23, "endIndex": 24, "scopes": ["source.abl", "constant.numeric.source.abl"] }, // '3'
396
+ { "startIndex": 24, "endIndex": 25, "scopes": ["source.abl", "punctuation.separator.comma.abl"] }, // ','
397
+ { "startIndex": 25, "endIndex": 26, "scopes": ["source.abl"] }, // ' '
398
+ { "startIndex": 26, "endIndex": 31, "scopes": ["source.abl", "variable.other.abl"] }, // 'piIsh'
399
399
  { "startIndex": 31, "endIndex": 32, "scopes": ["source.abl"] }, // ' '
400
- { "startIndex": 32, "endIndex": 41, "scopes": ["source.abl", "constant.numeric.source.abl"] }, // '3.1415927'
401
- { "startIndex": 41, "endIndex": 42, "scopes": ["source.abl", "punctuation.terminator.abl"] } // '.'
400
+ { "startIndex": 32, "endIndex": 33, "scopes": ["source.abl", "keyword.operator.source.abl"] }, // '='
401
+ { "startIndex": 33, "endIndex": 34, "scopes": ["source.abl"] }, // ' '
402
+ { "startIndex": 34, "endIndex": 43, "scopes": ["source.abl", "constant.numeric.source.abl"] }, // '3.1415927'
403
+ { "startIndex": 43, "endIndex": 44, "scopes": ["source.abl", "punctuation.terminator.abl"] } // '.'
402
404
  ]
403
405
  shared.itShouldMatchExpectedScopes(statement, expectedTokens);
404
406
  })
@@ -0,0 +1,246 @@
1
+ const { assert, expect } = require('chai');
2
+ const shared = require('../shared.js');
3
+
4
+ describe('', () => {
5
+ let statement = `oController?:NewEventName:Subscribe(NewEventNameHandler).`;
6
+ let expectedTokens = [
7
+ { "startIndex": 0, "endIndex": 11, "scopes": ["source.abl", "variable.other.abl"] }, // 'oController'
8
+ { "startIndex": 11, "endIndex": 13, "scopes": ["source.abl", "keyword.operator.source.abl"] }, // '?:'
9
+ { "startIndex": 13, "endIndex": 25, "scopes": ["source.abl", "entity.name.function.abl"] }, // 'NewEventName'
10
+ { "startIndex": 25, "endIndex": 26, "scopes": ["source.abl", "punctuation.separator.colon.abl"] }, // ':'
11
+ { "startIndex": 26, "endIndex": 35, "scopes": ["source.abl", "entity.name.function.abl"] }, // 'Subscribe'
12
+ { "startIndex": 35, "endIndex": 36, "scopes": ["source.abl", "meta.brace.round.js"] }, // '('
13
+ { "startIndex": 36, "endIndex": 55, "scopes": ["source.abl", "entity.name.function.abl"] }, // 'NewEventNameHandler'
14
+ { "startIndex": 55, "endIndex": 56, "scopes": ["source.abl", "meta.brace.round.js"] }, // ')'
15
+ { "startIndex": 56, "endIndex": 57, "scopes": ["source.abl", "punctuation.terminator.abl"] } // '.'
16
+ ];
17
+ shared.itShouldMatchExpectedScopes(statement, expectedTokens);
18
+ })
19
+
20
+ describe('', () => {
21
+ let statement = `oController?:NewEventName?:Subscribe(NewEventNameHandler).`;
22
+ let expectedTokens = [
23
+ { "startIndex": 0, "endIndex": 11, "scopes": ["source.abl", "variable.other.abl"] }, // 'oController'
24
+ { "startIndex": 11, "endIndex": 13, "scopes": ["source.abl", "keyword.operator.source.abl"] }, // '?:'
25
+ { "startIndex": 13, "endIndex": 25, "scopes": ["source.abl", "entity.name.function.abl"] }, // 'NewEventName'
26
+ { "startIndex": 25, "endIndex": 27, "scopes": ["source.abl", "keyword.operator.source.abl"] }, // '?:'
27
+ { "startIndex": 27, "endIndex": 36, "scopes": ["source.abl", "entity.name.function.abl"] }, // 'Subscribe'
28
+ { "startIndex": 36, "endIndex": 37, "scopes": ["source.abl", "meta.brace.round.js"] }, // '('
29
+ { "startIndex": 37, "endIndex": 56, "scopes": ["source.abl", "entity.name.function.abl"] }, // 'NewEventNameHandler'
30
+ { "startIndex": 56, "endIndex": 57, "scopes": ["source.abl", "meta.brace.round.js"] }, // ')'
31
+ { "startIndex": 57, "endIndex": 58, "scopes": ["source.abl", "punctuation.terminator.abl"] } // '.'
32
+
33
+ ];
34
+ shared.itShouldMatchExpectedScopes(statement, expectedTokens);
35
+ })
36
+
37
+ describe('', () => {
38
+ let statement = `oController:NewEventName?:Subscribe(NewEventNameHandler).`;
39
+ let expectedTokens = [
40
+ { "startIndex": 0, "endIndex": 11, "scopes": ["source.abl", "variable.other.abl"] }, // 'oController'
41
+ { "startIndex": 11, "endIndex": 12, "scopes": ["source.abl", "punctuation.separator.colon.abl"] }, // ':'
42
+ { "startIndex": 12, "endIndex": 24, "scopes": ["source.abl", "entity.name.function.abl"] }, // 'NewEventName'
43
+ { "startIndex": 24, "endIndex": 26, "scopes": ["source.abl", "keyword.operator.source.abl"] }, // '?:'
44
+ { "startIndex": 26, "endIndex": 35, "scopes": ["source.abl", "entity.name.function.abl"] }, // 'Subscribe'
45
+ { "startIndex": 35, "endIndex": 36, "scopes": ["source.abl", "meta.brace.round.js"] }, // '('
46
+ { "startIndex": 36, "endIndex": 55, "scopes": ["source.abl", "entity.name.function.abl"] }, // 'NewEventNameHandler'
47
+ { "startIndex": 55, "endIndex": 56, "scopes": ["source.abl", "meta.brace.round.js"] }, // ')'
48
+ { "startIndex": 56, "endIndex": 57, "scopes": ["source.abl", "punctuation.terminator.abl"] } // '.'
49
+ ];
50
+ shared.itShouldMatchExpectedScopes(statement, expectedTokens);
51
+ })
52
+
53
+ describe('', () => {
54
+ let statement = `oController:NewEventName?:AThing(oVariable).`;
55
+ let expectedTokens = [
56
+ { "startIndex": 0, "endIndex": 11, "scopes": ["source.abl", "variable.other.abl"] }, // 'oController'
57
+ { "startIndex": 11, "endIndex": 12, "scopes": ["source.abl", "punctuation.separator.colon.abl"] }, // ':'
58
+ { "startIndex": 12, "endIndex": 24, "scopes": ["source.abl", "entity.name.function.abl"] }, // 'NewEventName'
59
+ { "startIndex": 24, "endIndex": 26, "scopes": ["source.abl", "keyword.operator.source.abl"] }, // '?:'
60
+ { "startIndex": 26, "endIndex": 32, "scopes": ["source.abl", "entity.name.function.abl"] }, // 'AThing'
61
+ { "startIndex": 32, "endIndex": 33, "scopes": ["source.abl", "meta.function.arguments.abl", "meta.brace.round.js"] }, // '('
62
+ { "startIndex": 33, "endIndex": 42, "scopes": ["source.abl", "meta.function.arguments.abl", "variable.other.abl"] }, // 'oVariable'
63
+ { "startIndex": 42, "endIndex": 43, "scopes": ["source.abl", "meta.brace.round.js"] }, // ')'
64
+ { "startIndex": 43, "endIndex": 44, "scopes": ["source.abl", "punctuation.terminator.abl"] } // '.'
65
+ ];
66
+ shared.itShouldMatchExpectedScopes(statement, expectedTokens);
67
+ })
68
+
69
+ describe('', () => {
70
+ let statement = `message this-object:NewEventName?:PropertySays.`;
71
+ let expectedTokens = [
72
+ { "startIndex": 0, "endIndex": 7, "scopes": ["source.abl", "keyword.other.abl"] }, // 'message'
73
+ { "startIndex": 7, "endIndex": 8, "scopes": ["source.abl"] }, // ' '
74
+ { "startIndex": 8, "endIndex": 19, "scopes": ["source.abl", "variable.language.abl"] }, // 'this-object'
75
+ { "startIndex": 19, "endIndex": 20, "scopes": ["source.abl", "punctuation.separator.colon.abl"] }, // ':'
76
+ { "startIndex": 20, "endIndex": 32, "scopes": ["source.abl", "entity.name.function.abl"] }, // 'NewEventName'
77
+ { "startIndex": 32, "endIndex": 34, "scopes": ["source.abl", "keyword.operator.source.abl"] }, // '?:'
78
+ { "startIndex": 34, "endIndex": 46, "scopes": ["source.abl", "entity.name.function.abl"] }, // 'PropertySays'
79
+ { "startIndex": 46, "endIndex": 47, "scopes": ["source.abl", "punctuation.terminator.abl"] } // '.'
80
+ ];
81
+ shared.itShouldMatchExpectedScopes(statement, expectedTokens);
82
+ })
83
+
84
+ describe('', () => {
85
+ let statement = `assign this-object:NewEventName?:PropertySays = "Some value".`;
86
+ let expectedTokens = [
87
+ { "startIndex": 0, "endIndex": 6, "scopes": ["source.abl", "keyword.other.abl"] }, // 'assign'
88
+ { "startIndex": 6, "endIndex": 7, "scopes": ["source.abl"] }, // ' '
89
+ { "startIndex": 7, "endIndex": 18, "scopes": ["source.abl", "variable.language.abl"] }, // 'this-object'
90
+ { "startIndex": 18, "endIndex": 19, "scopes": ["source.abl", "punctuation.separator.colon.abl"] }, // ':'
91
+ { "startIndex": 19, "endIndex": 31, "scopes": ["source.abl", "entity.name.function.abl"] }, // 'NewEventName'
92
+ { "startIndex": 31, "endIndex": 33, "scopes": ["source.abl", "keyword.operator.source.abl"] }, // '?:'
93
+ { "startIndex": 33, "endIndex": 45, "scopes": ["source.abl", "entity.name.function.abl"] }, // 'PropertySays'
94
+ { "startIndex": 45, "endIndex": 46, "scopes": ["source.abl"] }, // ' '
95
+ { "startIndex": 46, "endIndex": 47, "scopes": ["source.abl", "keyword.operator.source.abl"] }, // '='
96
+ { "startIndex": 47, "endIndex": 48, "scopes": ["source.abl"] }, // ' '
97
+ { "startIndex": 48, "endIndex": 49, "scopes": ["source.abl", "string.quoted.double.abl", "punctuation.definition.string.begin.abl"] }, // '"'
98
+ { "startIndex": 49, "endIndex": 59, "scopes": ["source.abl", "string.quoted.double.abl"] }, // 'Some value'
99
+ { "startIndex": 59, "endIndex": 60, "scopes": ["source.abl", "string.quoted.double.abl", "punctuation.definition.string.end.abl"] }, // '"'
100
+ { "startIndex": 60, "endIndex": 61, "scopes": ["source.abl", "punctuation.terminator.abl"] } // '.'
101
+ ];
102
+ shared.itShouldMatchExpectedScopes(statement, expectedTokens);
103
+ })
104
+
105
+ describe('technically impossible but will pass the compiler', () => {
106
+ let statement = `message this-object?:NewEventName?:PropertySays.`;
107
+ let expectedTokens = [
108
+ { "startIndex": 0, "endIndex": 7, "scopes": ["source.abl", "keyword.other.abl"] }, // 'message'
109
+ { "startIndex": 7, "endIndex": 8, "scopes": ["source.abl"] }, // ' '
110
+ { "startIndex": 8, "endIndex": 19, "scopes": ["source.abl", "variable.language.abl"] }, // 'this-object'
111
+ { "startIndex": 19, "endIndex": 21, "scopes": ["source.abl", "keyword.operator.source.abl"] }, // '?:'
112
+ { "startIndex": 21, "endIndex": 33, "scopes": ["source.abl", "entity.name.function.abl"] }, // 'NewEventName'
113
+ { "startIndex": 33, "endIndex": 35, "scopes": ["source.abl", "keyword.operator.source.abl"] }, // '?:'
114
+ { "startIndex": 35, "endIndex": 47, "scopes": ["source.abl", "entity.name.function.abl"] }, // 'PropertySays'
115
+ { "startIndex": 47, "endIndex": 48, "scopes": ["source.abl", "punctuation.terminator.abl"] } // '.'
116
+ ];
117
+ shared.itShouldMatchExpectedScopes(statement, expectedTokens);
118
+ })
119
+
120
+ describe('', () => {
121
+ let statement = `message session:current-request-info?:AdapterType:ToString()`;
122
+ let expectedTokens = [
123
+ { "startIndex": 0, "endIndex": 7, "scopes": ["source.abl", "keyword.other.abl"] }, // 'message'
124
+ { "startIndex": 7, "endIndex": 8, "scopes": ["source.abl"] }, // ' '
125
+ { "startIndex": 8, "endIndex": 15, "scopes": ["source.abl", "variable.language.abl"] }, // 'session'
126
+ { "startIndex": 15, "endIndex": 16, "scopes": ["source.abl", "punctuation.separator.colon.abl"] }, // ':'
127
+ { "startIndex": 16, "endIndex": 36, "scopes": ["source.abl", "entity.name.function.abl"] }, // 'current-request-info'
128
+ { "startIndex": 36, "endIndex": 38, "scopes": ["source.abl", "keyword.operator.source.abl"] }, // '?:'
129
+ { "startIndex": 38, "endIndex": 49, "scopes": ["source.abl", "entity.name.function.abl"] }, // 'AdapterType'
130
+ { "startIndex": 49, "endIndex": 50, "scopes": ["source.abl", "punctuation.separator.colon.abl"] }, // ':'
131
+ { "startIndex": 50, "endIndex": 58, "scopes": ["source.abl", "entity.name.function.abl"] }, // 'ToString'
132
+ { "startIndex": 58, "endIndex": 59, "scopes": ["source.abl", "meta.function.arguments.abl", "meta.brace.round.js"] }, // '('
133
+ { "startIndex": 59, "endIndex": 60, "scopes": ["source.abl", "meta.brace.round.js"] } // ')'
134
+ ];
135
+ shared.itShouldMatchExpectedScopes(statement, expectedTokens);
136
+ })
137
+
138
+ describe('', () => {
139
+ let statement = `message session?:current-request-info?:AdapterType:ToString()`;
140
+ let expectedTokens = [
141
+ { "startIndex": 0, "endIndex": 7, "scopes": ["source.abl", "keyword.other.abl"] }, // 'message'
142
+ { "startIndex": 7, "endIndex": 8, "scopes": ["source.abl"] }, // ' '
143
+ { "startIndex": 8, "endIndex": 15, "scopes": ["source.abl", "variable.language.abl"] }, // 'session'
144
+ { "startIndex": 15, "endIndex": 17, "scopes": ["source.abl", "keyword.operator.source.abl"] }, // '?:'
145
+ { "startIndex": 17, "endIndex": 37, "scopes": ["source.abl", "entity.name.function.abl"] }, // 'current-request-info'
146
+ { "startIndex": 37, "endIndex": 39, "scopes": ["source.abl", "keyword.operator.source.abl"] }, // '?:'
147
+ { "startIndex": 39, "endIndex": 50, "scopes": ["source.abl", "entity.name.function.abl"] }, // 'AdapterType'
148
+ { "startIndex": 50, "endIndex": 51, "scopes": ["source.abl", "punctuation.separator.colon.abl"] }, // ':'
149
+ { "startIndex": 51, "endIndex": 59, "scopes": ["source.abl", "entity.name.function.abl"] }, // 'ToString'
150
+ { "startIndex": 59, "endIndex": 60, "scopes": ["source.abl", "meta.function.arguments.abl", "meta.brace.round.js"] }, // '('
151
+ { "startIndex": 60, "endIndex": 61, "scopes": ["source.abl", "meta.brace.round.js"] } // ')'
152
+ ];
153
+ shared.itShouldMatchExpectedScopes(statement, expectedTokens);
154
+ })
155
+
156
+ describe('', () => {
157
+ let statement = `a[x]?:aMethod():aField // Evaluates to null if a[x] == null`;
158
+ let expectedTokens = [
159
+ { "startIndex": 0, "endIndex": 1, "scopes": ["source.abl", "variable.other.abl"] }, // 'a'
160
+ { "startIndex": 1, "endIndex": 2, "scopes": ["source.abl", "meta.array.literal.abl", "punctuation.definition.bracket.square.begin.abl"] }, // '['
161
+ { "startIndex": 2, "endIndex": 3, "scopes": ["source.abl", "meta.array.literal.abl", "variable.other.abl"] }, // 'x'
162
+ { "startIndex": 3, "endIndex": 4, "scopes": ["source.abl", "meta.array.literal.abl", "punctuation.definition.bracket.square.end.abl"] }, // ']'
163
+ { "startIndex": 4, "endIndex": 6, "scopes": ["source.abl", "keyword.operator.source.abl"] }, // '?:'
164
+ { "startIndex": 6, "endIndex": 13, "scopes": ["source.abl", "entity.name.function.abl"] }, // 'aMethod'
165
+ { "startIndex": 13, "endIndex": 14, "scopes": ["source.abl", "meta.function.arguments.abl", "meta.brace.round.js"] }, // '('
166
+ { "startIndex": 14, "endIndex": 15, "scopes": ["source.abl", "meta.brace.round.js"] }, // ')'
167
+ { "startIndex": 15, "endIndex": 16, "scopes": ["source.abl", "punctuation.separator.colon.abl"] }, // ':'
168
+ { "startIndex": 16, "endIndex": 22, "scopes": ["source.abl", "entity.name.function.abl"] }, // 'aField'
169
+ { "startIndex": 22, "endIndex": 23, "scopes": ["source.abl"] }, // ' '
170
+ { "startIndex": 23, "endIndex": 59, "scopes": ["source.abl", "comment.line.double-slash.abl"] } // '// Evaluates to null if a[x] == null'
171
+ ];
172
+ shared.itShouldMatchExpectedScopes(statement, expectedTokens);
173
+ })
174
+
175
+ describe('', () => {
176
+ let statement = `a[x]:aMethod()?:aField`;
177
+ let expectedTokens = [
178
+ { "startIndex": 0, "endIndex": 1, "scopes": ["source.abl", "variable.other.abl"] }, // 'a'
179
+ { "startIndex": 1, "endIndex": 2, "scopes": ["source.abl", "meta.array.literal.abl", "punctuation.definition.bracket.square.begin.abl"] }, // '['
180
+ { "startIndex": 2, "endIndex": 3, "scopes": ["source.abl", "meta.array.literal.abl", "variable.other.abl"] }, // 'x'
181
+ { "startIndex": 3, "endIndex": 4, "scopes": ["source.abl", "meta.array.literal.abl", "punctuation.definition.bracket.square.end.abl"] }, // ']'
182
+ { "startIndex": 4, "endIndex": 5, "scopes": ["source.abl", "punctuation.separator.colon.abl"] }, // ':'
183
+ { "startIndex": 5, "endIndex": 12, "scopes": ["source.abl", "entity.name.function.abl"] }, // 'aMethod'
184
+ { "startIndex": 12, "endIndex": 13, "scopes": ["source.abl", "meta.function.arguments.abl", "meta.brace.round.js"] }, // '('
185
+ { "startIndex": 13, "endIndex": 14, "scopes": ["source.abl", "meta.brace.round.js"] }, // ')'
186
+ { "startIndex": 14, "endIndex": 16, "scopes": ["source.abl", "keyword.operator.source.abl"] }, // '?:'
187
+ { "startIndex": 16, "endIndex": 22, "scopes": ["source.abl", "entity.name.function.abl"] } // 'aField'
188
+ ];
189
+ shared.itShouldMatchExpectedScopes(statement, expectedTokens);
190
+ })
191
+
192
+ describe('', () => {
193
+ let statement = `CAST(obj?:prop, My.Type)`;
194
+ let expectedTokens = [
195
+ { "startIndex": 0, "endIndex": 4, "scopes": ["source.abl", "meta.function-call.abl", "support.function.abl"] }, // 'CAST'
196
+ { "startIndex": 4, "endIndex": 5, "scopes": ["source.abl", "meta.function-call.abl", "meta.brace.round.js"] }, // '('
197
+ { "startIndex": 5, "endIndex": 8, "scopes": ["source.abl", "meta.function-call.abl", "variable.other.abl"] }, // 'obj'
198
+ { "startIndex": 8, "endIndex": 10, "scopes": ["source.abl", "meta.function-call.abl", "keyword.operator.source.abl"] }, // '?:'
199
+ { "startIndex": 10, "endIndex": 14, "scopes": ["source.abl", "meta.function-call.abl", "entity.name.function.abl"] }, // 'prop'
200
+ { "startIndex": 14, "endIndex": 15, "scopes": ["source.abl", "meta.function-call.abl", "punctuation.separator.comma.abl"] }, // ','
201
+ { "startIndex": 15, "endIndex": 16, "scopes": ["source.abl", "meta.function-call.abl"] }, // ' '
202
+ { "startIndex": 16, "endIndex": 23, "scopes": ["source.abl", "meta.function-call.abl", "entity.name.type.abl"] }, // 'My.Type'
203
+ { "startIndex": 23, "endIndex": 24, "scopes": ["source.abl", "meta.function-call.abl", "meta.brace.round.js"] } // ')'
204
+ ];
205
+ shared.itShouldMatchExpectedScopes(statement, expectedTokens);
206
+ })
207
+
208
+ describe('', () => {
209
+ let statement = `type-OF(obj?:meth()?:val, My.Type)`;
210
+ let expectedTokens = [
211
+ { "startIndex": 0, "endIndex": 7, "scopes": ["source.abl", "meta.function-call.abl", "support.function.abl"] }, // 'type-OF'
212
+ { "startIndex": 7, "endIndex": 8, "scopes": ["source.abl", "meta.function-call.abl", "meta.brace.round.js"] }, // '('
213
+ { "startIndex": 8, "endIndex": 11, "scopes": ["source.abl", "meta.function-call.abl", "variable.other.abl"] }, // 'obj'
214
+ { "startIndex": 11, "endIndex": 13, "scopes": ["source.abl", "meta.function-call.abl", "keyword.operator.source.abl"] }, // '?:'
215
+ { "startIndex": 13, "endIndex": 17, "scopes": ["source.abl", "meta.function-call.abl", "entity.name.function.abl"] }, // 'meth'
216
+ { "startIndex": 17, "endIndex": 18, "scopes": ["source.abl", "meta.function-call.abl", "meta.function.arguments.abl", "meta.brace.round.js"] }, // '('
217
+ { "startIndex": 18, "endIndex": 19, "scopes": ["source.abl", "meta.function-call.abl", "meta.brace.round.js"] }, // ')'
218
+ { "startIndex": 19, "endIndex": 21, "scopes": ["source.abl", "meta.function-call.abl", "keyword.operator.source.abl"] }, // '?:'
219
+ { "startIndex": 21, "endIndex": 24, "scopes": ["source.abl", "meta.function-call.abl", "entity.name.function.abl"] }, // 'val'
220
+ { "startIndex": 24, "endIndex": 25, "scopes": ["source.abl", "meta.function-call.abl", "punctuation.separator.comma.abl"] }, // ','
221
+ { "startIndex": 25, "endIndex": 26, "scopes": ["source.abl", "meta.function-call.abl"] }, // ' '
222
+ { "startIndex": 26, "endIndex": 33, "scopes": ["source.abl", "meta.function-call.abl", "entity.name.type.abl"] }, // 'My.Type'
223
+ { "startIndex": 33, "endIndex": 34, "scopes": ["source.abl", "meta.function-call.abl", "meta.brace.round.js"] } // ')'
224
+ ];
225
+ shared.itShouldMatchExpectedScopes(statement, expectedTokens);
226
+ })
227
+
228
+ describe('', () => {
229
+ let statement = `type-OF(obj:meth()?:val, My.Type)`;
230
+ let expectedTokens = [
231
+ { "startIndex": 0, "endIndex": 7, "scopes": ["source.abl", "meta.function-call.abl", "support.function.abl"] }, // 'type-OF'
232
+ { "startIndex": 7, "endIndex": 8, "scopes": ["source.abl", "meta.function-call.abl", "meta.brace.round.js"] }, // '('
233
+ { "startIndex": 8, "endIndex": 11, "scopes": ["source.abl", "meta.function-call.abl", "variable.other.abl"] }, // 'obj'
234
+ { "startIndex": 11, "endIndex": 12, "scopes": ["source.abl", "meta.function-call.abl", "punctuation.separator.colon.abl"] }, // ':'
235
+ { "startIndex": 12, "endIndex": 16, "scopes": ["source.abl", "meta.function-call.abl", "entity.name.function.abl"] }, // 'meth'
236
+ { "startIndex": 16, "endIndex": 17, "scopes": ["source.abl", "meta.function-call.abl", "meta.function.arguments.abl", "meta.brace.round.js"] }, // '('
237
+ { "startIndex": 17, "endIndex": 18, "scopes": ["source.abl", "meta.function-call.abl", "meta.brace.round.js"] }, // ')'
238
+ { "startIndex": 18, "endIndex": 20, "scopes": ["source.abl", "meta.function-call.abl", "keyword.operator.source.abl"] }, // '?:'
239
+ { "startIndex": 20, "endIndex": 23, "scopes": ["source.abl", "meta.function-call.abl", "entity.name.function.abl"] }, // 'val'
240
+ { "startIndex": 23, "endIndex": 24, "scopes": ["source.abl", "meta.function-call.abl", "punctuation.separator.comma.abl"] }, // ','
241
+ { "startIndex": 24, "endIndex": 25, "scopes": ["source.abl", "meta.function-call.abl"] }, // ' '
242
+ { "startIndex": 25, "endIndex": 32, "scopes": ["source.abl", "meta.function-call.abl", "entity.name.type.abl"] }, // 'My.Type'
243
+ { "startIndex": 32, "endIndex": 33, "scopes": ["source.abl", "meta.function-call.abl", "meta.brace.round.js"] } // ')'
244
+ ];
245
+ shared.itShouldMatchExpectedScopes(statement, expectedTokens);
246
+ })