abl-tmlanguage 1.3.22 → 1.3.23

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,8 @@
1
+ 1.3.23
2
+ ======
3
+
4
+ - ✨ Improve scoping for RUN statements (PR #71, issue vscode-abl/vscode-abl#479)
5
+
1
6
  1.3.22
2
7
  ======
3
8
 
@@ -479,6 +479,9 @@
479
479
  {
480
480
  "include": "#comment"
481
481
  },
482
+ {
483
+ "include": "#run-options"
484
+ },
482
485
  {
483
486
  "include": "#buffer-copy"
484
487
  },
@@ -2903,7 +2906,7 @@
2903
2906
  },
2904
2907
  "end-block": {
2905
2908
  "comment": "Certain blocks have the option of END <block name>",
2906
- "match": "(?i)\\s*(end)\\s+(CASE|CATCH|CLASS|CONSTRUCTOR|DESTRUCTOR|ENUM|FINALLY|FUNCTION|GET|INTERFACE|METHOD|PROCEDURE|SET|TRIGGERS)\\s*",
2909
+ "match": "(?i)\\s*(end)\\s+(case|catch|class|constructor|destructor|enum|finally|function|get|interface|method|procedure|set|triggers)\\s*",
2907
2910
  "captures": {
2908
2911
  "1": {
2909
2912
  "name": "keyword.other.abl"
@@ -3685,6 +3688,9 @@
3685
3688
  {
3686
3689
  "include": "#punctuation-comma"
3687
3690
  },
3691
+ {
3692
+ "include": "#argument-reference"
3693
+ },
3688
3694
  {
3689
3695
  "include": "#preprocessors"
3690
3696
  }
@@ -3891,6 +3897,21 @@
3891
3897
  }
3892
3898
  ]
3893
3899
  },
3900
+ "run-options": {
3901
+ "patterns": [
3902
+ {
3903
+ "match": "\\b(([Ss][Ee][Tt])|([Ii][Nn]))\\s+([a-zA-Z_][a-zA-Z0-9_#$\\-%&]*)\\b",
3904
+ "captures": {
3905
+ "1": {
3906
+ "name": "keyword.other.abl"
3907
+ },
3908
+ "4": {
3909
+ "name": "variable.other.abl"
3910
+ }
3911
+ }
3912
+ }
3913
+ ]
3914
+ },
3894
3915
  "procedure-name": {
3895
3916
  "comment": "(External) Program names are files, so need to support unicode.",
3896
3917
  "match": "([\\w\\-\\$\\@\\/\\\\\\.]{1,256})(?=\\b|\\.$)",
@@ -3902,9 +3923,9 @@
3902
3923
  },
