abl-tmlanguage 1.1.3 → 1.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.
Files changed (71) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/README.md +54 -1
  3. package/abl.tmLanguage.json +3534 -230
  4. package/azure-pipelines.yml +3 -2
  5. package/package.json +7 -6
  6. package/spec/analyze-suspend-resume/analyze-suspend-resume.spec.js +10 -10
  7. package/spec/annotations/annotation.spec.js +232 -0
  8. package/spec/array-extent/issue#5.spec.js +18 -18
  9. package/spec/blocks/finally-blocks.spec.js +90 -0
  10. package/spec/blocks/on-quit.spec.js +59 -0
  11. package/spec/comments/vscode-abl-issue#127.spec.js +165 -0
  12. package/spec/db-table-and-field/fields-except.spec.js +69 -0
  13. package/spec/db-table-and-field/foreach.spec.js +588 -0
  14. package/spec/db-table-and-field/issue#88.spec.js +120 -0
  15. package/spec/define-buffer/create-buffer.spec.js +110 -0
  16. package/spec/define-buffer/simple-single-line.spec.js +138 -0
  17. package/spec/define-parameter/simple-single-line.spec.js +140 -100
  18. package/spec/define-stream/simple-single-line.spec.js +32 -31
  19. package/spec/define-temp-table/define-index.spec.js +138 -0
  20. package/spec/define-variable/extent.spec.js +228 -0
  21. package/spec/define-variable/issue#6.spec.js +256 -198
  22. package/spec/define-variable/issue#9.spec.js +38 -32
  23. package/spec/define-variable/simple-single-line.spec.js +168 -87
  24. package/spec/define-variable/single-line-with-a-comment-at-the-end.spec.js +62 -62
  25. package/spec/define-variable/single-line-with-a-space-and-a-comment-at-the-end.spec.js +56 -56
  26. package/spec/define-variable/tm-issue#2.spec.js +20 -20
  27. package/spec/do/do-blocks.spec.js +224 -0
  28. package/spec/do/issue#3.spec.js +69 -60
  29. package/spec/function-call/nested-functions.spec.js +128 -0
  30. package/spec/function-call/vscode-abl-issue#19.spec.js +110 -107
  31. package/spec/global-scoped-define/global-define.spec.js +11 -11
  32. package/spec/global-scoped-define/scoped-define-with-procedure-keyword.spec.js +26 -26
  33. package/spec/include/abl-tmlanguage-issues#5.spec.js +40 -57
  34. package/spec/include/vscode-abl-issue#45.spec.js +15 -15
  35. package/spec/include/vscode-abl-issue#77.spec.js +129 -0
  36. package/spec/include/vscode-abl-issue#80.spec.js +40 -27
  37. package/spec/method-attribute-property-call/abl-method-attribute-call.spec.js +99 -0
  38. package/spec/method-attribute-property-call/connected-method.spec.js +30 -0
  39. package/spec/method-attribute-property-call/get-set-method-name.spec.js +96 -0
  40. package/spec/method-attribute-property-call/method-call.spec.js +112 -0
  41. package/spec/method-definition/constructor.spec.js +174 -0
  42. package/spec/method-definition/method.spec.js +320 -0
  43. package/spec/misc-statements/case-statement.spec.js +96 -0
  44. package/spec/misc-statements/copy-lob.spec.js +137 -0
  45. package/spec/misc-statements/if-then.spec.js +170 -0
  46. package/spec/misc-statements/return-statement.spec.js +53 -0
  47. package/spec/operators/operators.spec.js +78 -0
  48. package/spec/procedure-definition/empty-proc.spec.js +101 -18
  49. package/spec/procedure-definition/vscode-abl-issue#22.spec.js +46 -42
  50. package/spec/procedure-definition/vscode-abl-issue#26.spec.js +23 -16
  51. package/spec/procedure-definition/vscode-abl-issue#62.spec.js +36 -0
  52. package/spec/run-statement/run-statement.spec.js +162 -0
  53. package/spec/shared.js +84 -42
  54. package/spec/strings/translation-attribute.spec.js +52 -0
  55. package/spec/strings/vscode-abl-issue#11.spec.js +110 -114
  56. package/spec/strings/vscode-abl-issue#28.spec.js +27 -27
  57. package/spec/type-name/argument.spec.js +209 -0
  58. package/spec/type-name/cast.spec.js +165 -0
  59. package/spec/type-name/define-class.spec.js +468 -0
  60. package/spec/type-name/define-enum.spec.js +44 -0
  61. package/spec/type-name/define-interface.spec.js +159 -0
  62. package/spec/type-name/define-property.spec.js +301 -0
  63. package/spec/type-name/define-temp-table.spec.js +434 -0
  64. package/spec/type-name/define-type-spec.js +435 -0
  65. package/spec/type-name/define-variable-property.spec.js +264 -0
  66. package/spec/type-name/define-variable.spec.js +504 -0
  67. package/spec/type-name/get-class.spec.js +91 -0
  68. package/spec/type-name/new.spec.js +126 -0
  69. package/spec/type-name/parameter-as.spec.js +838 -0
  70. package/spec/type-name/type-name.spec.js +879 -0
  71. package/spec/type-name/using.spec.js +115 -0
