abl-tmlanguage 1.3.4 → 1.3.5
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/abl-functions.txt +548 -0
- package/abl-keywords.txt +416 -0
- package/abl-methods.txt +1053 -0
- package/abl.tmLanguage.json +147 -12
- package/index.js +83 -59
- package/package.json +1 -1
- package/spec/blocks/block-labels.spec.js +25 -0
- package/spec/define-temp-table/define-dataset.spec.js +145 -0
- package/spec/define-temp-table/{define-index.spec.js → define-temp-table.spec.js} +81 -0
- package/spec/for-each/vscode-abl.issue#166.spec.js +83 -0
- package/spec/function-definition/vscode-abl-issue#166.spec.js +446 -0
- package/spec/misc-statements/record-buffer-functions.spec.js +73 -0
- package/spec/misc-statements/return-statement.spec.js +11 -0
- package/spec/operators/operators.spec.js +71 -0
|
@@ -0,0 +1,446 @@
|
|
|
1
|
+
const { assert, expect } = require('chai');
|
|
2
|
+
const shared = require('../shared.js');
|
|
3
|
+
|
|
4
|
+
describe('', () => {
|
|
5
|
+
let statement = `FUNCTION operationName logical:
|
|
6
|
+
end function.`;
|
|
7
|
+
|
|
8
|
+
let expectedTokens = [
|
|
9
|
+
[
|
|
10
|
+
{ "startIndex": 0, "endIndex": 8, "scopes": ["source.abl", "meta.define.function.abl", "keyword.other.abl"] }, // 'FUNCTION'
|
|
11
|
+
{ "startIndex": 8, "endIndex": 9, "scopes": ["source.abl", "meta.define.function.abl"] }, // ' '
|
|
12
|
+
{ "startIndex": 9, "endIndex": 22, "scopes": ["source.abl", "meta.define.function.abl", "entity.name.function.abl"] }, // 'operationName'
|
|
13
|
+
{ "startIndex": 22, "endIndex": 23, "scopes": ["source.abl", "meta.define.function.abl"] }, // ' '
|
|
14
|
+
{ "startIndex": 23, "endIndex": 30, "scopes": ["source.abl", "meta.define.function.abl", "storage.type.abl"] }, // 'logical'
|
|
15
|
+
{ "startIndex": 30, "endIndex": 31, "scopes": ["source.abl", "meta.define.function.abl", "punctuation.terminator.abl"] } // ':'
|
|
16
|
+
],
|
|
17
|
+
[
|
|
18
|
+
{ "startIndex": 0, "endIndex": 3, "scopes": ["source.abl", "keyword.other.abl"] }, // 'end'
|
|
19
|
+
{ "startIndex": 3, "endIndex": 4, "scopes": ["source.abl"] }, // ' '
|
|
20
|
+
{ "startIndex": 4, "endIndex": 12, "scopes": ["source.abl", "keyword.other.abl"] }, // 'function'
|
|
21
|
+
{ "startIndex": 12, "endIndex": 13, "scopes": ["source.abl", "punctuation.terminator.abl"] } // '.'
|
|
22
|
+
]
|
|
23
|
+
];
|
|
24
|
+
shared.itShouldMatchExpectedScopes(statement, expectedTokens);
|
|
25
|
+
})
|
|
26
|
+
|
|
27
|
+
describe('', () => {
|
|
28
|
+
let statement = `FUNCTION operationName RETURNS logical ( p1 as char, output p4 as char extent 4 ) IN hPortType .
|
|
29
|
+
end.`;
|
|
30
|
+
|
|
31
|
+
let expectedTokens = [
|
|
32
|
+
[
|
|
33
|
+
{ "startIndex": 0, "endIndex": 8, "scopes": ["source.abl", "meta.define.function.abl", "keyword.other.abl"] }, // 'FUNCTION'
|
|
34
|
+
{ "startIndex": 8, "endIndex": 9, "scopes": ["source.abl", "meta.define.function.abl"] }, // ' '
|
|
35
|
+
{ "startIndex": 9, "endIndex": 22, "scopes": ["source.abl", "meta.define.function.abl", "entity.name.function.abl"] }, // 'operationName'
|
|
36
|
+
{ "startIndex": 22, "endIndex": 23, "scopes": ["source.abl", "meta.define.function.abl"] }, // ' '
|
|
37
|
+
{ "startIndex": 23, "endIndex": 30, "scopes": ["source.abl", "meta.define.function.abl", "keyword.other.abl"] }, // 'RETURNS'
|
|
38
|
+
{ "startIndex": 30, "endIndex": 31, "scopes": ["source.abl", "meta.define.function.abl"] }, // ' '
|
|
39
|
+
{ "startIndex": 31, "endIndex": 38, "scopes": ["source.abl", "meta.define.function.abl", "storage.type.abl"] }, // 'logical'
|
|
40
|
+
{ "startIndex": 38, "endIndex": 40, "scopes": ["source.abl", "meta.define.function.abl"] }, // ' '
|
|
41
|
+
{ "startIndex": 40, "endIndex": 41, "scopes": ["source.abl", "meta.define.function.abl", "meta.function.parameters", "meta.brace.round.js"] }, // '('
|
|
42
|
+
{ "startIndex": 41, "endIndex": 42, "scopes": ["source.abl", "meta.define.function.abl", "meta.function.parameters"] }, // ' '
|
|
43
|
+
{ "startIndex": 42, "endIndex": 44, "scopes": ["source.abl", "meta.define.function.abl", "meta.function.parameters", "variable.parameter.abl"] }, // 'p1'
|
|
44
|
+
{ "startIndex": 44, "endIndex": 45, "scopes": ["source.abl", "meta.define.function.abl", "meta.function.parameters"] }, // ' '
|
|
45
|
+
{ "startIndex": 45, "endIndex": 47, "scopes": ["source.abl", "meta.define.function.abl", "meta.function.parameters", "keyword.other.abl"] }, // 'as'
|
|
46
|
+
{ "startIndex": 47, "endIndex": 48, "scopes": ["source.abl", "meta.define.function.abl", "meta.function.parameters"] }, // ' '
|
|
47
|
+
{ "startIndex": 48, "endIndex": 52, "scopes": ["source.abl", "meta.define.function.abl", "meta.function.parameters", "storage.type.abl"] }, // 'char'
|
|
48
|
+
{ "startIndex": 52, "endIndex": 53, "scopes": ["source.abl", "meta.define.function.abl", "meta.function.parameters", "punctuation.separator.comma.abl"] }, // ','
|
|
49
|
+
{ "startIndex": 53, "endIndex": 54, "scopes": ["source.abl", "meta.define.function.abl", "meta.function.parameters"] }, // ' '
|
|
50
|
+
{ "startIndex": 54, "endIndex": 60, "scopes": ["source.abl", "meta.define.function.abl", "meta.function.parameters", "keyword.other.abl"] }, // 'output'
|
|
51
|
+
{ "startIndex": 60, "endIndex": 61, "scopes": ["source.abl", "meta.define.function.abl", "meta.function.parameters"] }, // ' '
|
|
52
|
+
{ "startIndex": 61, "endIndex": 63, "scopes": ["source.abl", "meta.define.function.abl", "meta.function.parameters", "variable.parameter.abl"] }, // 'p4'
|
|
53
|
+
{ "startIndex": 63, "endIndex": 64, "scopes": ["source.abl", "meta.define.function.abl", "meta.function.parameters"] }, // ' '
|
|
54
|
+
{ "startIndex": 64, "endIndex": 66, "scopes": ["source.abl", "meta.define.function.abl", "meta.function.parameters", "keyword.other.abl"] }, // 'as'
|
|
55
|
+
{ "startIndex": 66, "endIndex": 67, "scopes": ["source.abl", "meta.define.function.abl", "meta.function.parameters"] }, // ' '
|
|
56
|
+
{ "startIndex": 67, "endIndex": 71, "scopes": ["source.abl", "meta.define.function.abl", "meta.function.parameters", "storage.type.abl"] }, // 'char'
|
|
57
|
+
{ "startIndex": 71, "endIndex": 72, "scopes": ["source.abl", "meta.define.function.abl", "meta.function.parameters"] }, // ' '
|
|
58
|
+
{ "startIndex": 72, "endIndex": 78, "scopes": ["source.abl", "meta.define.function.abl", "meta.function.parameters", "keyword.other.abl"] }, // 'extent'
|
|
59
|
+
{ "startIndex": 78, "endIndex": 79, "scopes": ["source.abl", "meta.define.function.abl", "meta.function.parameters"] }, // ' '
|
|
60
|
+
{ "startIndex": 79, "endIndex": 80, "scopes": ["source.abl", "meta.define.function.abl", "meta.function.parameters", "constant.numeric.source.abl"] }, // '4'
|
|
61
|
+
{ "startIndex": 80, "endIndex": 81, "scopes": ["source.abl", "meta.define.function.abl", "meta.function.parameters"] }, // ' '
|
|
62
|
+
{ "startIndex": 81, "endIndex": 82, "scopes": ["source.abl", "meta.define.function.abl", "meta.function.parameters", "meta.brace.round.js"] }, // ')'
|
|
63
|
+
{ "startIndex": 82, "endIndex": 84, "scopes": ["source.abl", "meta.define.function.abl"] }, // ' '
|
|
64
|
+
{ "startIndex": 84, "endIndex": 86, "scopes": ["source.abl", "meta.define.function.abl", "keyword.other.abl"] }, // 'IN'
|
|
65
|
+
{ "startIndex": 86, "endIndex": 87, "scopes": ["source.abl", "meta.define.function.abl"] }, // ' '
|
|
66
|
+
{ "startIndex": 87, "endIndex": 96, "scopes": ["source.abl", "meta.define.function.abl", "variable.other.abl"] }, // 'hPortType'
|
|
67
|
+
{ "startIndex": 96, "endIndex": 97, "scopes": ["source.abl", "meta.define.function.abl"] }, // ' '
|
|
68
|
+
{ "startIndex": 97, "endIndex": 98, "scopes": ["source.abl", "meta.define.function.abl", "punctuation.terminator.abl"] } // '.'
|
|
69
|
+
],
|
|
70
|
+
[
|
|
71
|
+
{ "startIndex": 0, "endIndex": 3, "scopes": ["source.abl", "keyword.other.abl"] }, // 'end'
|
|
72
|
+
{ "startIndex": 3, "endIndex": 4, "scopes": ["source.abl", "punctuation.terminator.abl"] } // '.'
|
|
73
|
+
]
|
|
74
|
+
];
|
|
75
|
+
shared.itShouldMatchExpectedScopes(statement, expectedTokens);
|
|
76
|
+
})
|
|
77
|
+
|
|
78
|
+
describe('', () => {
|
|
79
|
+
let statement = `FUNCTION operationName logical IN hPortType .
|
|
80
|
+
end.`;
|
|
81
|
+
|
|
82
|
+
let expectedTokens = [
|
|
83
|
+
[
|
|
84
|
+
{ "startIndex": 0, "endIndex": 8, "scopes": ["source.abl", "meta.define.function.abl", "keyword.other.abl"] }, // 'FUNCTION'
|
|
85
|
+
{ "startIndex": 8, "endIndex": 9, "scopes": ["source.abl", "meta.define.function.abl"] }, // ' '
|
|
86
|
+
{ "startIndex": 9, "endIndex": 22, "scopes": ["source.abl", "meta.define.function.abl", "entity.name.function.abl"] }, // 'operationName'
|
|
87
|
+
{ "startIndex": 22, "endIndex": 24, "scopes": ["source.abl", "meta.define.function.abl"] }, // ' '
|
|
88
|
+
{ "startIndex": 24, "endIndex": 31, "scopes": ["source.abl", "meta.define.function.abl", "storage.type.abl"] }, // 'logical'
|
|
89
|
+
{ "startIndex": 31, "endIndex": 32, "scopes": ["source.abl", "meta.define.function.abl"] }, // ' '
|
|
90
|
+
{ "startIndex": 32, "endIndex": 34, "scopes": ["source.abl", "meta.define.function.abl", "keyword.other.abl"] }, // 'IN'
|
|
91
|
+
{ "startIndex": 34, "endIndex": 35, "scopes": ["source.abl", "meta.define.function.abl"] }, // ' '
|
|
92
|
+
{ "startIndex": 35, "endIndex": 44, "scopes": ["source.abl", "meta.define.function.abl", "variable.other.abl"] }, // 'hPortType'
|
|
93
|
+
{ "startIndex": 44, "endIndex": 45, "scopes": ["source.abl", "meta.define.function.abl"] }, // ' '
|
|
94
|
+
{ "startIndex": 45, "endIndex": 46, "scopes": ["source.abl", "meta.define.function.abl", "punctuation.terminator.abl"] } // '.'
|
|
95
|
+
],
|
|
96
|
+
[
|
|
97
|
+
{ "startIndex": 0, "endIndex": 3, "scopes": ["source.abl", "keyword.other.abl"] }, // 'end'
|
|
98
|
+
{ "startIndex": 3, "endIndex": 4, "scopes": ["source.abl", "punctuation.terminator.abl"] } // '.'
|
|
99
|
+
]
|
|
100
|
+
];
|
|
101
|
+
shared.itShouldMatchExpectedScopes(statement, expectedTokens);
|
|
102
|
+
})
|
|
103
|
+
|
|
104
|
+
describe('', () => {
|
|
105
|
+
let statement = `// scope (function): variable.other.abl source.abl
|
|
106
|
+
function DoTheThing returns character
|
|
107
|
+
(
|
|
108
|
+
):
|
|
109
|
+
|
|
110
|
+
end function.`;
|
|
111
|
+
|
|
112
|
+
let expectedTokens = [
|
|
113
|
+
[
|
|
114
|
+
{ "startIndex": 0, "endIndex": 50, "scopes": ["source.abl", "comment.line.double-slash.abl"] } // '// scope (function): variable.other.abl source.abl'
|
|
115
|
+
],
|
|
116
|
+
[
|
|
117
|
+
{ "startIndex": 0, "endIndex": 8, "scopes": ["source.abl", "meta.define.function.abl", "keyword.other.abl"] }, // 'function'
|
|
118
|
+
{ "startIndex": 8, "endIndex": 9, "scopes": ["source.abl", "meta.define.function.abl"] }, // ' '
|
|
119
|
+
{ "startIndex": 9, "endIndex": 19, "scopes": ["source.abl", "meta.define.function.abl", "entity.name.function.abl"] }, // 'DoTheThing'
|
|
120
|
+
{ "startIndex": 19, "endIndex": 20, "scopes": ["source.abl", "meta.define.function.abl"] }, // ' '
|
|
121
|
+
{ "startIndex": 20, "endIndex": 27, "scopes": ["source.abl", "meta.define.function.abl", "keyword.other.abl"] }, // 'returns'
|
|
122
|
+
{ "startIndex": 27, "endIndex": 28, "scopes": ["source.abl", "meta.define.function.abl"] }, // ' '
|
|
123
|
+
{ "startIndex": 28, "endIndex": 37, "scopes": ["source.abl", "meta.define.function.abl", "storage.type.abl"] } // 'character'
|
|
124
|
+
],
|
|
125
|
+
[
|
|
126
|
+
{ "startIndex": 0, "endIndex": 4, "scopes": ["source.abl", "meta.define.function.abl"] }, // ' '
|
|
127
|
+
{ "startIndex": 4, "endIndex": 5, "scopes": ["source.abl", "meta.define.function.abl", "meta.function.parameters", "meta.brace.round.js"] } // '('
|
|
128
|
+
],
|
|
129
|
+
[
|
|
130
|
+
{ "startIndex": 0, "endIndex": 4, "scopes": ["source.abl", "meta.define.function.abl", "meta.function.parameters"] }, // ' '
|
|
131
|
+
{ "startIndex": 4, "endIndex": 5, "scopes": ["source.abl", "meta.define.function.abl", "meta.function.parameters", "meta.brace.round.js"] }, // ')'
|
|
132
|
+
{ "startIndex": 5, "endIndex": 6, "scopes": ["source.abl", "meta.define.function.abl", "punctuation.terminator.abl"] } // ':'
|
|
133
|
+
],
|
|
134
|
+
[
|
|
135
|
+
{ "startIndex": 0, "endIndex": 1, "scopes": ["source.abl"] } // ''
|
|
136
|
+
],
|
|
137
|
+
[
|
|
138
|
+
{ "startIndex": 0, "endIndex": 3, "scopes": ["source.abl", "keyword.other.abl"] }, // 'end'
|
|
139
|
+
{ "startIndex": 3, "endIndex": 4, "scopes": ["source.abl"] }, // ' '
|
|
140
|
+
{ "startIndex": 4, "endIndex": 12, "scopes": ["source.abl", "keyword.other.abl"] }, // 'function'
|
|
141
|
+
{ "startIndex": 12, "endIndex": 13, "scopes": ["source.abl", "punctuation.terminator.abl"] } // '.'
|
|
142
|
+
]
|
|
143
|
+
];
|
|
144
|
+
shared.itShouldMatchExpectedScopes(statement, expectedTokens);
|
|
145
|
+
})
|
|
146
|
+
|
|
147
|
+
describe('', () => {
|
|
148
|
+
let statement = `function DoTheThing returns Progress.Lang.Object extent 3 ( ):
|
|
149
|
+
end function.`;
|
|
150
|
+
|
|
151
|
+
let expectedTokens = [
|
|
152
|
+
[
|
|
153
|
+
{ "startIndex": 0, "endIndex": 8, "scopes": ["source.abl", "meta.define.function.abl", "keyword.other.abl"] }, // 'function'
|
|
154
|
+
{ "startIndex": 8, "endIndex": 9, "scopes": ["source.abl", "meta.define.function.abl"] }, // ' '
|
|
155
|
+
{ "startIndex": 9, "endIndex": 19, "scopes": ["source.abl", "meta.define.function.abl", "entity.name.function.abl"] }, // 'DoTheThing'
|
|
156
|
+
{ "startIndex": 19, "endIndex": 20, "scopes": ["source.abl", "meta.define.function.abl"] }, // ' '
|
|
157
|
+
{ "startIndex": 20, "endIndex": 27, "scopes": ["source.abl", "meta.define.function.abl", "keyword.other.abl"] }, // 'returns'
|
|
158
|
+
{ "startIndex": 27, "endIndex": 28, "scopes": ["source.abl", "meta.define.function.abl"] }, // ' '
|
|
159
|
+
{ "startIndex": 28, "endIndex": 48, "scopes": ["source.abl", "meta.define.function.abl", "entity.name.type.abl"] }, // 'Progress.Lang.Object'
|
|
160
|
+
{ "startIndex": 48, "endIndex": 49, "scopes": ["source.abl", "meta.define.function.abl"] }, // ' '
|
|
161
|
+
{ "startIndex": 49, "endIndex": 55, "scopes": ["source.abl", "meta.define.function.abl", "keyword.other.abl"] }, // 'extent'
|
|
162
|
+
{ "startIndex": 55, "endIndex": 56, "scopes": ["source.abl", "meta.define.function.abl"] }, // ' '
|
|
163
|
+
{ "startIndex": 56, "endIndex": 57, "scopes": ["source.abl", "meta.define.function.abl", "entity.name.type.abl"] }, // '3'
|
|
164
|
+
{ "startIndex": 57, "endIndex": 58, "scopes": ["source.abl", "meta.define.function.abl"] }, // ' '
|
|
165
|
+
{ "startIndex": 58, "endIndex": 59, "scopes": ["source.abl", "meta.define.function.abl", "meta.function.parameters", "meta.brace.round.js"] }, // '('
|
|
166
|
+
{ "startIndex": 59, "endIndex": 60, "scopes": ["source.abl", "meta.define.function.abl", "meta.function.parameters"] }, // ' '
|
|
167
|
+
{ "startIndex": 60, "endIndex": 61, "scopes": ["source.abl", "meta.define.function.abl", "meta.function.parameters", "meta.brace.round.js"] }, // ')'
|
|
168
|
+
{ "startIndex": 61, "endIndex": 62, "scopes": ["source.abl", "meta.define.function.abl", "punctuation.terminator.abl"] }, // ':'
|
|
169
|
+
],
|
|
170
|
+
[
|
|
171
|
+
{ "startIndex": 0, "endIndex": 3, "scopes": ["source.abl", "keyword.other.abl"] }, // 'end'
|
|
172
|
+
{ "startIndex": 3, "endIndex": 4, "scopes": ["source.abl"] }, // ' '
|
|
173
|
+
{ "startIndex": 4, "endIndex": 12, "scopes": ["source.abl", "keyword.other.abl"] }, // 'function'
|
|
174
|
+
{ "startIndex": 12, "endIndex": 13, "scopes": ["source.abl", "punctuation.terminator.abl"] }, // '.'
|
|
175
|
+
]
|
|
176
|
+
];
|
|
177
|
+
shared.itShouldMatchExpectedScopes(statement, expectedTokens);
|
|
178
|
+
})
|
|
179
|
+
|
|
180
|
+
describe('', () => {
|
|
181
|
+
let statement = `function NoThing returns class String ( ):
|
|
182
|
+
end function.`;
|
|
183
|
+
|
|
184
|
+
let expectedTokens = [
|
|
185
|
+
[
|
|
186
|
+
{ "startIndex": 0, "endIndex": 8, "scopes": ["source.abl", "meta.define.function.abl", "keyword.other.abl"] }, // 'function'
|
|
187
|
+
{ "startIndex": 8, "endIndex": 9, "scopes": ["source.abl", "meta.define.function.abl"] }, // ' '
|
|
188
|
+
{ "startIndex": 9, "endIndex": 16, "scopes": ["source.abl", "meta.define.function.abl", "entity.name.function.abl"] }, // 'NoThing'
|
|
189
|
+
{ "startIndex": 16, "endIndex": 17, "scopes": ["source.abl", "meta.define.function.abl"] }, // ' '
|
|
190
|
+
{ "startIndex": 17, "endIndex": 24, "scopes": ["source.abl", "meta.define.function.abl", "keyword.other.abl"] }, // 'returns'
|
|
191
|
+
{ "startIndex": 24, "endIndex": 25, "scopes": ["source.abl", "meta.define.function.abl"] }, // ' '
|
|
192
|
+
{ "startIndex": 25, "endIndex": 30, "scopes": ["source.abl", "meta.define.function.abl", "keyword.other.abl"] }, // 'class'
|
|
193
|
+
{ "startIndex": 30, "endIndex": 31, "scopes": ["source.abl", "meta.define.function.abl"] }, // ' '
|
|
194
|
+
{ "startIndex": 31, "endIndex": 37, "scopes": ["source.abl", "meta.define.function.abl", "entity.name.type.abl"] }, // 'String'
|
|
195
|
+
{ "startIndex": 37, "endIndex": 38, "scopes": ["source.abl", "meta.define.function.abl"] }, // ' '
|
|
196
|
+
{ "startIndex": 38, "endIndex": 39, "scopes": ["source.abl", "meta.define.function.abl", "meta.function.parameters", "meta.brace.round.js"] }, // '('
|
|
197
|
+
{ "startIndex": 39, "endIndex": 40, "scopes": ["source.abl", "meta.define.function.abl", "meta.function.parameters"] }, // ' '
|
|
198
|
+
{ "startIndex": 40, "endIndex": 41, "scopes": ["source.abl", "meta.define.function.abl", "meta.function.parameters", "meta.brace.round.js"] }, // ')'
|
|
199
|
+
{ "startIndex": 41, "endIndex": 42, "scopes": ["source.abl", "meta.define.function.abl", "punctuation.terminator.abl"] } // ':'
|
|
200
|
+
],
|
|
201
|
+
[
|
|
202
|
+
{ "startIndex": 0, "endIndex": 3, "scopes": ["source.abl", "keyword.other.abl"] }, // 'end'
|
|
203
|
+
{ "startIndex": 3, "endIndex": 4, "scopes": ["source.abl"] }, // ' '
|
|
204
|
+
{ "startIndex": 4, "endIndex": 12, "scopes": ["source.abl", "keyword.other.abl"] }, // 'function'
|
|
205
|
+
{ "startIndex": 12, "endIndex": 13, "scopes": ["source.abl", "punctuation.terminator.abl"] } // '.'
|
|
206
|
+
]
|
|
207
|
+
];
|
|
208
|
+
shared.itShouldMatchExpectedScopes(statement, expectedTokens);
|
|
209
|
+
})
|
|
210
|
+
|
|
211
|
+
describe('', () => {
|
|
212
|
+
let statement = `function NoThing returns String ( ):
|
|
213
|
+
end function.`;
|
|
214
|
+
|
|
215
|
+
let expectedTokens = [
|
|
216
|
+
[
|
|
217
|
+
{ "startIndex": 0, "endIndex": 8, "scopes": ["source.abl", "meta.define.function.abl", "keyword.other.abl"] }, // 'function'
|
|
218
|
+
{ "startIndex": 8, "endIndex": 9, "scopes": ["source.abl", "meta.define.function.abl"] }, // ' '
|
|
219
|
+
{ "startIndex": 9, "endIndex": 16, "scopes": ["source.abl", "meta.define.function.abl", "entity.name.function.abl"] }, // 'NoThing'
|
|
220
|
+
{ "startIndex": 16, "endIndex": 17, "scopes": ["source.abl", "meta.define.function.abl"] }, // ' '
|
|
221
|
+
{ "startIndex": 17, "endIndex": 24, "scopes": ["source.abl", "meta.define.function.abl", "keyword.other.abl"] }, // 'returns'
|
|
222
|
+
{ "startIndex": 24, "endIndex": 25, "scopes": ["source.abl", "meta.define.function.abl"] }, // ' '
|
|
223
|
+
{ "startIndex": 25, "endIndex": 31, "scopes": ["source.abl", "meta.define.function.abl", "entity.name.type.abl"] }, // 'String'
|
|
224
|
+
{ "startIndex": 31, "endIndex": 32, "scopes": ["source.abl", "meta.define.function.abl"] }, // ' '
|
|
225
|
+
{ "startIndex": 32, "endIndex": 33, "scopes": ["source.abl", "meta.define.function.abl", "meta.function.parameters", "meta.brace.round.js"] }, // '('
|
|
226
|
+
{ "startIndex": 33, "endIndex": 34, "scopes": ["source.abl", "meta.define.function.abl", "meta.function.parameters"] }, // ' '
|
|
227
|
+
{ "startIndex": 34, "endIndex": 35, "scopes": ["source.abl", "meta.define.function.abl", "meta.function.parameters", "meta.brace.round.js"] }, // ')'
|
|
228
|
+
{ "startIndex": 35, "endIndex": 36, "scopes": ["source.abl", "meta.define.function.abl", "punctuation.terminator.abl"] } // ':'
|
|
229
|
+
],
|
|
230
|
+
[
|
|
231
|
+
{ "startIndex": 0, "endIndex": 3, "scopes": ["source.abl", "keyword.other.abl"] }, // 'end'
|
|
232
|
+
{ "startIndex": 3, "endIndex": 4, "scopes": ["source.abl"] }, // ' '
|
|
233
|
+
{ "startIndex": 4, "endIndex": 12, "scopes": ["source.abl", "keyword.other.abl"] }, // 'function'
|
|
234
|
+
{ "startIndex": 12, "endIndex": 13, "scopes": ["source.abl", "punctuation.terminator.abl"] } // '.'
|
|
235
|
+
]
|
|
236
|
+
];
|
|
237
|
+
shared.itShouldMatchExpectedScopes(statement, expectedTokens);
|
|
238
|
+
})
|
|
239
|
+
|
|
240
|
+
describe('', () => {
|
|
241
|
+
let statement = `FUNCTION 4gl-encode RETURNS CHARACTER (INPUT p_string AS CHAR) :
|
|
242
|
+
RETURN
|
|
243
|
+
p_string .
|
|
244
|
+
END FUNCTION.`;
|
|
245
|
+
|
|
246
|
+
let expectedTokens = [
|
|
247
|
+
[
|
|
248
|
+
{ "startIndex": 0, "endIndex": 8, "scopes": ["source.abl", "meta.define.function.abl", "keyword.other.abl"] }, // 'FUNCTION'
|
|
249
|
+
{ "startIndex": 8, "endIndex": 9, "scopes": ["source.abl", "meta.define.function.abl"] }, // ' '
|
|
250
|
+
{ "startIndex": 9, "endIndex": 19, "scopes": ["source.abl", "meta.define.function.abl", "entity.name.function.abl"] }, // '4gl-encode'
|
|
251
|
+
{ "startIndex": 19, "endIndex": 20, "scopes": ["source.abl", "meta.define.function.abl"] }, // ' '
|
|
252
|
+
{ "startIndex": 20, "endIndex": 27, "scopes": ["source.abl", "meta.define.function.abl", "keyword.other.abl"] }, // 'RETURNS'
|
|
253
|
+
{ "startIndex": 27, "endIndex": 28, "scopes": ["source.abl", "meta.define.function.abl"] }, // ' '
|
|
254
|
+
{ "startIndex": 28, "endIndex": 37, "scopes": ["source.abl", "meta.define.function.abl", "storage.type.abl"] }, // 'CHARACTER'
|
|
255
|
+
{ "startIndex": 37, "endIndex": 38, "scopes": ["source.abl", "meta.define.function.abl"] }, // ' '
|
|
256
|
+
{ "startIndex": 38, "endIndex": 39, "scopes": ["source.abl", "meta.define.function.abl", "meta.function.parameters", "meta.brace.round.js"] }, // '('
|
|
257
|
+
{ "startIndex": 39, "endIndex": 44, "scopes": ["source.abl", "meta.define.function.abl", "meta.function.parameters", "keyword.other.abl"] }, // 'INPUT'
|
|
258
|
+
{ "startIndex": 44, "endIndex": 45, "scopes": ["source.abl", "meta.define.function.abl", "meta.function.parameters"] }, // ' '
|
|
259
|
+
{ "startIndex": 45, "endIndex": 53, "scopes": ["source.abl", "meta.define.function.abl", "meta.function.parameters", "variable.parameter.abl"] }, // 'p_string'
|
|
260
|
+
{ "startIndex": 53, "endIndex": 54, "scopes": ["source.abl", "meta.define.function.abl", "meta.function.parameters"] }, // ' '
|
|
261
|
+
{ "startIndex": 54, "endIndex": 56, "scopes": ["source.abl", "meta.define.function.abl", "meta.function.parameters", "keyword.other.abl"] }, // 'AS'
|
|
262
|
+
{ "startIndex": 56, "endIndex": 57, "scopes": ["source.abl", "meta.define.function.abl", "meta.function.parameters"] }, // ' '
|
|
263
|
+
{ "startIndex": 57, "endIndex": 61, "scopes": ["source.abl", "meta.define.function.abl", "meta.function.parameters", "storage.type.abl"] }, // 'CHAR'
|
|
264
|
+
{ "startIndex": 61, "endIndex": 62, "scopes": ["source.abl", "meta.define.function.abl", "meta.function.parameters", "meta.brace.round.js"] }, // ')'
|
|
265
|
+
{ "startIndex": 62, "endIndex": 63, "scopes": ["source.abl", "meta.define.function.abl"] }, // ' '
|
|
266
|
+
{ "startIndex": 63, "endIndex": 64, "scopes": ["source.abl", "meta.define.function.abl", "punctuation.terminator.abl"] } // ':'
|
|
267
|
+
],
|
|
268
|
+
[
|
|
269
|
+
{ "startIndex": 0, "endIndex": 2, "scopes": ["source.abl"] }, // ' '
|
|
270
|
+
{ "startIndex": 2, "endIndex": 8, "scopes": ["source.abl", "keyword.other.abl"] } // 'RETURN'
|
|
271
|
+
],
|
|
272
|
+
[
|
|
273
|
+
{ "startIndex": 0, "endIndex": 16, "scopes": ["source.abl"] }, // ' '
|
|
274
|
+
{ "startIndex": 16, "endIndex": 24, "scopes": ["source.abl", "variable.other.abl"] }, // 'p_string'
|
|
275
|
+
{ "startIndex": 24, "endIndex": 25, "scopes": ["source.abl"] }, // ' '
|
|
276
|
+
{ "startIndex": 25, "endIndex": 26, "scopes": ["source.abl", "punctuation.terminator.abl"] } // '.'
|
|
277
|
+
],
|
|
278
|
+
[
|
|
279
|
+
{ "startIndex": 0, "endIndex": 3, "scopes": ["source.abl", "keyword.other.abl"] }, // 'END'
|
|
280
|
+
{ "startIndex": 3, "endIndex": 4, "scopes": ["source.abl"] }, // ' '
|
|
281
|
+
{ "startIndex": 4, "endIndex": 12, "scopes": ["source.abl", "keyword.other.abl"] }, // 'FUNCTION'
|
|
282
|
+
{ "startIndex": 12, "endIndex": 13, "scopes": ["source.abl", "punctuation.terminator.abl"] } // '.'
|
|
283
|
+
]
|
|
284
|
+
];
|
|
285
|
+
shared.itShouldMatchExpectedScopes(statement, expectedTokens);
|
|
286
|
+
})
|
|
287
|
+
|
|
288
|
+
describe('', () => {
|
|
289
|
+
let statement = `FUNCTION getAppService RETURNS CHARACTER IN SUPER.`;
|
|
290
|
+
|
|
291
|
+
let expectedTokens = [
|
|
292
|
+
{ "startIndex": 0, "endIndex": 8, "scopes": ["source.abl", "meta.define.function.abl", "keyword.other.abl"] }, // 'FUNCTION'
|
|
293
|
+
{ "startIndex": 8, "endIndex": 9, "scopes": ["source.abl", "meta.define.function.abl"] }, // ' '
|
|
294
|
+
{ "startIndex": 9, "endIndex": 22, "scopes": ["source.abl", "meta.define.function.abl", "entity.name.function.abl"] }, // 'getAppService'
|
|
295
|
+
{ "startIndex": 22, "endIndex": 23, "scopes": ["source.abl", "meta.define.function.abl"] }, // ' '
|
|
296
|
+
{ "startIndex": 23, "endIndex": 30, "scopes": ["source.abl", "meta.define.function.abl", "keyword.other.abl"] }, // 'RETURNS'
|
|
297
|
+
{ "startIndex": 30, "endIndex": 31, "scopes": ["source.abl", "meta.define.function.abl"] }, // ' '
|
|
298
|
+
{ "startIndex": 31, "endIndex": 40, "scopes": ["source.abl", "meta.define.function.abl", "storage.type.abl"] }, // 'CHARACTER'
|
|
299
|
+
{ "startIndex": 40, "endIndex": 41, "scopes": ["source.abl", "meta.define.function.abl"] }, // ' '
|
|
300
|
+
{ "startIndex": 41, "endIndex": 43, "scopes": ["source.abl", "meta.define.function.abl", "keyword.other.abl"] }, // 'IN'
|
|
301
|
+
{ "startIndex": 43, "endIndex": 44, "scopes": ["source.abl", "meta.define.function.abl"] }, // ' '
|
|
302
|
+
{ "startIndex": 44, "endIndex": 49, "scopes": ["source.abl", "meta.define.function.abl", "keyword.other.abl"] }, // 'SUPER'
|
|
303
|
+
{ "startIndex": 49, "endIndex": 50, "scopes": ["source.abl", "meta.define.function.abl", "punctuation.terminator.abl"] } // '.'
|
|
304
|
+
];
|
|
305
|
+
shared.itShouldMatchExpectedScopes(statement, expectedTokens);
|
|
306
|
+
})
|
|
307
|
+
|
|
308
|
+
describe('', () => {
|
|
309
|
+
let statement = `FUNCTION runServerProcedure RETURNS HANDLE
|
|
310
|
+
(INPUT pcServerFileName AS CHARACTER,
|
|
311
|
+
INPUT phAppService AS HANDLE) IN SUPER.`;
|
|
312
|
+
|
|
313
|
+
let expectedTokens = [
|
|
314
|
+
[
|
|
315
|
+
{ "startIndex": 0, "endIndex": 8, "scopes": ["source.abl", "meta.define.function.abl", "keyword.other.abl"] }, // 'FUNCTION'
|
|
316
|
+
{ "startIndex": 8, "endIndex": 9, "scopes": ["source.abl", "meta.define.function.abl"] }, // ' '
|
|
317
|
+
{ "startIndex": 9, "endIndex": 27, "scopes": ["source.abl", "meta.define.function.abl", "entity.name.function.abl"] }, // 'runServerProcedure'
|
|
318
|
+
{ "startIndex": 27, "endIndex": 28, "scopes": ["source.abl", "meta.define.function.abl"] }, // ' '
|
|
319
|
+
{ "startIndex": 28, "endIndex": 35, "scopes": ["source.abl", "meta.define.function.abl", "keyword.other.abl"] }, // 'RETURNS'
|
|
320
|
+
{ "startIndex": 35, "endIndex": 36, "scopes": ["source.abl", "meta.define.function.abl"] }, // ' '
|
|
321
|
+
{ "startIndex": 36, "endIndex": 42, "scopes": ["source.abl", "meta.define.function.abl", "storage.type.abl"] } // 'HANDLE'
|
|
322
|
+
],
|
|
323
|
+
[
|
|
324
|
+
{ "startIndex": 0, "endIndex": 2, "scopes": ["source.abl", "meta.define.function.abl"] }, // ' '
|
|
325
|
+
{ "startIndex": 2, "endIndex": 3, "scopes": ["source.abl", "meta.define.function.abl", "meta.function.parameters", "meta.brace.round.js"] }, // '('
|
|
326
|
+
{ "startIndex": 3, "endIndex": 8, "scopes": ["source.abl", "meta.define.function.abl", "meta.function.parameters", "keyword.other.abl"] }, // 'INPUT'
|
|
327
|
+
{ "startIndex": 8, "endIndex": 9, "scopes": ["source.abl", "meta.define.function.abl", "meta.function.parameters"] }, // ' '
|
|
328
|
+
{ "startIndex": 9, "endIndex": 25, "scopes": ["source.abl", "meta.define.function.abl", "meta.function.parameters", "variable.parameter.abl"] }, // 'pcServerFileName'
|
|
329
|
+
{ "startIndex": 25, "endIndex": 26, "scopes": ["source.abl", "meta.define.function.abl", "meta.function.parameters"] }, // ' '
|
|
330
|
+
{ "startIndex": 26, "endIndex": 28, "scopes": ["source.abl", "meta.define.function.abl", "meta.function.parameters", "keyword.other.abl"] }, // 'AS'
|
|
331
|
+
{ "startIndex": 28, "endIndex": 29, "scopes": ["source.abl", "meta.define.function.abl", "meta.function.parameters"] }, // ' '
|
|
332
|
+
{ "startIndex": 29, "endIndex": 38, "scopes": ["source.abl", "meta.define.function.abl", "meta.function.parameters", "storage.type.abl"] }, // 'CHARACTER'
|
|
333
|
+
{ "startIndex": 38, "endIndex": 39, "scopes": ["source.abl", "meta.define.function.abl", "meta.function.parameters", "punctuation.separator.comma.abl"] } // ','
|
|
334
|
+
],
|
|
335
|
+
[
|
|
336
|
+
{ "startIndex": 0, "endIndex": 3, "scopes": ["source.abl", "meta.define.function.abl", "meta.function.parameters"] }, // ' '
|
|
337
|
+
{ "startIndex": 3, "endIndex": 8, "scopes": ["source.abl", "meta.define.function.abl", "meta.function.parameters", "keyword.other.abl"] }, // 'INPUT'
|
|
338
|
+
{ "startIndex": 8, "endIndex": 9, "scopes": ["source.abl", "meta.define.function.abl", "meta.function.parameters"] }, // ' '
|
|
339
|
+
{ "startIndex": 9, "endIndex": 21, "scopes": ["source.abl", "meta.define.function.abl", "meta.function.parameters", "variable.parameter.abl"] }, // 'phAppService'
|
|
340
|
+
{ "startIndex": 21, "endIndex": 22, "scopes": ["source.abl", "meta.define.function.abl", "meta.function.parameters"] }, // ' '
|
|
341
|
+
{ "startIndex": 22, "endIndex": 24, "scopes": ["source.abl", "meta.define.function.abl", "meta.function.parameters", "keyword.other.abl"] }, // 'AS'
|
|
342
|
+
{ "startIndex": 24, "endIndex": 25, "scopes": ["source.abl", "meta.define.function.abl", "meta.function.parameters"] }, // ' '
|
|
343
|
+
{ "startIndex": 25, "endIndex": 31, "scopes": ["source.abl", "meta.define.function.abl", "meta.function.parameters", "storage.type.abl"] }, // 'HANDLE'
|
|
344
|
+
{ "startIndex": 31, "endIndex": 32, "scopes": ["source.abl", "meta.define.function.abl", "meta.function.parameters", "meta.brace.round.js"] }, // ')'
|
|
345
|
+
{ "startIndex": 32, "endIndex": 33, "scopes": ["source.abl", "meta.define.function.abl"] }, // ' '
|
|
346
|
+
{ "startIndex": 33, "endIndex": 35, "scopes": ["source.abl", "meta.define.function.abl", "keyword.other.abl"] }, // 'IN'
|
|
347
|
+
{ "startIndex": 35, "endIndex": 36, "scopes": ["source.abl", "meta.define.function.abl"] }, // ' '
|
|
348
|
+
{ "startIndex": 36, "endIndex": 41, "scopes": ["source.abl", "meta.define.function.abl", "keyword.other.abl"] }, // 'SUPER'
|
|
349
|
+
{ "startIndex": 41, "endIndex": 42, "scopes": ["source.abl", "meta.define.function.abl", "punctuation.terminator.abl"] } // '.'
|
|
350
|
+
]
|
|
351
|
+
];
|
|
352
|
+
shared.itShouldMatchExpectedScopes(statement, expectedTokens);
|
|
353
|
+
})
|
|
354
|
+
|
|
355
|
+
describe('', () => {
|
|
356
|
+
let statement = `FUNCTION getAppService RETURNS CHARACTER IN SUPER.`;
|
|
357
|
+
|
|
358
|
+
let expectedTokens = [
|
|
359
|
+
{ "startIndex": 0, "endIndex": 8, "scopes": ["source.abl", "meta.define.function.abl", "keyword.other.abl"] }, // 'FUNCTION'
|
|
360
|
+
{ "startIndex": 8, "endIndex": 9, "scopes": ["source.abl", "meta.define.function.abl"] }, // ' '
|
|
361
|
+
{ "startIndex": 9, "endIndex": 22, "scopes": ["source.abl", "meta.define.function.abl", "entity.name.function.abl"] }, // 'getAppService'
|
|
362
|
+
{ "startIndex": 22, "endIndex": 23, "scopes": ["source.abl", "meta.define.function.abl"] }, // ' '
|
|
363
|
+
{ "startIndex": 23, "endIndex": 30, "scopes": ["source.abl", "meta.define.function.abl", "keyword.other.abl"] }, // 'RETURNS'
|
|
364
|
+
{ "startIndex": 30, "endIndex": 31, "scopes": ["source.abl", "meta.define.function.abl"] }, // ' '
|
|
365
|
+
{ "startIndex": 31, "endIndex": 40, "scopes": ["source.abl", "meta.define.function.abl", "storage.type.abl"] }, // 'CHARACTER'
|
|
366
|
+
{ "startIndex": 40, "endIndex": 41, "scopes": ["source.abl", "meta.define.function.abl"] }, // ' '
|
|
367
|
+
{ "startIndex": 41, "endIndex": 43, "scopes": ["source.abl", "meta.define.function.abl", "keyword.other.abl"] }, // 'IN'
|
|
368
|
+
{ "startIndex": 43, "endIndex": 44, "scopes": ["source.abl", "meta.define.function.abl"] }, // ' '
|
|
369
|
+
{ "startIndex": 44, "endIndex": 49, "scopes": ["source.abl", "meta.define.function.abl", "keyword.other.abl"] }, // 'SUPER'
|
|
370
|
+
{ "startIndex": 49, "endIndex": 50, "scopes": ["source.abl", "meta.define.function.abl", "punctuation.terminator.abl"] } // '.'
|
|
371
|
+
];
|
|
372
|
+
shared.itShouldMatchExpectedScopes(statement, expectedTokens);
|
|
373
|
+
})
|
|
374
|
+
|
|
375
|
+
describe('', () => {
|
|
376
|
+
let statement = `FUNCTION operationName logical MAP TO actual-name IN proc-handle .`;
|
|
377
|
+
|
|
378
|
+
let expectedTokens = [
|
|
379
|
+
{ "startIndex": 0, "endIndex": 8, "scopes": ["source.abl", "meta.define.function.abl", "keyword.other.abl"] }, // 'FUNCTION'
|
|
380
|
+
{ "startIndex": 8, "endIndex": 9, "scopes": ["source.abl", "meta.define.function.abl"] }, // ' '
|
|
381
|
+
{ "startIndex": 9, "endIndex": 22, "scopes": ["source.abl", "meta.define.function.abl", "entity.name.function.abl"] }, // 'operationName'
|
|
382
|
+
{ "startIndex": 22, "endIndex": 24, "scopes": ["source.abl", "meta.define.function.abl"] }, // ' '
|
|
383
|
+
{ "startIndex": 24, "endIndex": 31, "scopes": ["source.abl", "meta.define.function.abl", "storage.type.abl"] }, // 'logical'
|
|
384
|
+
{ "startIndex": 31, "endIndex": 33, "scopes": ["source.abl", "meta.define.function.abl"] }, // ' '
|
|
385
|
+
{ "startIndex": 33, "endIndex": 36, "scopes": ["source.abl", "meta.define.function.abl", "keyword.other.abl"] }, // 'MAP'
|
|
386
|
+
{ "startIndex": 36, "endIndex": 37, "scopes": ["source.abl", "meta.define.function.abl"] }, // ' '
|
|
387
|
+
{ "startIndex": 37, "endIndex": 39, "scopes": ["source.abl", "meta.define.function.abl", "keyword.other.abl"] }, // 'TO'
|
|
388
|
+
{ "startIndex": 39, "endIndex": 40, "scopes": ["source.abl", "meta.define.function.abl"] }, // ' '
|
|
389
|
+
{ "startIndex": 40, "endIndex": 51, "scopes": ["source.abl", "meta.define.function.abl", "entity.name.function.abl"] }, // 'actual-name'
|
|
390
|
+
{ "startIndex": 51, "endIndex": 52, "scopes": ["source.abl", "meta.define.function.abl"] }, // ' '
|
|
391
|
+
{ "startIndex": 52, "endIndex": 54, "scopes": ["source.abl", "meta.define.function.abl", "keyword.other.abl"] }, // 'IN'
|
|
392
|
+
{ "startIndex": 54, "endIndex": 55, "scopes": ["source.abl", "meta.define.function.abl"] }, // ' '
|
|
393
|
+
{ "startIndex": 55, "endIndex": 66, "scopes": ["source.abl", "meta.define.function.abl", "variable.other.abl"] }, // 'proc-handle'
|
|
394
|
+
{ "startIndex": 66, "endIndex": 68, "scopes": ["source.abl", "meta.define.function.abl"] }, // ' '
|
|
395
|
+
{ "startIndex": 68, "endIndex": 69, "scopes": ["source.abl", "meta.define.function.abl", "punctuation.terminator.abl"] } // '.'
|
|
396
|
+
];
|
|
397
|
+
shared.itShouldMatchExpectedScopes(statement, expectedTokens);
|
|
398
|
+
})
|
|
399
|
+
|
|
400
|
+
describe('', () => {
|
|
401
|
+
let statement = `FUNCTION operationName logical MAP actual-name IN proc-handle .`;
|
|
402
|
+
|
|
403
|
+
let expectedTokens = [
|
|
404
|
+
{ "startIndex": 0, "endIndex": 8, "scopes": ["source.abl", "meta.define.function.abl", "keyword.other.abl"] }, // 'FUNCTION'
|
|
405
|
+
{ "startIndex": 8, "endIndex": 9, "scopes": ["source.abl", "meta.define.function.abl"] }, // ' '
|
|
406
|
+
{ "startIndex": 9, "endIndex": 22, "scopes": ["source.abl", "meta.define.function.abl", "entity.name.function.abl"] }, // 'operationName'
|
|
407
|
+
{ "startIndex": 22, "endIndex": 24, "scopes": ["source.abl", "meta.define.function.abl"] }, // ' '
|
|
408
|
+
{ "startIndex": 24, "endIndex": 31, "scopes": ["source.abl", "meta.define.function.abl", "storage.type.abl"] }, // 'logical'
|
|
409
|
+
{ "startIndex": 31, "endIndex": 33, "scopes": ["source.abl", "meta.define.function.abl"] }, // ' '
|
|
410
|
+
{ "startIndex": 33, "endIndex": 36, "scopes": ["source.abl", "meta.define.function.abl", "keyword.other.abl"] }, // 'MAP'
|
|
411
|
+
{ "startIndex": 36, "endIndex": 37, "scopes": ["source.abl", "meta.define.function.abl"] }, // ' '
|
|
412
|
+
{ "startIndex": 37, "endIndex": 48, "scopes": ["source.abl", "meta.define.function.abl", "entity.name.function.abl"] }, // 'actual-name'
|
|
413
|
+
{ "startIndex": 48, "endIndex": 49, "scopes": ["source.abl", "meta.define.function.abl"] }, // ' '
|
|
414
|
+
{ "startIndex": 49, "endIndex": 51, "scopes": ["source.abl", "meta.define.function.abl", "keyword.other.abl"] }, // 'IN'
|
|
415
|
+
{ "startIndex": 51, "endIndex": 52, "scopes": ["source.abl", "meta.define.function.abl"] }, // ' '
|
|
416
|
+
{ "startIndex": 52, "endIndex": 63, "scopes": ["source.abl", "meta.define.function.abl", "variable.other.abl"] }, // 'proc-handle'
|
|
417
|
+
{ "startIndex": 63, "endIndex": 65, "scopes": ["source.abl", "meta.define.function.abl"] }, // ' '
|
|
418
|
+
{ "startIndex": 65, "endIndex": 66, "scopes": ["source.abl", "meta.define.function.abl", "punctuation.terminator.abl"] } // '.'
|
|
419
|
+
];
|
|
420
|
+
shared.itShouldMatchExpectedScopes(statement, expectedTokens);
|
|
421
|
+
})
|
|
422
|
+
|
|
423
|
+
describe('', () => {
|
|
424
|
+
let statement = `FUNCTION operationName logical MAP actual-name IN obJRef:Property .`;
|
|
425
|
+
|
|
426
|
+
let expectedTokens = [
|
|
427
|
+
{ "startIndex": 0, "endIndex": 8, "scopes": ["source.abl", "meta.define.function.abl", "keyword.other.abl"] }, // 'FUNCTION'
|
|
428
|
+
{ "startIndex": 8, "endIndex": 9, "scopes": ["source.abl", "meta.define.function.abl"] }, // ' '
|
|
429
|
+
{ "startIndex": 9, "endIndex": 22, "scopes": ["source.abl", "meta.define.function.abl", "entity.name.function.abl"] }, // 'operationName'
|
|
430
|
+
{ "startIndex": 22, "endIndex": 24, "scopes": ["source.abl", "meta.define.function.abl"] }, // ' '
|
|
431
|
+
{ "startIndex": 24, "endIndex": 31, "scopes": ["source.abl", "meta.define.function.abl", "storage.type.abl"] }, // 'logical'
|
|
432
|
+
{ "startIndex": 31, "endIndex": 33, "scopes": ["source.abl", "meta.define.function.abl"] }, // ' '
|
|
433
|
+
{ "startIndex": 33, "endIndex": 36, "scopes": ["source.abl", "meta.define.function.abl", "keyword.other.abl"] }, // 'MAP'
|
|
434
|
+
{ "startIndex": 36, "endIndex": 37, "scopes": ["source.abl", "meta.define.function.abl"] }, // ' '
|
|
435
|
+
{ "startIndex": 37, "endIndex": 48, "scopes": ["source.abl", "meta.define.function.abl", "entity.name.function.abl"] }, // 'actual-name'
|
|
436
|
+
{ "startIndex": 48, "endIndex": 49, "scopes": ["source.abl", "meta.define.function.abl"] }, // ' '
|
|
437
|
+
{ "startIndex": 49, "endIndex": 51, "scopes": ["source.abl", "meta.define.function.abl", "keyword.other.abl"] }, // 'IN'
|
|
438
|
+
{ "startIndex": 51, "endIndex": 52, "scopes": ["source.abl", "meta.define.function.abl"] }, // ' '
|
|
439
|
+
{ "startIndex": 52, "endIndex": 58, "scopes": ["source.abl", "meta.define.function.abl", "variable.other.abl"] }, // 'obJRef'
|
|
440
|
+
{ "startIndex": 58, "endIndex": 59, "scopes": ["source.abl", "meta.define.function.abl", "punctuation.separator.colon.abl"] }, // ':'
|
|
441
|
+
{ "startIndex": 59, "endIndex": 67, "scopes": ["source.abl", "meta.define.function.abl", "entity.name.function.abl"] }, // 'Property'
|
|
442
|
+
{ "startIndex": 67, "endIndex": 69, "scopes": ["source.abl", "meta.define.function.abl"] }, // ' '
|
|
443
|
+
{ "startIndex": 69, "endIndex": 70, "scopes": ["source.abl", "meta.define.function.abl", "punctuation.terminator.abl"] } // '.'
|
|
444
|
+
];
|
|
445
|
+
shared.itShouldMatchExpectedScopes(statement, expectedTokens);
|
|
446
|
+
})
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
const { assert, expect } = require('chai');
|
|
2
|
+
const shared = require('../shared.js');
|
|
3
|
+
|
|
4
|
+
describe('', () => {
|
|
5
|
+
let statement = `if available bCustomer then .
|
|
6
|
+
else if ambiguous bCustomer then .`;
|
|
7
|
+
let expectedTokens = [
|
|
8
|
+
[
|
|
9
|
+
{ "startIndex": 0, "endIndex": 2, "scopes": ["source.abl", "keyword.other.abl"] }, // 'if'
|
|
10
|
+
{ "startIndex": 2, "endIndex": 3, "scopes": ["source.abl"] }, // ' '
|
|
11
|
+
{ "startIndex": 3, "endIndex": 12, "scopes": ["source.abl", "support.function.abl"] }, // 'available'
|
|
12
|
+
{ "startIndex": 12, "endIndex": 13, "scopes": ["source.abl"] }, // ' '
|
|
13
|
+
{ "startIndex": 13, "endIndex": 22, "scopes": ["source.abl", "support.data.table.abl"] }, // 'bCustomer'
|
|
14
|
+
{ "startIndex": 22, "endIndex": 23, "scopes": ["source.abl"] }, // ' '
|
|
15
|
+
{ "startIndex": 23, "endIndex": 27, "scopes": ["source.abl", "keyword.other.abl"] }, // 'then'
|
|
16
|
+
{ "startIndex": 27, "endIndex": 28, "scopes": ["source.abl"] }, // ' '
|
|
17
|
+
{ "startIndex": 28, "endIndex": 29, "scopes": ["source.abl", "punctuation.terminator.abl"] } // '.'
|
|
18
|
+
],
|
|
19
|
+
[
|
|
20
|
+
{ "startIndex": 0, "endIndex": 4, "scopes": ["source.abl", "keyword.other.abl"] }, // 'else'
|
|
21
|
+
{ "startIndex": 4, "endIndex": 5, "scopes": ["source.abl"] }, // ' '
|
|
22
|
+
{ "startIndex": 5, "endIndex": 7, "scopes": ["source.abl", "keyword.other.abl"] }, // 'if'
|
|
23
|
+
{ "startIndex": 7, "endIndex": 8, "scopes": ["source.abl"] }, // ' '
|
|
24
|
+
{ "startIndex": 8, "endIndex": 17, "scopes": ["source.abl", "support.function.abl"] }, // 'ambiguous'
|
|
25
|
+
{ "startIndex": 17, "endIndex": 18, "scopes": ["source.abl"] }, // ' '
|
|
26
|
+
{ "startIndex": 18, "endIndex": 27, "scopes": ["source.abl", "support.data.table.abl"] }, // 'bCustomer'
|
|
27
|
+
{ "startIndex": 27, "endIndex": 28, "scopes": ["source.abl"] }, // ' '
|
|
28
|
+
{ "startIndex": 28, "endIndex": 32, "scopes": ["source.abl", "keyword.other.abl"] }, // 'then'
|
|
29
|
+
{ "startIndex": 32, "endIndex": 33, "scopes": ["source.abl"] }, // ' '
|
|
30
|
+
{ "startIndex": 33, "endIndex": 34, "scopes": ["source.abl", "punctuation.terminator.abl"] } // '.'
|
|
31
|
+
]
|
|
32
|
+
];
|
|
33
|
+
shared.itShouldMatchExpectedScopes(statement, expectedTokens);
|
|
34
|
+
})
|
|
35
|
+
|
|
36
|
+
describe('', () => {
|
|
37
|
+
let statement = ` if available sports.bCustomer then message "s".
|
|
38
|
+
else if ambiguous(s2k.bCustomer) then.`;
|
|
39
|
+
let expectedTokens = [
|
|
40
|
+
[
|
|
41
|
+
{ "startIndex": 0, "endIndex": 3, "scopes": ["source.abl"] }, // ' '
|
|
42
|
+
{ "startIndex": 3, "endIndex": 5, "scopes": ["source.abl", "keyword.other.abl"] }, // 'if'
|
|
43
|
+
{ "startIndex": 5, "endIndex": 6, "scopes": ["source.abl"] }, // ' '
|
|
44
|
+
{ "startIndex": 6, "endIndex": 15, "scopes": ["source.abl", "support.function.abl"] }, // 'available'
|
|
45
|
+
{ "startIndex": 15, "endIndex": 16, "scopes": ["source.abl"] }, // ' '
|
|
46
|
+
{ "startIndex": 16, "endIndex": 32, "scopes": ["source.abl", "support.data.table.abl"] }, // 'sports.bCustomer'
|
|
47
|
+
{ "startIndex": 32, "endIndex": 33, "scopes": ["source.abl"] }, // ' '
|
|
48
|
+
{ "startIndex": 33, "endIndex": 37, "scopes": ["source.abl", "keyword.other.abl"] }, // 'then'
|
|
49
|
+
{ "startIndex": 37, "endIndex": 38, "scopes": ["source.abl"] }, // ' '
|
|
50
|
+
{ "startIndex": 38, "endIndex": 45, "scopes": ["source.abl", "keyword.other.abl"] }, // 'message'
|
|
51
|
+
{ "startIndex": 45, "endIndex": 46, "scopes": ["source.abl"] }, // ' '
|
|
52
|
+
{ "startIndex": 46, "endIndex": 47, "scopes": ["source.abl", "string.double.complex.abl", "punctuation.definition.string.begin.abl"] }, // '"'
|
|
53
|
+
{ "startIndex": 47, "endIndex": 48, "scopes": ["source.abl", "string.double.complex.abl"] }, // 's'
|
|
54
|
+
{ "startIndex": 48, "endIndex": 49, "scopes": ["source.abl", "string.double.complex.abl", "punctuation.definition.string.end.abl"] }, // '"'
|
|
55
|
+
{ "startIndex": 49, "endIndex": 50, "scopes": ["source.abl", "punctuation.terminator.abl"] } // '.'
|
|
56
|
+
],
|
|
57
|
+
[
|
|
58
|
+
{ "startIndex": 0, "endIndex": 3, "scopes": ["source.abl"] }, // ' '
|
|
59
|
+
{ "startIndex": 3, "endIndex": 7, "scopes": ["source.abl", "keyword.other.abl"] }, // 'else'
|
|
60
|
+
{ "startIndex": 7, "endIndex": 8, "scopes": ["source.abl"] }, // ' '
|
|
61
|
+
{ "startIndex": 8, "endIndex": 10, "scopes": ["source.abl", "keyword.other.abl"] }, // 'if'
|
|
62
|
+
{ "startIndex": 10, "endIndex": 11, "scopes": ["source.abl"] }, // ' '
|
|
63
|
+
{ "startIndex": 11, "endIndex": 20, "scopes": ["source.abl", "support.function.abl"] }, // 'ambiguous'
|
|
64
|
+
{ "startIndex": 20, "endIndex": 21, "scopes": ["source.abl", "meta.brace.round.js"] }, // '('
|
|
65
|
+
{ "startIndex": 21, "endIndex": 34, "scopes": ["source.abl", "support.data.table.abl"] }, // 's2k.bCustomer'
|
|
66
|
+
{ "startIndex": 34, "endIndex": 35, "scopes": ["source.abl", "meta.brace.round.js"] }, // ')'
|
|
67
|
+
{ "startIndex": 35, "endIndex": 36, "scopes": ["source.abl"] }, // ' '
|
|
68
|
+
{ "startIndex": 36, "endIndex": 40, "scopes": ["source.abl", "keyword.other.abl"] }, // 'then'
|
|
69
|
+
{ "startIndex": 40, "endIndex": 41, "scopes": ["source.abl", "punctuation.terminator.abl"] } // '.'
|
|
70
|
+
]
|
|
71
|
+
];
|
|
72
|
+
shared.itShouldMatchExpectedScopes(statement, expectedTokens);
|
|
73
|
+
})
|
|
@@ -50,4 +50,15 @@ describe('', () => {
|
|
|
50
50
|
{ "startIndex": 24, "endIndex": 25, "scopes": ["source.abl", "punctuation.terminator.abl"] } // '.'
|
|
51
51
|
];
|
|
52
52
|
shared.itShouldMatchExpectedScopes(statement, expectedTokens);
|
|
53
|
+
})
|
|
54
|
+
|
|
55
|
+
describe('', () => {
|
|
56
|
+
let statement = `RETURN return-VALUE.`;
|
|
57
|
+
let expectedTokens = [
|
|
58
|
+
{ "startIndex": 0, "endIndex": 6, "scopes": ["source.abl", "keyword.other.abl"] }, // 'RETURN'
|
|
59
|
+
{ "startIndex": 6, "endIndex": 7, "scopes": ["source.abl"] }, // ' '
|
|
60
|
+
{ "startIndex": 7, "endIndex": 19, "scopes": ["source.abl", "keyword.other.abl"] }, // 'return-VALUE'
|
|
61
|
+
{ "startIndex": 19, "endIndex": 20, "scopes": ["source.abl", "punctuation.terminator.abl"] } // '.'
|
|
62
|
+
];
|
|
63
|
+
shared.itShouldMatchExpectedScopes(statement, expectedTokens);
|
|
53
64
|
})
|