3903
3924
  "include-file": {
3904
3925
  "name": "meta.include.abl",
3905
- "comment": "https://docs.progress.com/bundle/abl-reference/page/Include-file-reference.html. Filesystem names can be unicode",
3926
+ "comment": "https://docs.progress.com/bundle/abl-reference/page/Include-file-reference.html. Filesystem names can be unicode",
3906
3927
  "begin": "({)\\s*(?!&)(([\"]?)([\\\\\/\\w$\\-\\.]+)([\"]?))",
3907
- "beginCaptures": {
3928
+ "beginCaptures": {
3908
3929
  "1": {
3909
3930
  "name": "punctuation.section.abl"
3910
3931
  },
@@ -3912,7 +3933,7 @@
3912
3933
  "name": "punctuation.definition.string.begin.abl"
3913
3934
  },
3914
3935
  "4": {
3915
- "name": "entity.name.include.abl"
3936
+ "name": "entity.name.include.abl"
3916
3937
  },
3917
3938
  "5": {
3918
3939
  "name": "punctuation.definition.string.end.abl"
@@ -4481,7 +4502,7 @@
4481
4502
  },
4482
4503
  "keywords-A": {
4483
4504
  "comment": "The keyword must not have a trailing variable character (one of #$-_%&)",
4484
- "match": "(?i)\\b(a(?:bort|bstract|ccumulate?|ccumula?|ccumu?|cross|ctive-form|ctive-window|dd|dvise|ggregate|lert-box|ll|llow-replication|lter|lternate-key|mbiguous?|mbiguo?|mbig|nd|nsi-only|ny|ny-key|ny-printable|nywhere|ppend|ppend-line|pplication|pply|rray-message?|rray-messa?|rray-mes?|rray-m|s|s-cursor|scending?|scendi?|scen?|sc|sk-overwrite|ssembly|ssign|t|ttach|ttachment|ttribute-type|udit-control|udit-policy|uthorization|uto-endkey|uto-go|utomatic|vailable?|vailab?|vail|verage?|vera?|ve|vg))\\b(?![#$\\-_%&])",
4505
+ "match": "(?i)\\b(a(?:bort|bstract|ccumulate?|ccumula?|ccumu?|cross|ctive-form|ctive-window|dd|dvise|ggregate|lert-box|ll|llow-replication|lter|lternate-key|mbiguous?|mbiguo?|mbig|nd|nsi-only|ny|ny-key|ny-printable|nywhere|ppend|ppend-line|pplication|pply|rray-message?|rray-messa?|rray-mes?|rray-m|s|s-cursor|scending?|scendi?|scen?|sc|sk-overwrite|ssembly|ssign|synchronous|t|ttach|ttachment|ttribute-type|udit-control|udit-policy|uthorization|uto-endkey|uto-go|utomatic|vailable?|vailab?|vail|verage?|vera?|ve|vg))\\b(?![#$\\-_%&])",
4485
4506
  "captures": {
4486
4507
  "1": {
4487
4508
  "name": "keyword.other.abl"
@@ -4517,7 +4538,7 @@
4517
4538
  },
4518
4539
  "keywords-E": {
4519
4540
  "comment": "The keyword must not have a trailing variable character (one of #$-_%&)",
4520
- "match": "(?i)\\b(e(?:ach|cho|dge|dge-pixels?|dge-pixe?|dge-pi?|diting|ditor|ditor-backtab|ditor-tab|lse|mpty|mpty-selection|nable|nd|nd-box-selection|nd-error|nd-key|nd-move|nd-resize|nd-row-resize|nd-search|ndkey|nter-menubar|ntry|num|q|rror|rror-status?|rror-stat|scape|vent|vent-handler-context|vents|xcept|xclusive|xclusive-lock?|xclusive-lo?|xclusive-web-user?|xclusive-web-us?|xclusive-web-?|xecute|xists|xit|xpire|xplicit|xport|xtended|xtent|xternal|xtract))\\b(?![#$\\-_%&])",
4541
+ "match": "(?i)\\b(e(?:ach|cho|dge|dge-pixels?|dge-pixe?|dge-pi?|diting|ditor|ditor-backtab|ditor-tab|lse|mpty|mpty-selection|nable|nd|nd-box-selection|nd-error|nd-key|nd-move|nd-resize|nd-row-resize|nd-search|ndkey|nter-menubar|ntry|num|q|rror|rror-status?|rror-stat|scape|vent|vent-handler|vent-handler-context|vents|xcept|xclusive|xclusive-lock?|xclusive-lo?|xclusive-web-user?|xclusive-web-us?|xclusive-web-?|xecute|xists|xit|xpire|xplicit|xport|xtended|xtent|xternal|xtract))\\b(?![#$\\-_%&])",
4521
4542
  "captures": {
4522
4543
  "1": {
4523
4544
  "name": "keyword.other.abl"
package/index.mjs CHANGED
@@ -41,6 +41,7 @@ const re = /(?:\w|-|\()+(?=\s|$)/g
41
41
  // appropriate scopes
42
42
  let alsoStatements = [];
43
43
  alsoStatements.push('ambiguous');
44
+ alsoStatements.push('asynchronous');
44
45
  alsoStatements.push('auto-go');
45
46
  alsoStatements.push('available');
46
47
  alsoStatements.push('bgcolor');
@@ -54,6 +55,7 @@ alsoStatements.push('delete');
54
55
  alsoStatements.push('delimiter');
55
56
  alsoStatements.push('drop-target');
56
57
  alsoStatements.push('edge-pixels');
58
+ alsoStatements.push('event-handler');
57
59
  alsoStatements.push('fgcolor');
58
60
  alsoStatements.push('first');
59
61
  alsoStatements.push('flat-button');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "abl-tmlanguage",
3
- "version": "1.3.22",
3
+ "version": "1.3.23",
4
4
  "description": "TextMate grammar for Progress OpenEdge ABL Language",
5
5
  "main": "",
6
6
  "type": "commonjs",
@@ -337,3 +337,308 @@ describe('', () => {
337
337
  ];
338
338
  shared.itShouldMatchExpectedScopes(statement, expectedTokens);
339
339
  })
340
+
341
+ describe('', () => {
342
+ let statement = `RUN VALUE(THIS-OBJECT:ServiceInterfacePath + "/proSIinvokeTaskAsync2.p":U)
343
+ ON hAppServer
344
+ ASYNCHRONOUS
345
+ (INPUT pcTaskName,
346
+ INPUT pcMethodName,
347
+ {1},
348
+ lcDataset1,
349
+ lcDataset2,
350
+ lcDataset3,
351
+ lcDataset4,
352
+ lcDataset5,
353
+ lcParameter,
354
+ lcContext) .`;
355
+
356
+ let expectedTokens = [
357
+ [
358
+ { "startIndex": 0, "endIndex": 3, "scopes": ["source.abl", "keyword.other.abl"] }, // 'RUN'
359
+ { "startIndex": 3, "endIndex": 4, "scopes": ["source.abl"] }, // ' '
360
+ { "startIndex": 4, "endIndex": 9, "scopes": ["source.abl", "meta.function-call.abl", "support.function.abl"] }, // 'VALUE'
361
+ { "startIndex": 9, "endIndex": 10, "scopes": ["source.abl", "meta.function-call.abl", "meta.function.arguments.abl", "meta.brace.round.js"] }, // '('
362
+ { "startIndex": 10, "endIndex": 21, "scopes": ["source.abl", "meta.function-call.abl", "meta.function.arguments.abl", "variable.language.abl"] }, // 'THIS-OBJECT'
363
+ { "startIndex": 21, "endIndex": 22, "scopes": ["source.abl", "meta.function-call.abl", "meta.function.arguments.abl", "punctuation.separator.colon.abl"] }, // ':'
364
+ { "startIndex": 22, "endIndex": 42, "scopes": ["source.abl", "meta.function-call.abl", "meta.function.arguments.abl", "entity.name.function.abl"] }, // 'ServiceInterfacePath'
365
+ { "startIndex": 42, "endIndex": 43, "scopes": ["source.abl", "meta.function-call.abl", "meta.function.arguments.abl"] }, // ' '
366
+ { "startIndex": 43, "endIndex": 44, "scopes": ["source.abl", "meta.function-call.abl", "meta.function.arguments.abl", "keyword.operator.source.abl"] }, // '+'
367
+ { "startIndex": 44, "endIndex": 45, "scopes": ["source.abl", "meta.function-call.abl", "meta.function.arguments.abl"] }, // ' '
368
+ { "startIndex": 45, "endIndex": 46, "scopes": ["source.abl", "meta.function-call.abl", "meta.function.arguments.abl", "string.quoted.double.abl", "punctuation.definition.string.begin.abl"] }, // '"'
369
+ { "startIndex": 46, "endIndex": 70, "scopes": ["source.abl", "meta.function-call.abl", "meta.function.arguments.abl", "string.quoted.double.abl"] }, // '/proSIinvokeTaskAsync2.p'
370
+ { "startIndex": 70, "endIndex": 71, "scopes": ["source.abl", "meta.function-call.abl", "meta.function.arguments.abl", "string.quoted.double.abl", "punctuation.definition.string.end.abl"] }, // '"'
371
+ { "startIndex": 71, "endIndex": 73, "scopes": ["source.abl", "meta.function-call.abl", "meta.function.arguments.abl", "string.quoted.double.abl", "support.other.abl"] }, // ':U'
372
+ { "startIndex": 73, "endIndex": 74, "scopes": ["source.abl", "meta.function-call.abl", "meta.brace.round.js"] } // ')'
373
+ ],
374
+ [
375
+ { "startIndex": 0, "endIndex": 8, "scopes": ["source.abl"] }, // ' '
376
+ { "startIndex": 8, "endIndex": 10, "scopes": ["source.abl", "keyword.other.abl"] }, // 'ON'
377
+ { "startIndex": 10, "endIndex": 11, "scopes": ["source.abl"] }, // ' '
378
+ { "startIndex": 11, "endIndex": 21, "scopes": ["source.abl", "variable.other.abl"] } // 'hAppServer'
379
+ ],
380
+ [
381
+ { "startIndex": 0, "endIndex": 8, "scopes": ["source.abl"] }, // ' '
382
+ { "startIndex": 8, "endIndex": 20, "scopes": ["source.abl", "keyword.other.abl"] } // 'ASYNCHRONOUS'
383
+ ],
384
+ [
385
+ { "startIndex": 0, "endIndex": 8, "scopes": ["source.abl"] }, // ' '
386
+ { "startIndex": 8, "endIndex": 9, "scopes": ["source.abl", "meta.function.arguments.abl", "meta.brace.round.js"] }, // '('
387
+ { "startIndex": 9, "endIndex": 14, "scopes": ["source.abl", "meta.function.arguments.abl", "keyword.other.abl"] }, // 'INPUT'
388
+ { "startIndex": 14, "endIndex": 15, "scopes": ["source.abl", "meta.function.arguments.abl"] }, // ' '
389
+ { "startIndex": 15, "endIndex": 25, "scopes": ["source.abl", "meta.function.arguments.abl", "variable.other.abl"] }, // 'pcTaskName'
390
+ { "startIndex": 25, "endIndex": 26, "scopes": ["source.abl", "meta.function.arguments.abl", "punctuation.separator.comma.abl"] } // ','
391
+ ],
392
+ [
393
+ { "startIndex": 0, "endIndex": 10, "scopes": ["source.abl", "meta.function.arguments.abl"] }, // ' '
394
+ { "startIndex": 10, "endIndex": 15, "scopes": ["source.abl", "meta.function.arguments.abl", "keyword.other.abl"] }, // 'INPUT'
395
+ { "startIndex": 15, "endIndex": 16, "scopes": ["source.abl", "meta.function.arguments.abl"] }, // ' '
396
+ { "startIndex": 16, "endIndex": 28, "scopes": ["source.abl", "meta.function.arguments.abl", "variable.other.abl"] }, // 'pcMethodName'
397
+ { "startIndex": 28, "endIndex": 29, "scopes": ["source.abl", "meta.function.arguments.abl", "punctuation.separator.comma.abl"] } // ','
398
+ ],
399
+ [
400
+ { "startIndex": 0, "endIndex": 10, "scopes": ["source.abl", "meta.function.arguments.abl"] }, // ' '
401
+ { "startIndex": 10, "endIndex": 11, "scopes": ["source.abl", "meta.function.arguments.abl", "meta.argument.abl", "punctuation.section.abl"] }, // '{'
402
+ { "startIndex": 11, "endIndex": 12, "scopes": ["source.abl", "meta.function.arguments.abl", "meta.argument.abl", "support.other.argument.abl"] }, // '1'
403
+ { "startIndex": 12, "endIndex": 13, "scopes": ["source.abl", "meta.function.arguments.abl", "meta.argument.abl", "punctuation.section.abl"] }, // '}'
404
+ { "startIndex": 13, "endIndex": 14, "scopes": ["source.abl", "meta.function.arguments.abl", "punctuation.separator.comma.abl"] } // ','
405
+ ],
406
+ [
407
+ { "startIndex": 0, "endIndex": 10, "scopes": ["source.abl", "meta.function.arguments.abl"] }, // ' '
408
+ { "startIndex": 10, "endIndex": 20, "scopes": ["source.abl", "meta.function.arguments.abl", "variable.other.abl"] }, // 'lcDataset1'
409
+ { "startIndex": 20, "endIndex": 21, "scopes": ["source.abl", "meta.function.arguments.abl", "punctuation.separator.comma.abl"] } // ','
410
+ ],
411
+ [
412
+ { "startIndex": 0, "endIndex": 10, "scopes": ["source.abl", "meta.function.arguments.abl"] }, // ' '
413
+ { "startIndex": 10, "endIndex": 20, "scopes": ["source.abl", "meta.function.arguments.abl", "variable.other.abl"] }, // 'lcDataset2'
414
+ { "startIndex": 20, "endIndex": 21, "scopes": ["source.abl", "meta.function.arguments.abl", "punctuation.separator.comma.abl"] } // ','
415
+ ],
416
+ [
417
+ { "startIndex": 0, "endIndex": 10, "scopes": ["source.abl", "meta.function.arguments.abl"] }, // ' '
418
+ { "startIndex": 10, "endIndex": 20, "scopes": ["source.abl", "meta.function.arguments.abl", "variable.other.abl"] }, // 'lcDataset3'
419
+ { "startIndex": 20, "endIndex": 21, "scopes": ["source.abl", "meta.function.arguments.abl", "punctuation.separator.comma.abl"] } // ','
420
+ ],
421
+ [
422
+ { "startIndex": 0, "endIndex": 10, "scopes": ["source.abl", "meta.function.arguments.abl"] }, // ' '
423
+ { "startIndex": 10, "endIndex": 20, "scopes": ["source.abl", "meta.function.arguments.abl", "variable.other.abl"] }, // 'lcDataset4'
424
+ { "startIndex": 20, "endIndex": 21, "scopes": ["source.abl", "meta.function.arguments.abl", "punctuation.separator.comma.abl"] } // ','
425
+ ],
426
+ [
427
+ { "startIndex": 0, "endIndex": 10, "scopes": ["source.abl", "meta.function.arguments.abl"] }, // ' '
428
+ { "startIndex": 10, "endIndex": 20, "scopes": ["source.abl", "meta.function.arguments.abl", "variable.other.abl"] }, // 'lcDataset5'
429
+ { "startIndex": 20, "endIndex": 21, "scopes": ["source.abl", "meta.function.arguments.abl", "punctuation.separator.comma.abl"] } // ','
430
+ ],
431
+ [
432
+ { "startIndex": 0, "endIndex": 10, "scopes": ["source.abl", "meta.function.arguments.abl"] }, // ' '
433
+ { "startIndex": 10, "endIndex": 21, "scopes": ["source.abl", "meta.function.arguments.abl", "variable.other.abl"] }, // 'lcParameter'
434
+ { "startIndex": 21, "endIndex": 22, "scopes": ["source.abl", "meta.function.arguments.abl", "punctuation.separator.comma.abl"] } // ','
435
+ ],
436
+ [
437
+ { "startIndex": 0, "endIndex": 10, "scopes": ["source.abl", "meta.function.arguments.abl"] }, // ' '
438
+ { "startIndex": 10, "endIndex": 19, "scopes": ["source.abl", "meta.function.arguments.abl", "variable.other.abl"] }, // 'lcContext'
439
+ { "startIndex": 19, "endIndex": 20, "scopes": ["source.abl", "meta.brace.round.js"] }, // ')'
440
+ { "startIndex": 20, "endIndex": 21, "scopes": ["source.abl"] }, // ' '
441
+ { "startIndex": 21, "endIndex": 22, "scopes": ["source.abl", "punctuation.terminator.abl"] } // '.'
442
+ ]
443
+ ];
444
+ shared.itShouldMatchExpectedScopes(statement, expectedTokens);
445
+ })
446
+
447
+ describe('', () => {
448
+ let statement = `run Bar in vProcedureHandle(input "hello World").`;
449
+
450
+ let expectedTokens = [
451
+ { "startIndex": 0, "endIndex": 3, "scopes": ["source.abl", "keyword.other.abl"] }, // 'run'
452
+ { "startIndex": 3, "endIndex": 4, "scopes": ["source.abl"] }, // ' '
453
+ { "startIndex": 4, "endIndex": 7, "scopes": ["source.abl", "entity.name.procedure.abl"] }, // 'Bar'
454
+ { "startIndex": 7, "endIndex": 8, "scopes": ["source.abl"] }, // ' '
455
+ { "startIndex": 8, "endIndex": 10, "scopes": ["source.abl", "keyword.other.abl"] }, // 'in'
456
+ { "startIndex": 10, "endIndex": 11, "scopes": ["source.abl"] }, // ' '
457
+ { "startIndex": 11, "endIndex": 27, "scopes": ["source.abl", "variable.other.abl"] }, // 'vProcedureHandle'
458
+ { "startIndex": 27, "endIndex": 28, "scopes": ["source.abl", "meta.function.arguments.abl", "meta.brace.round.js"] }, // '('
459
+ { "startIndex": 28, "endIndex": 33, "scopes": ["source.abl", "meta.function.arguments.abl", "keyword.other.abl"] }, // 'input'
460
+ { "startIndex": 33, "endIndex": 34, "scopes": ["source.abl", "meta.function.arguments.abl"] }, // ' '
461
+ { "startIndex": 34, "endIndex": 35, "scopes": ["source.abl", "meta.function.arguments.abl", "string.quoted.double.abl", "punctuation.definition.string.begin.abl"] }, // '"'
462
+ { "startIndex": 35, "endIndex": 46, "scopes": ["source.abl", "meta.function.arguments.abl", "string.quoted.double.abl"] }, // 'hello World'
463
+ { "startIndex": 46, "endIndex": 47, "scopes": ["source.abl", "meta.function.arguments.abl", "string.quoted.double.abl", "punctuation.definition.string.end.abl"] }, // '"'
464
+ { "startIndex": 47, "endIndex": 48, "scopes": ["source.abl", "meta.brace.round.js"] }, // ')'
465
+ { "startIndex": 48, "endIndex": 49, "scopes": ["source.abl", "punctuation.terminator.abl"] } // '.'
466
+ ];
467
+ shared.itShouldMatchExpectedScopes(statement, expectedTokens);
468
+ })
469
+
470
+ describe('', () => {
471
+ let statement = `RUN test.p
472
+ ON hServer
473
+ ASYNCHRONOUS
474
+ EVENT-HANDLER "test"
475
+ EVENT-HANDLER-CONTEXT o .`;
476
+
477
+ let expectedTokens = [
478
+ [
479
+ { "startIndex": 0, "endIndex": 3, "scopes": ["source.abl", "keyword.other.abl"] }, // 'RUN'
480
+ { "startIndex": 3, "endIndex": 4, "scopes": ["source.abl"] }, // ' '
481
+ { "startIndex": 4, "endIndex": 10, "scopes": ["source.abl", "entity.name.procedure.abl"] } // 'test.p'
482
+ ],
483
+ [
484
+ { "startIndex": 0, "endIndex": 4, "scopes": ["source.abl"] }, // ' '
485
+ { "startIndex": 4, "endIndex": 6, "scopes": ["source.abl", "keyword.other.abl"] }, // 'ON'
486
+ { "startIndex": 6, "endIndex": 7, "scopes": ["source.abl"] }, // ' '
487
+ { "startIndex": 7, "endIndex": 14, "scopes": ["source.abl", "variable.other.abl"] } // 'hServer'
488
+ ],
489
+ [
490
+ { "startIndex": 0, "endIndex": 4, "scopes": ["source.abl"] }, // ' '
491
+ { "startIndex": 4, "endIndex": 16, "scopes": ["source.abl", "keyword.other.abl"] } // 'ASYNCHRONOUS'
492
+ ],
493
+ [
494
+ { "startIndex": 0, "endIndex": 4, "scopes": ["source.abl"] }, // ' '
495
+ { "startIndex": 4, "endIndex": 17, "scopes": ["source.abl", "keyword.other.abl"] }, // 'EVENT-HANDLER'
496
+ { "startIndex": 17, "endIndex": 18, "scopes": ["source.abl"] }, // ' '
497
+ { "startIndex": 18, "endIndex": 19, "scopes": ["source.abl", "string.quoted.double.abl", "punctuation.definition.string.begin.abl"] }, // '"'
498
+ { "startIndex": 19, "endIndex": 23, "scopes": ["source.abl", "string.quoted.double.abl"] }, // 'test'
499
+ { "startIndex": 23, "endIndex": 24, "scopes": ["source.abl", "string.quoted.double.abl", "punctuation.definition.string.end.abl"] } // '"'
500
+ ],
501
+ [
502
+ { "startIndex": 0, "endIndex": 4, "scopes": ["source.abl"] }, // ' '
503
+ { "startIndex": 4, "endIndex": 25, "scopes": ["source.abl", "keyword.other.abl"] }, // 'EVENT-HANDLER-CONTEXT'
504
+ { "startIndex": 25, "endIndex": 26, "scopes": ["source.abl"] }, // ' '
505
+ { "startIndex": 26, "endIndex": 27, "scopes": ["source.abl", "variable.other.abl"] }, // 'o'
506
+ { "startIndex": 27, "endIndex": 28, "scopes": ["source.abl"] }, // ' '
507
+ { "startIndex": 28, "endIndex": 29, "scopes": ["source.abl", "punctuation.terminator.abl"] } // '.'
508
+ ]
509
+ ];
510
+ shared.itShouldMatchExpectedScopes(statement, expectedTokens);
511
+ })
512
+
513
+ describe('', () => {
514
+ let statement = `RUN test.p
515
+ ON SERVER hServer
516
+ ASYNCHRONOUS
517
+ EVENT-HANDLER "test"
518
+ EVENT-HANDLER-CONTEXT o .`;
519
+
520
+ let expectedTokens = [
521
+ [
522
+ { "startIndex": 0, "endIndex": 3, "scopes": ["source.abl", "keyword.other.abl"] }, // 'RUN'
523
+ { "startIndex": 3, "endIndex": 4, "scopes": ["source.abl"] }, // ' '
524
+ { "startIndex": 4, "endIndex": 10, "scopes": ["source.abl", "entity.name.procedure.abl"] } // 'test.p'
525
+ ],
526
+ [
527
+ { "startIndex": 0, "endIndex": 4, "scopes": ["source.abl"] }, // ' '
528
+ { "startIndex": 4, "endIndex": 6, "scopes": ["source.abl", "keyword.other.abl"] }, // 'ON'
529
+ { "startIndex": 6, "endIndex": 7, "scopes": ["source.abl"] }, // ' '
530
+ { "startIndex": 7, "endIndex": 13, "scopes": ["source.abl", "keyword.other.abl"] }, // 'SERVER'
531
+ { "startIndex": 13, "endIndex": 14, "scopes": ["source.abl"] }, // ' '
532
+ { "startIndex": 14, "endIndex": 21, "scopes": ["source.abl", "variable.other.abl"] } // 'hServer'
533
+ ],
534
+ [
535
+ { "startIndex": 0, "endIndex": 4, "scopes": ["source.abl"] }, // ' '
536
+ { "startIndex": 4, "endIndex": 16, "scopes": ["source.abl", "keyword.other.abl"] } // 'ASYNCHRONOUS'
537
+ ],
538
+ [
539
+ { "startIndex": 0, "endIndex": 4, "scopes": ["source.abl"] }, // ' '
540
+ { "startIndex": 4, "endIndex": 17, "scopes": ["source.abl", "keyword.other.abl"] }, // 'EVENT-HANDLER'
541
+ { "startIndex": 17, "endIndex": 18, "scopes": ["source.abl"] }, // ' '
542
+ { "startIndex": 18, "endIndex": 19, "scopes": ["source.abl", "string.quoted.double.abl", "punctuation.definition.string.begin.abl"] }, // '"'
543
+ { "startIndex": 19, "endIndex": 23, "scopes": ["source.abl", "string.quoted.double.abl"] }, // 'test'
544
+ { "startIndex": 23, "endIndex": 24, "scopes": ["source.abl", "string.quoted.double.abl", "punctuation.definition.string.end.abl"] } // '"'
545
+ ],
546
+ [
547
+ { "startIndex": 0, "endIndex": 4, "scopes": ["source.abl"] }, // ' '
548
+ { "startIndex": 4, "endIndex": 25, "scopes": ["source.abl", "keyword.other.abl"] }, // 'EVENT-HANDLER-CONTEXT'
549
+ { "startIndex": 25, "endIndex": 26, "scopes": ["source.abl"] }, // ' '
550
+ { "startIndex": 26, "endIndex": 27, "scopes": ["source.abl", "variable.other.abl"] }, // 'o'
551
+ { "startIndex": 27, "endIndex": 28, "scopes": ["source.abl"] }, // ' '
552
+ { "startIndex": 28, "endIndex": 29, "scopes": ["source.abl", "punctuation.terminator.abl"] } // '.'
553
+ ]
554
+ ];
555
+ shared.itShouldMatchExpectedScopes(statement, expectedTokens);
556
+ })
557
+
558
+ describe('', () => {
559
+ let statement = `RUN test.p
560
+ ON SESSION
561
+ ASYNCHRONOUS
562
+ EVENT-HANDLER "test"
563
+ EVENT-HANDLER-CONTEXT o .`;
564
+
565
+ let expectedTokens = [
566
+ [
567
+ { "startIndex": 0, "endIndex": 3, "scopes": ["source.abl", "keyword.other.abl"] }, // 'RUN'
568
+ { "startIndex": 3, "endIndex": 4, "scopes": ["source.abl"] }, // ' '
569
+ { "startIndex": 4, "endIndex": 10, "scopes": ["source.abl", "entity.name.procedure.abl"] } // 'test.p'
570
+ ],
571
+ [
572
+ { "startIndex": 0, "endIndex": 4, "scopes": ["source.abl"] }, // ' '
573
+ { "startIndex": 4, "endIndex": 6, "scopes": ["source.abl", "keyword.other.abl"] }, // 'ON'
574
+ { "startIndex": 6, "endIndex": 7, "scopes": ["source.abl"] }, // ' '
575
+ { "startIndex": 7, "endIndex": 14, "scopes": ["source.abl", "variable.language.abl"] } // 'SESSION'
576
+ ],
577
+ [
578
+ { "startIndex": 0, "endIndex": 4, "scopes": ["source.abl"] }, // ' '
579
+ { "startIndex": 4, "endIndex": 16, "scopes": ["source.abl", "keyword.other.abl"] } // 'ASYNCHRONOUS'
580
+ ],
581
+ [
582
+ { "startIndex": 0, "endIndex": 4, "scopes": ["source.abl"] }, // ' '
583
+ { "startIndex": 4, "endIndex": 17, "scopes": ["source.abl", "keyword.other.abl"] }, // 'EVENT-HANDLER'
584
+ { "startIndex": 17, "endIndex": 18, "scopes": ["source.abl"] }, // ' '
585
+ { "startIndex": 18, "endIndex": 19, "scopes": ["source.abl", "string.quoted.double.abl", "punctuation.definition.string.begin.abl"] }, // '"'
586
+ { "startIndex": 19, "endIndex": 23, "scopes": ["source.abl", "string.quoted.double.abl"] }, // 'test'
587
+ { "startIndex": 23, "endIndex": 24, "scopes": ["source.abl", "string.quoted.double.abl", "punctuation.definition.string.end.abl"] } // '"'
588
+ ],
589
+ [
590
+ { "startIndex": 0, "endIndex": 4, "scopes": ["source.abl"] }, // ' '
591
+ { "startIndex": 4, "endIndex": 25, "scopes": ["source.abl", "keyword.other.abl"] }, // 'EVENT-HANDLER-CONTEXT'
592
+ { "startIndex": 25, "endIndex": 26, "scopes": ["source.abl"] }, // ' '
593
+ { "startIndex": 26, "endIndex": 27, "scopes": ["source.abl", "variable.other.abl"] }, // 'o'
594
+ { "startIndex": 27, "endIndex": 28, "scopes": ["source.abl"] }, // ' '
595
+ { "startIndex": 28, "endIndex": 29, "scopes": ["source.abl", "punctuation.terminator.abl"] } // '.'
596
+ ]
597
+ ];
598
+ shared.itShouldMatchExpectedScopes(statement, expectedTokens);
599
+ })
600
+
601
+ describe('', () => {
602
+ let statement = `RUN test.p
603
+ ON SESSION:HANDLE
604
+ ASYNCHRONOUS
605
+ EVENT-HANDLER "test"
606
+ EVENT-HANDLER-CONTEXT o .`;
607
+
608
+ let expectedTokens = [
609
+ [
610
+ { "startIndex": 0, "endIndex": 3, "scopes": ["source.abl", "keyword.other.abl"] }, // 'RUN'
611
+ { "startIndex": 3, "endIndex": 4, "scopes": ["source.abl"] }, // ' '
612
+ { "startIndex": 4, "endIndex": 10, "scopes": ["source.abl", "entity.name.procedure.abl"] } // 'test.p'
613
+ ],
614
+ [
615
+ { "startIndex": 0, "endIndex": 4, "scopes": ["source.abl"] }, // ' '
616
+ { "startIndex": 4, "endIndex": 6, "scopes": ["source.abl", "keyword.other.abl"] }, // 'ON'
617
+ { "startIndex": 6, "endIndex": 7, "scopes": ["source.abl"] }, // ' '
618
+ { "startIndex": 7, "endIndex": 14, "scopes": ["source.abl", "variable.language.abl"] }, // 'SESSION'
619
+ { "startIndex": 14, "endIndex": 15, "scopes": ["source.abl", "punctuation.separator.colon.abl"] }, // ':'
620
+ { "startIndex": 15, "endIndex": 21, "scopes": ["source.abl", "entity.name.function.abl"] } // 'HANDLE'
621
+ ],
622
+ [
623
+ { "startIndex": 0, "endIndex": 4, "scopes": ["source.abl"] }, // ' '
624
+ { "startIndex": 4, "endIndex": 16, "scopes": ["source.abl", "keyword.other.abl"] } // 'ASYNCHRONOUS'
625
+ ],
626
+ [
627
+ { "startIndex": 0, "endIndex": 4, "scopes": ["source.abl"] }, // ' '
628
+ { "startIndex": 4, "endIndex": 17, "scopes": ["source.abl", "keyword.other.abl"] }, // 'EVENT-HANDLER'
629
+ { "startIndex": 17, "endIndex": 18, "scopes": ["source.abl"] }, // ' '
630
+ { "startIndex": 18, "endIndex": 19, "scopes": ["source.abl", "string.quoted.double.abl", "punctuation.definition.string.begin.abl"] }, // '"'
631
+ { "startIndex": 19, "endIndex": 23, "scopes": ["source.abl", "string.quoted.double.abl"] }, // 'test'
632
+ { "startIndex": 23, "endIndex": 24, "scopes": ["source.abl", "string.quoted.double.abl", "punctuation.definition.string.end.abl"] } // '"'
633
+ ],
634
+ [
635
+ { "startIndex": 0, "endIndex": 4, "scopes": ["source.abl"] }, // ' '
636
+ { "startIndex": 4, "endIndex": 25, "scopes": ["source.abl", "keyword.other.abl"] }, // 'EVENT-HANDLER-CONTEXT'
637
+ { "startIndex": 25, "endIndex": 26, "scopes": ["source.abl"] }, // ' '
638
+ { "startIndex": 26, "endIndex": 27, "scopes": ["source.abl", "variable.other.abl"] }, // 'o'
639
+ { "startIndex": 27, "endIndex": 28, "scopes": ["source.abl"] }, // ' '
640
+ { "startIndex": 28, "endIndex": 29, "scopes": ["source.abl", "punctuation.terminator.abl"] } // '.'
641
+ ]
642
+ ];
643
+ shared.itShouldMatchExpectedScopes(statement, expectedTokens);
644
+ })