@@ -0,0 +1,96 @@
1
+ const { assert, expect } = require('chai');
2
+ const shared = require('../shared.js');
3
+
4
+ describe('', () => {
5
+ let statement = `if type-of(pProxyReq, IAdaptable) then
6
+ assign baseRequest = cast(cast(pProxyReq, IAdaptable):GetAdapter(get-class(IHttpRequest)), IHttpRequest).
7
+ else
8
+ if type-of(pProxyReq, IHttpRequest) then
9
+ assign baseRequest = cast(pProxyReq, IHttpRequest):Set(now).`;
10
+ let expectedTokens = [
11
+ [
12
+ { "startIndex": 0, "endIndex": 2, "scopes": ["source.abl", "keyword.other.abl"] }, // 'if'
13
+ { "startIndex": 2, "endIndex": 3, "scopes": ["source.abl"] }, // ' '
14
+ { "startIndex": 3, "endIndex": 10, "scopes": ["source.abl", "meta.function-call.abl", "support.function.abl"] }, // 'type-of'
15
+ { "startIndex": 10, "endIndex": 11, "scopes": ["source.abl", "meta.function-call.abl", "meta.brace.round.js"] }, // '('
16
+ { "startIndex": 11, "endIndex": 20, "scopes": ["source.abl", "meta.function-call.abl", "variable.other.abl"] }, // 'pProxyReq'
17
+ { "startIndex": 20, "endIndex": 21, "scopes": ["source.abl", "meta.function-call.abl", "punctuation.separator.comma.abl"] }, // ','
18
+ { "startIndex": 21, "endIndex": 22, "scopes": ["source.abl", "meta.function-call.abl"] }, // ' '
19
+ { "startIndex": 22, "endIndex": 32, "scopes": ["source.abl", "meta.function-call.abl", "entity.name.type.abl"] }, // 'IAdaptable'
20
+ { "startIndex": 32, "endIndex": 33, "scopes": ["source.abl", "meta.function-call.abl", "meta.brace.round.js"] }, // ')'
21
+ { "startIndex": 33, "endIndex": 34, "scopes": ["source.abl"] }, // ' '
22
+ { "startIndex": 34, "endIndex": 38, "scopes": ["source.abl", "keyword.other.abl"] } // 'then'
23
+ ],
24
+ [
25
+ { "startIndex": 0, "endIndex": 2, "scopes": ["source.abl"] }, // ' '
26
+ { "startIndex": 2, "endIndex": 8, "scopes": ["source.abl", "keyword.other.abl"] }, // 'assign'
27
+ { "startIndex": 8, "endIndex": 9, "scopes": ["source.abl"] }, // ' '
28
+ { "startIndex": 9, "endIndex": 20, "scopes": ["source.abl", "variable.other.abl"] }, // 'baseRequest'
29
+ { "startIndex": 20, "endIndex": 21, "scopes": ["source.abl"] }, // ' '
30
+ { "startIndex": 21, "endIndex": 22, "scopes": ["source.abl", "keyword.operator.source.abl"] }, // '='
31
+ { "startIndex": 22, "endIndex": 23, "scopes": ["source.abl", "meta.function-call.abl"] }, // ' '
32
+ { "startIndex": 23, "endIndex": 27, "scopes": ["source.abl", "meta.function-call.abl", "support.function.abl"] }, // 'cast'
33
+ { "startIndex": 27, "endIndex": 28, "scopes": ["source.abl", "meta.function-call.abl", "meta.brace.round.js"] }, // '('
34
+ { "startIndex": 28, "endIndex": 32, "scopes": ["source.abl", "meta.function-call.abl", "meta.function-call.abl", "support.function.abl"] }, // 'cast'
35
+ { "startIndex": 32, "endIndex": 33, "scopes": ["source.abl", "meta.function-call.abl", "meta.function-call.abl", "meta.brace.round.js"] }, // '('
36
+ { "startIndex": 33, "endIndex": 42, "scopes": ["source.abl", "meta.function-call.abl", "meta.function-call.abl", "variable.other.abl"] }, // 'pProxyReq'
37
+ { "startIndex": 42, "endIndex": 43, "scopes": ["source.abl", "meta.function-call.abl", "meta.function-call.abl", "punctuation.separator.comma.abl"] }, // ','
38
+ { "startIndex": 43, "endIndex": 44, "scopes": ["source.abl", "meta.function-call.abl", "meta.function-call.abl"] }, // ' '
39
+ { "startIndex": 44, "endIndex": 54, "scopes": ["source.abl", "meta.function-call.abl", "meta.function-call.abl", "entity.name.type.abl"] }, // 'IAdaptable'
40
+ { "startIndex": 54, "endIndex": 55, "scopes": ["source.abl", "meta.function-call.abl", "meta.function-call.abl", "meta.brace.round.js"] }, // ')'
41
+ { "startIndex": 55, "endIndex": 56, "scopes": ["source.abl", "punctuation.separator.colon.abl"] }, // ':'
42
+ { "startIndex": 56, "endIndex": 66, "scopes": ["source.abl", "entity.name.function.abl"] }, // 'GetAdapter'
43
+ { "startIndex": 66, "endIndex": 67, "scopes": ["source.abl", "meta.function.arguments.abl", "meta.brace.round.js"] }, // '('
44
+ { "startIndex": 67, "endIndex": 76, "scopes": ["source.abl", "meta.function.arguments.abl", "meta.function-call.abl", "support.function.abl"] }, // 'get-class'
45
+ { "startIndex": 76, "endIndex": 77, "scopes": ["source.abl", "meta.function.arguments.abl", "meta.function-call.abl", "meta.brace.round.js"] }, // '('
46
+ { "startIndex": 77, "endIndex": 89, "scopes": ["source.abl", "meta.function.arguments.abl", "meta.function-call.abl", "entity.name.type.abl"] }, // 'IHttpRequest'
47
+ { "startIndex": 89, "endIndex": 90, "scopes": ["source.abl", "meta.function.arguments.abl", "meta.function-call.abl", "meta.brace.round.js"] }, // ')'
48
+ { "startIndex": 90, "endIndex": 91, "scopes": ["source.abl", "meta.brace.round.js"] }, // ')'
49
+ { "startIndex": 91, "endIndex": 92, "scopes": ["source.abl", "punctuation.separator.comma.abl"] }, // ','
50
+ { "startIndex": 92, "endIndex": 93, "scopes": ["source.abl"] }, // ' '
51
+ { "startIndex": 93, "endIndex": 105, "scopes": ["source.abl", "variable.other.abl"] }, // 'IHttpRequest'
52
+ { "startIndex": 105, "endIndex": 106, "scopes": ["source.abl", "meta.brace.round.js"] }, // ')'
53
+ { "startIndex": 106, "endIndex": 107, "scopes": ["source.abl", "punctuation.terminator.abl"] } // '.'
54
+ ],
55
+ [
56
+ { "startIndex": 0, "endIndex": 4, "scopes": ["source.abl", "keyword.other.abl"] } // 'else'
57
+ ],
58
+ [
59
+ { "startIndex": 0, "endIndex": 2, "scopes": ["source.abl", "keyword.other.abl"] }, // 'if'
60
+ { "startIndex": 2, "endIndex": 3, "scopes": ["source.abl"] }, // ' '
61
+ { "startIndex": 3, "endIndex": 10, "scopes": ["source.abl", "meta.function-call.abl", "support.function.abl"] }, // 'type-of'
62
+ { "startIndex": 10, "endIndex": 11, "scopes": ["source.abl", "meta.function-call.abl", "meta.brace.round.js"] }, // '('
63
+ { "startIndex": 11, "endIndex": 20, "scopes": ["source.abl", "meta.function-call.abl", "variable.other.abl"] }, // 'pProxyReq'
64
+ { "startIndex": 20, "endIndex": 21, "scopes": ["source.abl", "meta.function-call.abl", "punctuation.separator.comma.abl"] }, // ','
65
+ { "startIndex": 21, "endIndex": 22, "scopes": ["source.abl", "meta.function-call.abl"] }, // ' '
66
+ { "startIndex": 22, "endIndex": 34, "scopes": ["source.abl", "meta.function-call.abl", "entity.name.type.abl"] }, // 'IHttpRequest'
67
+ { "startIndex": 34, "endIndex": 35, "scopes": ["source.abl", "meta.function-call.abl", "meta.brace.round.js"] }, // ')'
68
+ { "startIndex": 35, "endIndex": 36, "scopes": ["source.abl"] }, // ' '
69
+ { "startIndex": 36, "endIndex": 40, "scopes": ["source.abl", "keyword.other.abl"] } // 'then'
70
+ ],
71
+ [
72
+ { "startIndex": 0, "endIndex": 2, "scopes": ["source.abl"] }, // ' '
73
+ { "startIndex": 2, "endIndex": 8, "scopes": ["source.abl", "keyword.other.abl"] }, // 'assign'
74
+ { "startIndex": 8, "endIndex": 9, "scopes": ["source.abl"] }, // ' '
75
+ { "startIndex": 9, "endIndex": 20, "scopes": ["source.abl", "variable.other.abl"] }, // 'baseRequest'
76
+ { "startIndex": 20, "endIndex": 21, "scopes": ["source.abl"] }, // ' '
77
+ { "startIndex": 21, "endIndex": 22, "scopes": ["source.abl", "keyword.operator.source.abl"] }, // '='
78
+ { "startIndex": 22, "endIndex": 23, "scopes": ["source.abl", "meta.function-call.abl"] }, // ' '
79
+ { "startIndex": 23, "endIndex": 27, "scopes": ["source.abl", "meta.function-call.abl", "support.function.abl"] }, // 'cast'
80
+ { "startIndex": 27, "endIndex": 28, "scopes": ["source.abl", "meta.function-call.abl", "meta.brace.round.js"] }, // '('
81
+ { "startIndex": 28, "endIndex": 37, "scopes": ["source.abl", "meta.function-call.abl", "variable.other.abl"] }, // 'pProxyReq'
82
+ { "startIndex": 37, "endIndex": 38, "scopes": ["source.abl", "meta.function-call.abl", "punctuation.separator.comma.abl"] }, // ','
83
+ { "startIndex": 38, "endIndex": 39, "scopes": ["source.abl", "meta.function-call.abl"] }, // ' '
84
+ { "startIndex": 39, "endIndex": 51, "scopes": ["source.abl", "meta.function-call.abl", "entity.name.type.abl"] }, // 'IHttpRequest'
85
+ { "startIndex": 51, "endIndex": 52, "scopes": ["source.abl", "meta.function-call.abl", "meta.brace.round.js"] }, // ')'
86
+ { "startIndex": 52, "endIndex": 53, "scopes": ["source.abl", "punctuation.separator.colon.abl"] }, // ':'
87
+ { "startIndex": 53, "endIndex": 56, "scopes": ["source.abl", "entity.name.function.abl"] }, // 'Set'
88
+ { "startIndex": 56, "endIndex": 57, "scopes": ["source.abl", "meta.function.arguments.abl", "meta.brace.round.js"] }, // '('
89
+ { "startIndex": 57, "endIndex": 60, "scopes": ["source.abl", "meta.function.arguments.abl", "constant.language.abl"] }, // 'now'
90
+ { "startIndex": 60, "endIndex": 61, "scopes": ["source.abl", "meta.brace.round.js"] }, // ')'
91
+ { "startIndex": 61, "endIndex": 62, "scopes": ["source.abl", "punctuation.terminator.abl"] } // '.'
92
+ ]
93
+ ];
94
+ shared.itShouldMatchExpectedScopes(statement, expectedTokens);
95
+ })
96
+
@@ -0,0 +1,112 @@
1
+ const { assert, expect } = require('chai');
2
+ const shared = require('../shared.js');
3
+
4
+ describe('', () => {
5
+ let statement = `assign oRequest = this-object:GenerateInvokeMethodProperties (input-output oOperation,
6
+ input-output oArray,
7
+ input-output poDocumentRoot,
8
+ poRestMethod,
9
+ pcParameters,
10
+ oParameterDescriptions ).`;
11
+ let expectedTokens = [
12
+ [
13
+ { "startIndex": 0, "endIndex": 6, "scopes": ["source.abl", "keyword.other.abl"] }, // 'assign'
14
+ { "startIndex": 6, "endIndex": 7, "scopes": ["source.abl"] }, // ' '
15
+ { "startIndex": 7, "endIndex": 15, "scopes": ["source.abl", "variable.other.abl"] }, // 'oRequest'
16
+ { "startIndex": 15, "endIndex": 16, "scopes": ["source.abl"] }, // ' '
17
+ { "startIndex": 16, "endIndex": 17, "scopes": ["source.abl", "keyword.operator.source.abl"] }, // '='
18
+ { "startIndex": 17, "endIndex": 18, "scopes": ["source.abl"] }, // ' '
19
+ { "startIndex": 18, "endIndex": 29, "scopes": ["source.abl", "variable.language.abl"] }, // 'this-object'
20
+ { "startIndex": 29, "endIndex": 30, "scopes": ["source.abl", "punctuation.separator.colon.abl"] }, // ':'
21
+ { "startIndex": 30, "endIndex": 60, "scopes": ["source.abl", "entity.name.function.abl"] }, // 'GenerateInvokeMethodProperties'
22
+ { "startIndex": 60, "endIndex": 61, "scopes": ["source.abl"] }, // ' '
23
+ { "startIndex": 61, "endIndex": 62, "scopes": ["source.abl", "meta.function.arguments.abl", "meta.brace.round.js"] }, // '('
24
+ { "startIndex": 62, "endIndex": 74, "scopes": ["source.abl", "meta.function.arguments.abl", "keyword.other.abl"] }, // 'input-output'
25
+ { "startIndex": 74, "endIndex": 75, "scopes": ["source.abl", "meta.function.arguments.abl"] }, // ' '
26
+ { "startIndex": 75, "endIndex": 85, "scopes": ["source.abl", "meta.function.arguments.abl", "variable.other.abl"] }, // 'oOperation'
27
+ { "startIndex": 85, "endIndex": 86, "scopes": ["source.abl", "meta.function.arguments.abl", "punctuation.separator.comma.abl"] } // ','
28
+ ],
29
+ [
30
+ { "startIndex": 0, "endIndex": 4, "scopes": ["source.abl", "meta.function.arguments.abl"] }, // ' '
31
+ { "startIndex": 4, "endIndex": 16, "scopes": ["source.abl", "meta.function.arguments.abl", "keyword.other.abl"] }, // 'input-output'
32
+ { "startIndex": 16, "endIndex": 17, "scopes": ["source.abl", "meta.function.arguments.abl"] }, // ' '
33
+ { "startIndex": 17, "endIndex": 23, "scopes": ["source.abl", "meta.function.arguments.abl", "variable.other.abl"] }, // 'oArray'
34
+ { "startIndex": 23, "endIndex": 24, "scopes": ["source.abl", "meta.function.arguments.abl", "punctuation.separator.comma.abl"] } // ','
35
+ ],
36
+ [
37
+ { "startIndex": 0, "endIndex": 4, "scopes": ["source.abl", "meta.function.arguments.abl"] }, // ' '
38
+ { "startIndex": 4, "endIndex": 16, "scopes": ["source.abl", "meta.function.arguments.abl", "keyword.other.abl"] }, // 'input-output'
39
+ { "startIndex": 16, "endIndex": 17, "scopes": ["source.abl", "meta.function.arguments.abl"] }, // ' '
40
+ { "startIndex": 17, "endIndex": 31, "scopes": ["source.abl", "meta.function.arguments.abl", "variable.other.abl"] }, // 'poDocumentRoot'
41
+ { "startIndex": 31, "endIndex": 32, "scopes": ["source.abl", "meta.function.arguments.abl", "punctuation.separator.comma.abl"] } // ','
42
+ ],
43
+ [
44
+ { "startIndex": 0, "endIndex": 4, "scopes": ["source.abl", "meta.function.arguments.abl"] }, // ' '
45
+ { "startIndex": 4, "endIndex": 16, "scopes": ["source.abl", "meta.function.arguments.abl", "variable.other.abl"] }, // 'poRestMethod'
46
+ { "startIndex": 16, "endIndex": 17, "scopes": ["source.abl", "meta.function.arguments.abl", "punctuation.separator.comma.abl"] } // ','
47
+ ],
48
+ [
49
+ { "startIndex": 0, "endIndex": 4, "scopes": ["source.abl", "meta.function.arguments.abl"] }, // ' '
50
+ { "startIndex": 4, "endIndex": 16, "scopes": ["source.abl", "meta.function.arguments.abl", "variable.other.abl"] }, // 'pcParameters'
51
+ { "startIndex": 16, "endIndex": 17, "scopes": ["source.abl", "meta.function.arguments.abl", "punctuation.separator.comma.abl"] } // ','
52
+ ],
53
+ [
54
+ { "startIndex": 0, "endIndex": 4, "scopes": ["source.abl", "meta.function.arguments.abl"] }, // ' '
55
+ { "startIndex": 4, "endIndex": 26, "scopes": ["source.abl", "meta.function.arguments.abl", "variable.other.abl"] }, // 'oParameterDescriptions'
56
+ { "startIndex": 26, "endIndex": 27, "scopes": ["source.abl", "meta.function.arguments.abl"] }, // ' '
57
+ { "startIndex": 27, "endIndex": 28, "scopes": ["source.abl", "meta.brace.round.js"] }, // ')'
58
+ { "startIndex": 28, "endIndex": 29, "scopes": ["source.abl", "punctuation.terminator.abl"] } // '.'
59
+ ]
60
+ ];
61
+ shared.itShouldMatchExpectedScopes(statement, expectedTokens);
62
+ })
63
+
64
+ describe('', () => {
65
+ let statement = `method private void CopyTable(input table copytable):
66
+ CopyTable(table copytable by-reference,"","").
67
+ end method.`;
68
+ let expectedTokens = [
69
+ [
70
+ { "startIndex": 0, "endIndex": 6, "scopes": ["source.abl", "meta.define.method.abl", "keyword.other.abl"] }, // 'method'
71
+ { "startIndex": 6, "endIndex": 7, "scopes": ["source.abl", "meta.define.method.abl"] }, // ' '
72
+ { "startIndex": 7, "endIndex": 14, "scopes": ["source.abl", "meta.define.method.abl", "keyword.other.abl"] }, // 'private'
73
+ { "startIndex": 14, "endIndex": 15, "scopes": ["source.abl", "meta.define.method.abl"] }, // ' '
74
+ { "startIndex": 15, "endIndex": 19, "scopes": ["source.abl", "meta.define.method.abl", "keyword.other.abl"] }, // 'void'
75
+ { "startIndex": 19, "endIndex": 20, "scopes": ["source.abl", "meta.define.method.abl"] }, // ' '
76
+ { "startIndex": 20, "endIndex": 29, "scopes": ["source.abl", "meta.define.method.abl", "entity.name.function.abl"] }, // 'CopyTable'
77
+ { "startIndex": 29, "endIndex": 30, "scopes": ["source.abl", "meta.define.method.abl", "meta.brace.round.js"] }, // '('
78
+ { "startIndex": 30, "endIndex": 35, "scopes": ["source.abl", "meta.define.method.abl", "keyword.other.abl"] }, // 'input'
79
+ { "startIndex": 35, "endIndex": 36, "scopes": ["source.abl", "meta.define.method.abl"] }, // ' '
80
+ { "startIndex": 36, "endIndex": 41, "scopes": ["source.abl", "meta.define.method.abl", "keyword.other.abl"] }, // 'table'
81
+ { "startIndex": 41, "endIndex": 42, "scopes": ["source.abl", "meta.define.method.abl"] }, // ' '
82
+ { "startIndex": 42, "endIndex": 51, "scopes": ["source.abl", "meta.define.method.abl", "storage.data.table.abl"] }, // 'copytable'
83
+ { "startIndex": 51, "endIndex": 52, "scopes": ["source.abl", "meta.define.method.abl", "meta.brace.round.js"] }, // ')'
84
+ { "startIndex": 52, "endIndex": 53, "scopes": ["source.abl", "punctuation.terminator.abl"] } // ':'
85
+ ],
86
+ [
87
+ { "startIndex": 0, "endIndex": 2, "scopes": ["source.abl"] }, // ' '
88
+ { "startIndex": 2, "endIndex": 11, "scopes": ["source.abl", "variable.other.abl"] }, // 'CopyTable'
89
+ { "startIndex": 11, "endIndex": 12, "scopes": ["source.abl", "meta.function.arguments.abl", "meta.brace.round.js"] }, // '('
90
+ { "startIndex": 12, "endIndex": 17, "scopes": ["source.abl", "meta.function.arguments.abl", "keyword.other.abl"] }, // 'table'
91
+ { "startIndex": 17, "endIndex": 18, "scopes": ["source.abl", "meta.function.arguments.abl"] }, // ' '
92
+ { "startIndex": 18, "endIndex": 27, "scopes": ["source.abl", "meta.function.arguments.abl", "variable.other.abl"] }, // 'copytable'
93
+ { "startIndex": 27, "endIndex": 28, "scopes": ["source.abl", "meta.function.arguments.abl"] }, // ' '
94
+ { "startIndex": 28, "endIndex": 40, "scopes": ["source.abl", "meta.function.arguments.abl", "keyword.other.abl"] }, // 'by-reference'
95
+ { "startIndex": 40, "endIndex": 41, "scopes": ["source.abl", "meta.function.arguments.abl", "punctuation.separator.comma.abl"] }, // ','
96
+ { "startIndex": 41, "endIndex": 42, "scopes": ["source.abl", "meta.function.arguments.abl", "string.double.complex.abl", "punctuation.definition.string.begin.abl"] }, // '"'
97
+ { "startIndex": 42, "endIndex": 43, "scopes": ["source.abl", "meta.function.arguments.abl", "string.double.complex.abl", "punctuation.definition.string.end.abl"] }, // '"'
98
+ { "startIndex": 43, "endIndex": 44, "scopes": ["source.abl", "meta.function.arguments.abl", "punctuation.separator.comma.abl"] }, // ','
99
+ { "startIndex": 44, "endIndex": 45, "scopes": ["source.abl", "meta.function.arguments.abl", "string.double.complex.abl", "punctuation.definition.string.begin.abl"] }, // '"'
100
+ { "startIndex": 45, "endIndex": 46, "scopes": ["source.abl", "meta.function.arguments.abl", "string.double.complex.abl", "punctuation.definition.string.end.abl"] }, // '"'
101
+ { "startIndex": 46, "endIndex": 47, "scopes": ["source.abl", "meta.brace.round.js"] }, // ')'
102
+ { "startIndex": 47, "endIndex": 48, "scopes": ["source.abl", "punctuation.terminator.abl"] } // '.'
103
+ ],
104
+ [
105
+ { "startIndex": 0, "endIndex": 3, "scopes": ["source.abl", "keyword.other.abl"] }, // 'end'
106
+ { "startIndex": 3, "endIndex": 4, "scopes": ["source.abl"] }, // ' '
107
+ { "startIndex": 4, "endIndex": 10, "scopes": ["source.abl", "keyword.other.abl"] }, // 'method'
108
+ { "startIndex": 10, "endIndex": 11, "scopes": ["source.abl", "punctuation.terminator.abl"] } // '.'
109
+ ]
110
+ ];
111
+ shared.itShouldMatchExpectedScopes(statement, expectedTokens);
112
+ })
@@ -0,0 +1,174 @@
1
+ const { assert, expect } = require('chai');
2
+ const shared = require('../shared.js');
3
+
4
+ describe('', () => {
5
+ let statement =
6
+ `constructor public ClassA ():
7
+ this-object(x).
8
+ end constructor.`;
9
+
10
+ let expectedTokens = [
11
+ [
12
+ { "startIndex": 0, "endIndex": 11, "scopes": ["source.abl", "meta.define.method.abl", "keyword.other.abl"] }, // 'constructor'
13
+ { "startIndex": 11, "endIndex": 12, "scopes": ["source.abl", "meta.define.method.abl"] }, // ' '
14
+ { "startIndex": 12, "endIndex": 18, "scopes": ["source.abl", "meta.define.method.abl", "keyword.other.abl"] }, // 'public'
15
+ { "startIndex": 18, "endIndex": 19, "scopes": ["source.abl", "meta.define.method.abl"] }, // ' '
16
+ { "startIndex": 19, "endIndex": 25, "scopes": ["source.abl", "meta.define.method.abl", "entity.name.function.abl"] }, // 'ClassA'
17
+ { "startIndex": 25, "endIndex": 26, "scopes": ["source.abl", "meta.define.method.abl"] }, // ' '
18
+ { "startIndex": 26, "endIndex": 27, "scopes": ["source.abl", "meta.define.method.abl", "meta.brace.round.js"] }, // '('
19
+ { "startIndex": 27, "endIndex": 28, "scopes": ["source.abl", "meta.define.method.abl", "meta.brace.round.js"] }, // ')'
20
+ { "startIndex": 28, "endIndex": 29, "scopes": ["source.abl", "punctuation.terminator.abl"] } // ':'
21
+ ],
22
+ [
23
+ { "startIndex": 0, "endIndex": 2, "scopes": ["source.abl", "meta.function-call.abl"] }, // ' '
24
+ { "startIndex": 2, "endIndex": 13, "scopes": ["source.abl", "meta.function-call.abl", "support.function.abl"] }, // 'this-object'
25
+ { "startIndex": 13, "endIndex": 14, "scopes": ["source.abl", "meta.function-call.abl", "meta.function.arguments.abl", "meta.brace.round.js"] }, // '('
26
+ { "startIndex": 14, "endIndex": 15, "scopes": ["source.abl", "meta.function-call.abl", "meta.function.arguments.abl", "variable.other.abl"] }, // 'x'
27
+ { "startIndex": 15, "endIndex": 16, "scopes": ["source.abl", "meta.function-call.abl", "meta.brace.round.js"] }, // ')'
28
+ { "startIndex": 16, "endIndex": 17, "scopes": ["source.abl", "punctuation.terminator.abl"] } // '.'
29
+ ],
30
+ [
31
+ { "startIndex": 0, "endIndex": 3, "scopes": ["source.abl", "keyword.other.abl"] }, // 'end'
32
+ { "startIndex": 3, "endIndex": 4, "scopes": ["source.abl"] }, // ' '
33
+ { "startIndex": 4, "endIndex": 15, "scopes": ["source.abl", "keyword.other.abl"] }, // 'constructor'
34
+ { "startIndex": 15, "endIndex": 16, "scopes": ["source.abl", "punctuation.terminator.abl"] } // '.'
35
+ ]
36
+ ];
37
+ shared.itShouldMatchExpectedScopes(statement, expectedTokens);
38
+ })
39
+
40
+ describe('', () => {
41
+ let statement =
42
+ `constructor package-private ClassA (pcString as character extent, po as Object):
43
+ message "a method".
44
+ end constructor.`;
45
+
46
+ let expectedTokens = [
47
+ [
48
+ { "startIndex": 0, "endIndex": 11, "scopes": ["source.abl", "meta.define.method.abl", "keyword.other.abl"] }, // 'constructor'
49
+ { "startIndex": 11, "endIndex": 12, "scopes": ["source.abl", "meta.define.method.abl"] }, // ' '
50
+ { "startIndex": 12, "endIndex": 27, "scopes": ["source.abl", "meta.define.method.abl", "keyword.other.abl"] }, // 'package-private'
51
+ { "startIndex": 27, "endIndex": 28, "scopes": ["source.abl", "meta.define.method.abl"] }, // ' '
52
+ { "startIndex": 28, "endIndex": 34, "scopes": ["source.abl", "meta.define.method.abl", "entity.name.function.abl"] }, // 'ClassA'
53
+ { "startIndex": 34, "endIndex": 35, "scopes": ["source.abl", "meta.define.method.abl"] }, // ' '
54
+ { "startIndex": 35, "endIndex": 36, "scopes": ["source.abl", "meta.define.method.abl", "meta.brace.round.js"] }, // '('
55
+ { "startIndex": 36, "endIndex": 44, "scopes": ["source.abl", "meta.define.method.abl", "variable.parameter.abl"] }, // 'pcString'
56
+ { "startIndex": 44, "endIndex": 45, "scopes": ["source.abl", "meta.define.method.abl"] }, // ' '
57
+ { "startIndex": 45, "endIndex": 47, "scopes": ["source.abl", "meta.define.method.abl", "keyword.other.abl"] }, // 'as'
58
+ { "startIndex": 47, "endIndex": 48, "scopes": ["source.abl", "meta.define.method.abl"] }, // ' '
59
+ { "startIndex": 48, "endIndex": 57, "scopes": ["source.abl", "meta.define.method.abl", "storage.type.abl"] }, // 'character'
60
+ { "startIndex": 57, "endIndex": 58, "scopes": ["source.abl", "meta.define.method.abl"] }, // ' '
61
+ { "startIndex": 58, "endIndex": 64, "scopes": ["source.abl", "meta.define.method.abl", "keyword.other.abl"] }, // 'extent'
62
+ { "startIndex": 64, "endIndex": 65, "scopes": ["source.abl", "meta.define.method.abl", "punctuation.separator.comma.abl"] }, // ','
63
+ { "startIndex": 65, "endIndex": 66, "scopes": ["source.abl", "meta.define.method.abl"] }, // ' '
64
+ { "startIndex": 66, "endIndex": 68, "scopes": ["source.abl", "meta.define.method.abl", "variable.parameter.abl"] }, // 'po'
65
+ { "startIndex": 68, "endIndex": 69, "scopes": ["source.abl", "meta.define.method.abl"] }, // ' '
66
+ { "startIndex": 69, "endIndex": 71, "scopes": ["source.abl", "meta.define.method.abl", "keyword.other.abl"] }, // 'as'
67
+ { "startIndex": 71, "endIndex": 72, "scopes": ["source.abl", "meta.define.method.abl"] }, // ' '
68
+ { "startIndex": 72, "endIndex": 78, "scopes": ["source.abl", "meta.define.method.abl", "entity.name.type.abl"] }, // 'Object'
69
+ { "startIndex": 78, "endIndex": 79, "scopes": ["source.abl", "meta.define.method.abl", "meta.brace.round.js"] }, // ')'
70
+ { "startIndex": 79, "endIndex": 80, "scopes": ["source.abl", "punctuation.terminator.abl"] } // ':'
71
+ ],
72
+ [
73
+ { "startIndex": 0, "endIndex": 2, "scopes": ["source.abl"] }, // ' '
74
+ { "startIndex": 2, "endIndex": 9, "scopes": ["source.abl", "keyword.other.abl"] }, // 'message'
75
+ { "startIndex": 9, "endIndex": 10, "scopes": ["source.abl"] }, // ' '
76
+ { "startIndex": 10, "endIndex": 11, "scopes": ["source.abl", "string.double.complex.abl", "punctuation.definition.string.begin.abl"] }, // '"'
77
+ { "startIndex": 11, "endIndex": 19, "scopes": ["source.abl", "string.double.complex.abl"] }, // 'a method'
78
+ { "startIndex": 19, "endIndex": 20, "scopes": ["source.abl", "string.double.complex.abl", "punctuation.definition.string.end.abl"] }, // '"'
79
+ { "startIndex": 20, "endIndex": 21, "scopes": ["source.abl", "punctuation.terminator.abl"] } // '.'
80
+ ],
81
+ [
82
+ { "startIndex": 0, "endIndex": 3, "scopes": ["source.abl", "keyword.other.abl"] }, // 'end'
83
+ { "startIndex": 3, "endIndex": 4, "scopes": ["source.abl"] }, // ' '
84
+ { "startIndex": 4, "endIndex": 15, "scopes": ["source.abl", "keyword.other.abl"] }, // 'constructor'
85
+ { "startIndex": 15, "endIndex": 16, "scopes": ["source.abl", "punctuation.terminator.abl"] } // '.'
86
+ ]
87
+ ];
88
+ shared.itShouldMatchExpectedScopes(statement, expectedTokens);
89
+ })
90
+
91
+ describe('', () => {
92
+ let statement =
93
+ `constructor private ClassB( po as List<Package.Thing>,
94
+ buffer pb for TableName,
95
+ input-output dataset dsData):
96
+ define variable log1 as logical.
97
+
98
+ message "a method".
99
+ end constructor.`;
100
+
101
+ let expectedTokens = [
102
+ [
103
+ { "startIndex": 0, "endIndex": 11, "scopes": ["source.abl", "meta.define.method.abl", "keyword.other.abl"] }, // 'constructor'
104
+ { "startIndex": 11, "endIndex": 12, "scopes": ["source.abl", "meta.define.method.abl"] }, // ' '
105
+ { "startIndex": 12, "endIndex": 19, "scopes": ["source.abl", "meta.define.method.abl", "keyword.other.abl"] }, // 'private'
106
+ { "startIndex": 19, "endIndex": 20, "scopes": ["source.abl", "meta.define.method.abl"] }, // ' '
107
+ { "startIndex": 20, "endIndex": 26, "scopes": ["source.abl", "meta.define.method.abl", "entity.name.function.abl"] }, // 'ClassB'
108
+ { "startIndex": 26, "endIndex": 27, "scopes": ["source.abl", "meta.define.method.abl", "meta.brace.round.js"] }, // '('
109
+ { "startIndex": 27, "endIndex": 28, "scopes": ["source.abl", "meta.define.method.abl"] }, // ' '
110
+ { "startIndex": 28, "endIndex": 30, "scopes": ["source.abl", "meta.define.method.abl", "variable.parameter.abl"] }, // 'po'
111
+ { "startIndex": 30, "endIndex": 31, "scopes": ["source.abl", "meta.define.method.abl"] }, // ' '
112
+ { "startIndex": 31, "endIndex": 33, "scopes": ["source.abl", "meta.define.method.abl", "keyword.other.abl"] }, // 'as'
113
+ { "startIndex": 33, "endIndex": 34, "scopes": ["source.abl", "meta.define.method.abl"] }, // ' '
114
+ { "startIndex": 34, "endIndex": 38, "scopes": ["source.abl", "meta.define.method.abl", "entity.name.type.generic.abl", "entity.name.type.abl"] }, // 'List'
115
+ { "startIndex": 38, "endIndex": 39, "scopes": ["source.abl", "meta.define.method.abl", "entity.name.type.generic.abl"] }, // '<'
116
+ { "startIndex": 39, "endIndex": 52, "scopes": ["source.abl", "meta.define.method.abl", "entity.name.type.generic.abl", "entity.name.type.abl"] }, // 'Package.Thing'
117
+ { "startIndex": 52, "endIndex": 53, "scopes": ["source.abl", "meta.define.method.abl", "entity.name.type.generic.abl"] }, // '>'
118
+ { "startIndex": 53, "endIndex": 54, "scopes": ["source.abl", "meta.define.method.abl", "punctuation.separator.comma.abl"] } // ','
119
+ ],
120
+ [
121
+ { "startIndex": 0, "endIndex": 52, "scopes": ["source.abl", "meta.define.method.abl"] }, // ' '
122
+ { "startIndex": 52, "endIndex": 58, "scopes": ["source.abl", "meta.define.method.abl", "keyword.other.abl"] }, // 'buffer'
123
+ { "startIndex": 58, "endIndex": 59, "scopes": ["source.abl", "meta.define.method.abl"] }, // ' '
124
+ { "startIndex": 59, "endIndex": 61, "scopes": ["source.abl", "meta.define.method.abl", "storage.data.table.abl"] }, // 'pb'
125
+ { "startIndex": 61, "endIndex": 62, "scopes": ["source.abl", "meta.define.method.abl"] }, // ' '
126
+ { "startIndex": 62, "endIndex": 65, "scopes": ["source.abl", "meta.define.method.abl", "keyword.other.abl"] }, // 'for'
127
+ { "startIndex": 65, "endIndex": 66, "scopes": ["source.abl", "meta.define.method.abl"] }, // ' '
128
+ { "startIndex": 66, "endIndex": 75, "scopes": ["source.abl", "meta.define.method.abl", "storage.data.table.abl"] }, // 'TableName'
129
+ { "startIndex": 75, "endIndex": 76, "scopes": ["source.abl", "meta.define.method.abl", "punctuation.separator.comma.abl"] } // ','
130
+ ],
131
+ [
132
+ { "startIndex": 0, "endIndex": 52, "scopes": ["source.abl", "meta.define.method.abl"] }, // ' '
133
+ { "startIndex": 52, "endIndex": 64, "scopes": ["source.abl", "meta.define.method.abl", "keyword.other.abl"] }, // 'input-output'
134
+ { "startIndex": 64, "endIndex": 65, "scopes": ["source.abl", "meta.define.method.abl"] }, // ' '
135
+ { "startIndex": 65, "endIndex": 72, "scopes": ["source.abl", "meta.define.method.abl", "keyword.other.abl"] }, // 'dataset'
136
+ { "startIndex": 72, "endIndex": 73, "scopes": ["source.abl", "meta.define.method.abl"] }, // ' '
137
+ { "startIndex": 73, "endIndex": 79, "scopes": ["source.abl", "meta.define.method.abl", "storage.data.table.abl"] }, // 'dsData'
138
+ { "startIndex": 79, "endIndex": 80, "scopes": ["source.abl", "meta.define.method.abl", "meta.brace.round.js"] }, // ')'
139
+ { "startIndex": 80, "endIndex": 81, "scopes": ["source.abl", "punctuation.terminator.abl"] } // ':'
140
+ ],
141
+ [
142
+ { "startIndex": 0, "endIndex": 4, "scopes": ["source.abl", "meta.define.abl"] }, // ' '
143
+ { "startIndex": 4, "endIndex": 10, "scopes": ["source.abl", "meta.define.abl", "keyword.other.abl"] }, // 'define'
144
+ { "startIndex": 10, "endIndex": 11, "scopes": ["source.abl", "meta.define.abl"] }, // ' '
145
+ { "startIndex": 11, "endIndex": 19, "scopes": ["source.abl", "meta.define.abl", "keyword.other.abl"] }, // 'variable'
146
+ { "startIndex": 19, "endIndex": 20, "scopes": ["source.abl", "meta.define.abl"] }, // ' '
147
+ { "startIndex": 20, "endIndex": 24, "scopes": ["source.abl", "meta.define.abl", "variable.other.abl"] }, // 'log1'
148
+ { "startIndex": 24, "endIndex": 25, "scopes": ["source.abl", "meta.define.abl"] }, // ' '
149
+ { "startIndex": 25, "endIndex": 27, "scopes": ["source.abl", "meta.define.abl", "keyword.other.abl"] }, // 'as'
150
+ { "startIndex": 27, "endIndex": 28, "scopes": ["source.abl", "meta.define.abl"] }, // ' '
151
+ { "startIndex": 28, "endIndex": 35, "scopes": ["source.abl", "meta.define.abl", "storage.type.abl"] }, // 'logical'
152
+ { "startIndex": 35, "endIndex": 36, "scopes": ["source.abl", "meta.define.abl", "punctuation.terminator.abl"] } // '.'
153
+ ],
154
+ [
155
+ { "startIndex": 0, "endIndex": 1, "scopes": ["source.abl"] } // ''
156
+ ],
157
+ [
158
+ { "startIndex": 0, "endIndex": 4, "scopes": ["source.abl"] }, // ' '
159
+ { "startIndex": 4, "endIndex": 11, "scopes": ["source.abl", "keyword.other.abl"] }, // 'message'
160
+ { "startIndex": 11, "endIndex": 12, "scopes": ["source.abl"] }, // ' '
161
+ { "startIndex": 12, "endIndex": 13, "scopes": ["source.abl", "string.double.complex.abl", "punctuation.definition.string.begin.abl"] }, // '"'
162
+ { "startIndex": 13, "endIndex": 21, "scopes": ["source.abl", "string.double.complex.abl"] }, // 'a method'
163
+ { "startIndex": 21, "endIndex": 22, "scopes": ["source.abl", "string.double.complex.abl", "punctuation.definition.string.end.abl"] }, // '"'
164
+ { "startIndex": 22, "endIndex": 23, "scopes": ["source.abl", "punctuation.terminator.abl"] } // '.'
165
+ ],
166
+ [
167
+ { "startIndex": 0, "endIndex": 3, "scopes": ["source.abl", "keyword.other.abl"] }, // 'end'
168
+ { "startIndex": 3, "endIndex": 4, "scopes": ["source.abl"] }, // ' '
169
+ { "startIndex": 4, "endIndex": 15, "scopes": ["source.abl", "keyword.other.abl"] }, // 'constructor'
170
+ { "startIndex": 15, "endIndex": 16, "scopes": ["source.abl", "punctuation.terminator.abl"] } // '.'
171
+ ]
172
+ ];
173
+ shared.itShouldMatchExpectedScopes(statement, expectedTokens);
174
+ })