abl-tmlanguage 1.3.1 → 1.3.3

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/index.js CHANGED
@@ -1,44 +1,310 @@
1
+ // This script create 3 sections: keywords-<A>, handle-attributes-<Z> and abl-functions-<A> . ABL keywords can only be in
2
+ // one of these sections.
1
3
  // kwlist.txt file can be generated with `prowin -zgenkwlist > kwlist.txt`
4
+ //
5
+ // methods.txt can be created by copying the 'Related Links' from https://docs.progress.com/bundle/abl-reference/page/Handle-Attributes-and-Methods-Reference.html//
6
+ // It will look something like:
7
+ // ACCELERATOR attribute
8
+ // ACCEPT-CHANGES( ) method
9
+ // ACCEPT-ROW-CHANGES( ) method
10
+ //
11
+ // abl-functions.txt can be created by copying the 'Related Links' from https://docs.progress.com/bundle/abl-reference/page/ABL-Syntax-Reference.html
12
+ //
13
+
2
14
  const fs = require('fs');
3
15
 
4
- let lineReader = require('readline').createInterface({
16
+ let lineReaderMethods = require('readline').createInterface({
17
+ input: fs.createReadStream('methods.txt')
18
+ });
19
+
20
+ let lineReaderFunctions = require('readline').createInterface({
21
+ input: fs.createReadStream('abl-functions.txt')
22
+ });
23
+
24
+ let lineReaderKeywords = require('readline').createInterface({
5
25
  input: fs.createReadStream('kwlist.txt')
6
26
  });
7
27
 
8
-
9
28
  let output = 'grammar.json';
10
29
  let result = {};
11
- let grammarBlocks2 = [[], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], []];
30
+ let attributeBlocks = [[], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], []];
31
+ let methodBlocks = [[], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], []];
32
+ let keywordBlocks = [[], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], []];
33
+ let functionBlocks = [[], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], []];
12
34
  const re = /(?:\w|-|\()+(?=\s|$)/g
13
35
 
14
- lineReader.on('line', line => {
15
- let results;
16
- line = line.toLowerCase();
17
-
18
- while ((results = re.exec(line)) !== null) {
19
- let kw = results[0];
20
- if (kw.indexOf('(') !== -1) {
21
- let kwParts = kw.split('(');
22
- kw = kwParts[0];
23
- grammarBlocks2[kw.charCodeAt(0) - 97].push(kw);
24
- let kwComplete = kwParts[1];
25
- for (const element of kwComplete) {
26
- kw += element;
27
- grammarBlocks2[kw.charCodeAt(0) - 97].push(kw);
28
- }
29
- } else {
30
- grammarBlocks2[kw.charCodeAt(0) - 97].push(kw);
31
- }
36
+ // The doc is not always accurate ...
37
+ // Add the full keyword to one of these arrays, and
38
+ // it and any abbreviated versions will be added to the
39
+ // appropriate scopes
40
+ let alsoStatements = [];
41
+ alsoStatements.push('centered');
42
+ alsoStatements.push('first');
43
+ alsoStatements.push('format');
44
+ alsoStatements.push('initial');
45
+ alsoStatements.push('label');
46
+ alsoStatements.push('nested');
47
+ alsoStatements.push('row');
48
+ alsoStatements.push('serialize-name');
49
+ alsoStatements.push('single-run');
50
+ alsoStatements.push('transaction');
51
+
52
+ let functionsNotStatements = [];
53
+ functionsNotStatements.push('set-size');
54
+
55
+ let alsoFunctions = [];
56
+ alsoFunctions.push('lower');
57
+ alsoFunctions.push('relation-fields');
58
+ alsoFunctions.push('return');
59
+ alsoFunctions.push('substitute');
60
+ alsoFunctions.push('this-object');
61
+ alsoFunctions.push('value');
62
+
63
+ lineReaderMethods.on('line', line => {
64
+ let results;
65
+ line = line.toLowerCase();
66
+
67
+ let kw = line.split(' ');
68
+ let charIdx = kw[0].charCodeAt(0) - 97;
69
+ let keyWord = kw[0].split('(')[0];
70
+
71
+ if (kw.includes('attribute')) {
72
+ if (!attributeBlocks[charIdx].includes(keyWord)) {
73
+ attributeBlocks[charIdx].push(keyWord);
74
+ }
75
+ } else if (kw.includes('method')) {
76
+ if (!methodBlocks[charIdx].includes(keyWord)) {
77
+ methodBlocks[charIdx].push(keyWord);
78
+ }
79
+ }
80
+
81
+ if (alsoStatements.includes(keyWord)) {
82
+ if (!keywordBlocks[charIdx].includes(keyWord)) {
83
+ keywordBlocks[charIdx].push(keyWord);
84
+ }
85
+ }
86
+ if (alsoFunctions.includes(keyWord)) {
87
+ if (!functionBlocks[charIdx].includes(keyWord)) {
88
+ functionBlocks[charIdx].push(keyWord);
89
+ }
90
+ }
91
+ });
92
+
93
+ lineReaderFunctions.on('line', line => {
94
+ let results;
95
+ line = line.toLowerCase();
96
+
97
+ let kw = line.split(' ');
98
+
99
+ if (kw.includes('function')) {
100
+ // CAPS letter alphabet
101
+ let charIdx = kw[0].charCodeAt(0) - 97;
102
+
103
+ if (!functionBlocks[charIdx].includes(kw[0]) && !kw[0].includes('...')) {
104
+ functionBlocks[charIdx].push(kw[0]);
105
+ }
106
+
107
+ if (alsoStatements.includes(kw[0])) {
108
+ if (!keywordBlocks[charIdx].includes(kw[0])) {
109
+ keywordBlocks[charIdx].push(kw[0]);
110
+ }
111
+ }
112
+ } else if (kw.includes('statement')) {
113
+ for (const keyWord of kw) {
114
+ let charIdx = keyWord.charCodeAt(0) - 97;
115
+
116
+ if (keyWord == "statement") { break; }
117
+
118
+ if (keyWord.indexOf('(') !== -1) { continue; }
119
+
120
+ if (keyWord.includes('...')) { break; }
121
+
122
+ kw2 = keyWord.replace(",", "");
123
+
124
+ if (charIdx > 0 && functionsNotStatements.includes(kw2)) {
125
+ functionBlocks[charIdx].push(kw2);
126
+ } else if (charIdx > 0 && !keywordBlocks[charIdx].includes(kw2)) {
127
+ keywordBlocks[charIdx].push(kw2);
128
+ }
129
+ }
130
+ }
131
+ });
132
+
133
+ lineReaderKeywords.on('line', line => {
134
+ let results;
135
+ line = line.toLowerCase();
136
+
137
+ while ((results = re.exec(line)) !== null) {
138
+ let kw = results[0];
139
+ // CAPS letter alphabet
140
+ let charIdx = kw.charCodeAt(0) - 97;
141
+
142
+ if (kw.indexOf('(') !== -1) {
143
+ let kwParts = kw.split('(');
144
+ let fullKw = kwParts[0] + kwParts[1];
145
+
146
+ kw = kwParts[0];
147
+ addToBlock(charIdx, fullKw, kw);
148
+
149
+ let kwComplete = kwParts[1];
150
+ for (const element of kwComplete) {
151
+ kw += element;
152
+
153
+ addToBlock(charIdx, fullKw, kw);
154
+ }
155
+ } else {
156
+ addToBlock(charIdx, kw, kw);
32
157
  }
158
+ }
33
159
  });
34
160
 
35
- lineReader.on('close', () => {
36
- for (var zz = 0; zz < 26; zz++) {
37
- result['keywords-' + String.fromCharCode(97 + zz)] =
38
- {
39
- match: "(?i)(?<![\\w-])(" + grammarBlocks2[zz].sort().join('|') + ")(?![\\w-])",
161
+ function addToBlock(charIdx, fullKw, addKw) {
162
+
163
+ if (alsoFunctions.includes(fullKw)) {
164
+ if (!functionBlocks[charIdx].includes(addKw)) {
165
+ functionBlocks[charIdx].push(addKw);
166
+ }
167
+ }
168
+
169
+ if (attributeBlocks[charIdx].includes(fullKw)) {
170
+ if (!attributeBlocks[charIdx].includes(addKw)) {
171
+ attributeBlocks[charIdx].push(addKw);
172
+ }
173
+ } else if (methodBlocks[charIdx].includes(fullKw)) {
174
+ if (!methodBlocks[charIdx].includes(addKw)) {
175
+ methodBlocks[charIdx].push(addKw);
176
+ }
177
+ } else if (functionBlocks[charIdx].includes(fullKw)) {
178
+ if (!functionBlocks[charIdx].includes(addKw)) {
179
+ functionBlocks[charIdx].push(addKw);
180
+ }
181
+ } else {
182
+ if (!keywordBlocks[charIdx].includes(addKw)) {
183
+ keywordBlocks[charIdx].push(addKw);
184
+ }
185
+ }
186
+ }
187
+
188
+ lineReaderKeywords.on('close', () => {
189
+
190
+ result['keywords'] = { patterns: [] }
191
+
192
+ for (var zz = 0; zz < 26; zz++) {
193
+
194
+ if (keywordBlocks[zz].length > 0) {
195
+ result.keywords.patterns.push({ include: "#keywords-" + String.fromCharCode(97 + zz).toUpperCase() });
196
+
197
+ result['keywords-' + String.fromCharCode(97 + zz).toUpperCase()] =
198
+ {
199
+ //match: "(?i)(?<![\\w\\-\\:\\.])(" + keywordBlocks[zz].sort(reverseSort).join('|') + ")(?![\\w\\-])",
200
+ match: "(?i)\\b(" + keywordBlocks[zz].sort(reverseSort).join('|') + ")\\b",
201
+ captures: {
202
+ 1: {
40
203
  name: "keyword.other.abl"
204
+ }
41
205
  }
206
+ }
42
207
  }
43
- fs.writeFileSync(output, JSON.stringify(result, undefined, 4));
208
+ }
209
+
210
+ result['handle-attributes'] = { patterns: [] }
211
+
212
+ for (var zz = 0; zz < 26; zz++) {
213
+ if (attributeBlocks[zz].length > 0) {
214
+
215
+ result['handle-attributes'].patterns.push({ include: "#handle-attributes-" + String.fromCharCode(97 + zz).toUpperCase() });
216
+
217
+ result['handle-attributes-' + String.fromCharCode(97 + zz).toUpperCase()] =
218
+ {
219
+ match: "(?i)(:)(" + attributeBlocks[zz].sort(reverseSort).join('|') + ")\\s*",
220
+ captures: {
221
+ 1: {
222
+ name: "punctuation.separator.colon.abl"
223
+ },
224
+ 2: {
225
+ name: "entity.name.function.abl"
226
+ }
227
+ }
228
+ }
229
+ }
230
+ }
231
+
232
+ result['handle-methods'] = { patterns: [] }
233
+ for (var zz = 0; zz < 26; zz++) {
234
+
235
+ if (methodBlocks[zz].length > 0) {
236
+ result['handle-methods'].patterns.push({ include: "#handle-methods-" + String.fromCharCode(97 + zz).toUpperCase() });
237
+
238
+ result['handle-methods-' + String.fromCharCode(97 + zz).toUpperCase()] =
239
+ {
240
+ begin: "(?i)(:)(" + methodBlocks[zz].sort(reverseSort).join('|') + ")\\s*(?=\\()",
241
+ beginCaptures: {
242
+ 1: {
243
+ name: "punctuation.separator.colon.abl"
244
+ },
245
+ 2: {
246
+ name: "support.function.abl"
247
+ }
248
+ },
249
+ end: "(\\))",
250
+ endCaptures: {
251
+ 1: {
252
+ name: "meta.brace.round.js"
253
+ }
254
+ },
255
+ patterns: [
256
+ {
257
+ include: "#function-arguments"
258
+ }
259
+ ]
260
+ }
261
+ }
262
+ }
263
+
264
+ result['abl-functions'] = { patterns: [] }
265
+ for (var zz = 0; zz < 26; zz++) {
266
+
267
+ if (functionBlocks[zz].length > 0) {
268
+ result['abl-functions'].patterns.push({ include: "#abl-functions-" + String.fromCharCode(97 + zz).toUpperCase() });
269
+
270
+ result['abl-functions-' + String.fromCharCode(97 + zz).toUpperCase()] =
271
+ {
272
+ name: "meta.function-call.abl",
273
+ begin: "(?i)\\s*(" + functionBlocks[zz].sort(reverseSort).join('|') + ")\\s*(?=\\()",
274
+ beginCaptures: {
275
+ 1: {
276
+ name: "support.function.abl"
277
+ }
278
+ },
279
+ end: "(\\))",
280
+ endCaptures: {
281
+ 1: {
282
+ name: "meta.brace.round.js"
283
+ }
284
+ },
285
+ patterns: [
286
+ {
287
+ include: "#function-arguments"
288
+ }
289
+ ]
290
+ }
291
+ }
292
+ }
293
+ fs.writeFileSync(output, JSON.stringify(result, undefined, 4));
44
294
  })
295
+
296
+ // Sorts in reverse order - so that the longer versions of the keywords appear earlier in the regex
297
+ function reverseSort(a, b) {
298
+ const nameA = a.toLowerCase(); // ignore upper and lowercase
299
+ const nameB = b.toLowerCase(); // ignore upper and lowercase
300
+
301
+ if (nameA < nameB) {
302
+ return 1;
303
+ }
304
+ if (nameA > nameB) {
305
+ return -1;
306
+ }
307
+
308
+ // names are equal
309
+ return 0;
310
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "abl-tmlanguage",
3
- "version": "1.3.1",
3
+ "version": "1.3.3",
4
4
  "description": "Textmate grammar for Progress OpenEdge ABL Language",
5
5
  "main": "",
6
6
  "repository": {
@@ -0,0 +1,153 @@
1
+ const { assert, expect } = require('chai');
2
+ const shared = require('../shared.js');
3
+
4
+ describe('', () => {
5
+ let statement = `for each bCustomer
6
+ no-lock:
7
+ end.`;
8
+ let expectedTokens = [
9
+ [
10
+ { "startIndex": 0, "endIndex": 3, "scopes": ["source.abl", "keyword.other.abl"] }, // 'for'
11
+ { "startIndex": 3, "endIndex": 4, "scopes": ["source.abl"] }, // ' '
12
+ { "startIndex": 4, "endIndex": 8, "scopes": ["source.abl", "keyword.other.abl"] }, // 'each'
13
+ { "startIndex": 8, "endIndex": 9, "scopes": ["source.abl"] }, // ' '
14
+ { "startIndex": 9, "endIndex": 18, "scopes": ["source.abl", "storage.data.table.abl"] } // 'bCustomer'
15
+ ],
16
+ [
17
+ { "startIndex": 0, "endIndex": 4, "scopes": ["source.abl"] }, // ' '
18
+ { "startIndex": 4, "endIndex": 11, "scopes": ["source.abl", "keyword.other.abl"] }, // 'no-lock'
19
+ { "startIndex": 11, "endIndex": 12, "scopes": ["source.abl", "punctuation.terminator.abl"] } // ':'
20
+ ],
21
+ [
22
+ { "startIndex": 0, "endIndex": 3, "scopes": ["source.abl", "keyword.other.abl"] }, // 'end'
23
+ { "startIndex": 3, "endIndex": 4, "scopes": ["source.abl", "punctuation.terminator.abl"] } // '.'
24
+ ]
25
+ ]
26
+ shared.itShouldMatchExpectedScopes(statement, expectedTokens);
27
+ })
28
+
29
+ describe('', () => {
30
+ let statement = `for each bCustomer where true no-lock:
31
+ end.`;
32
+ let expectedTokens = [
33
+ [
34
+ { "startIndex": 0, "endIndex": 3, "scopes": ["source.abl", "keyword.other.abl"] }, // 'for'
35
+ { "startIndex": 3, "endIndex": 4, "scopes": ["source.abl"] }, // ' '
36
+ { "startIndex": 4, "endIndex": 8, "scopes": ["source.abl", "keyword.other.abl"] }, // 'each'
37
+ { "startIndex": 8, "endIndex": 9, "scopes": ["source.abl"] }, // ' '
38
+ { "startIndex": 9, "endIndex": 18, "scopes": ["source.abl", "storage.data.table.abl"] }, // 'bCustomer'
39
+ { "startIndex": 18, "endIndex": 19, "scopes": ["source.abl"] }, // ' '
40
+ { "startIndex": 19, "endIndex": 24, "scopes": ["source.abl", "keyword.other.abl"] }, // 'where'
41
+ { "startIndex": 24, "endIndex": 25, "scopes": ["source.abl"] }, // ' '
42
+ { "startIndex": 25, "endIndex": 29, "scopes": ["source.abl", "constant.language.abl"] }, // 'true'
43
+ { "startIndex": 29, "endIndex": 30, "scopes": ["source.abl"] }, // ' '
44
+ { "startIndex": 30, "endIndex": 37, "scopes": ["source.abl", "keyword.other.abl"] }, // 'no-lock'
45
+ { "startIndex": 37, "endIndex": 38, "scopes": ["source.abl", "punctuation.terminator.abl"] } // ':'
46
+ ],
47
+ [
48
+ { "startIndex": 0, "endIndex": 3, "scopes": ["source.abl", "keyword.other.abl"] }, // 'end'
49
+ { "startIndex": 3, "endIndex": 4, "scopes": ["source.abl", "punctuation.terminator.abl"] } // '.'
50
+ ]
51
+ ]
52
+ shared.itShouldMatchExpectedScopes(statement, expectedTokens);
53
+ })
54
+
55
+ describe('', () => {
56
+ let statement = `for each bCustomer
57
+ exclusive-l:
58
+ end.`;
59
+ let expectedTokens = [
60
+ [
61
+ { "startIndex": 0, "endIndex": 3, "scopes": ["source.abl", "keyword.other.abl"] }, // 'for'
62
+ { "startIndex": 3, "endIndex": 4, "scopes": ["source.abl"] }, // ' '
63
+ { "startIndex": 4, "endIndex": 8, "scopes": ["source.abl", "keyword.other.abl"] }, // 'each'
64
+ { "startIndex": 8, "endIndex": 9, "scopes": ["source.abl"] }, // ' '
65
+ { "startIndex": 9, "endIndex": 18, "scopes": ["source.abl", "storage.data.table.abl"] } // 'bCustomer'
66
+ ],
67
+ [
68
+ { "startIndex": 0, "endIndex": 11, "scopes": ["source.abl", "keyword.other.abl"] }, // 'exclusive-l'
69
+ { "startIndex": 11, "endIndex": 12, "scopes": ["source.abl", "punctuation.terminator.abl"] } // ':'
70
+ ],
71
+ [
72
+ { "startIndex": 0, "endIndex": 3, "scopes": ["source.abl", "keyword.other.abl"] }, // 'end'
73
+ { "startIndex": 3, "endIndex": 4, "scopes": ["source.abl", "punctuation.terminator.abl"] } // '.'
74
+ ]
75
+ ]
76
+ shared.itShouldMatchExpectedScopes(statement, expectedTokens);
77
+ })
78
+
79
+ describe('', () => {
80
+ let statement = `for each bCustomer
81
+ share-lo:
82
+ end.`;
83
+ let expectedTokens = [
84
+ [
85
+ { "startIndex": 0, "endIndex": 3, "scopes": ["source.abl", "keyword.other.abl"] }, // 'for'
86
+ { "startIndex": 3, "endIndex": 4, "scopes": ["source.abl"] }, // ' '
87
+ { "startIndex": 4, "endIndex": 8, "scopes": ["source.abl", "keyword.other.abl"] }, // 'each'
88
+ { "startIndex": 8, "endIndex": 9, "scopes": ["source.abl"] }, // ' '
89
+ { "startIndex": 9, "endIndex": 18, "scopes": ["source.abl", "storage.data.table.abl"] } // 'bCustomer'
90
+ ],
91
+ [
92
+ { "startIndex": 0, "endIndex": 8, "scopes": ["source.abl", "keyword.other.abl"] }, // 'share-lo'
93
+ { "startIndex": 8, "endIndex": 9, "scopes": ["source.abl", "punctuation.terminator.abl"] } // ':'
94
+ ],
95
+ [
96
+ { "startIndex": 0, "endIndex": 3, "scopes": ["source.abl", "keyword.other.abl"] }, // 'end'
97
+ { "startIndex": 3, "endIndex": 4, "scopes": ["source.abl", "punctuation.terminator.abl"] } // '.'
98
+ ]
99
+ ]
100
+ shared.itShouldMatchExpectedScopes(statement, expectedTokens);
101
+ })
102
+
103
+ describe('', () => {
104
+ let statement = `block-label: for each bCustomer
105
+ share-lo:
106
+ end.`;
107
+ let expectedTokens = [
108
+ [
109
+ { "startIndex": 0, "endIndex": 11, "scopes": ["source.abl", "meta.block.label.abl"] }, // 'block-label'
110
+ { "startIndex": 11, "endIndex": 12, "scopes": ["source.abl", "punctuation.terminator.abl"] }, // ':'
111
+ { "startIndex": 12, "endIndex": 13, "scopes": ["source.abl"] }, // ' '
112
+ { "startIndex": 13, "endIndex": 16, "scopes": ["source.abl", "keyword.other.abl"] }, // 'for'
113
+ { "startIndex": 16, "endIndex": 17, "scopes": ["source.abl"] }, // ' '
114
+ { "startIndex": 17, "endIndex": 21, "scopes": ["source.abl", "keyword.other.abl"] }, // 'each'
115
+ { "startIndex": 21, "endIndex": 22, "scopes": ["source.abl"] }, // ' '
116
+ { "startIndex": 22, "endIndex": 31, "scopes": ["source.abl", "storage.data.table.abl"] } // 'bCustomer'
117
+ ],
118
+ [
119
+ { "startIndex": 0, "endIndex": 8, "scopes": ["source.abl", "keyword.other.abl"] }, // 'share-lo'
120
+ { "startIndex": 8, "endIndex": 9, "scopes": ["source.abl", "punctuation.terminator.abl"] } // ':'
121
+ ],
122
+ [
123
+ { "startIndex": 0, "endIndex": 3, "scopes": ["source.abl", "keyword.other.abl"] }, // 'end'
124
+ { "startIndex": 3, "endIndex": 4, "scopes": ["source.abl", "punctuation.terminator.abl"] } // '.'
125
+ ]
126
+ ]
127
+ shared.itShouldMatchExpectedScopes(statement, expectedTokens);
128
+ })
129
+
130
+ describe('', () => {
131
+ let statement = `block-label:
132
+ repeat for bCustomer:
133
+ end.`;
134
+ let expectedTokens = [
135
+ [
136
+ { "startIndex": 0, "endIndex": 11, "scopes": ["source.abl", "meta.block.label.abl"] }, // 'block-label'
137
+ { "startIndex": 11, "endIndex": 12, "scopes": ["source.abl", "punctuation.terminator.abl"] } // ':'
138
+ ],
139
+ [
140
+ { "startIndex": 0, "endIndex": 6, "scopes": ["source.abl", "meta.block.abl", "keyword.other.abl"] }, // 'repeat'
141
+ { "startIndex": 6, "endIndex": 7, "scopes": ["source.abl", "meta.block.abl"] }, // ' '
142
+ { "startIndex": 7, "endIndex": 10, "scopes": ["source.abl", "meta.block.abl", "keyword.other.abl"] }, // 'for'
143
+ { "startIndex": 10, "endIndex": 11, "scopes": ["source.abl", "meta.block.abl"] }, // ' '
144
+ { "startIndex": 11, "endIndex": 20, "scopes": ["source.abl", "meta.block.abl", "storage.data.table.abl"] }, // 'bCustomer'
145
+ { "startIndex": 20, "endIndex": 21, "scopes": ["source.abl", "punctuation.terminator.abl"] } // ':'
146
+ ],
147
+ [
148
+ { "startIndex": 0, "endIndex": 3, "scopes": ["source.abl", "keyword.other.abl"] }, // 'end'
149
+ { "startIndex": 3, "endIndex": 4, "scopes": ["source.abl", "punctuation.terminator.abl"] } // '.'
150
+ ]
151
+ ]
152
+ shared.itShouldMatchExpectedScopes(statement, expectedTokens);
153
+ })
@@ -9,7 +9,7 @@ describe('', () => {
9
9
  let expectedTokens = [
10
10
  [
11
11
  { "startIndex": 0, "endIndex": 2, "scopes": ["source.abl", "meta.block.abl", "keyword.other.abl"] }, // 'do'
12
- { "startIndex": 2, "endIndex": 3, "scopes": ["source.abl", "meta.block.abl"] }, // ' '
12
+ { "startIndex": 2, "endIndex": 3, "scopes": ["source.abl", "meta.block.abl", "meta.block.branch.abl"] }, // ' '
13
13
  { "startIndex": 3, "endIndex": 5, "scopes": ["source.abl", "meta.block.abl", "meta.block.branch.abl", "keyword.other.abl"] }, // 'on'
14
14
  { "startIndex": 5, "endIndex": 6, "scopes": ["source.abl", "meta.block.abl", "meta.block.branch.abl"] }, // ' '
15
15
  { "startIndex": 6, "endIndex": 11, "scopes": ["source.abl", "meta.block.abl", "meta.block.branch.abl", "keyword.other.abl"] }, // 'error'
@@ -78,7 +78,12 @@ describe('', () => {
78
78
  { "startIndex": 69, "endIndex": 70, "scopes": ["source.abl", "meta.block.abl", "meta.block.branch.abl"] }, // ' '
79
79
  { "startIndex": 70, "endIndex": 73, "scopes": ["source.abl", "meta.block.abl", "meta.block.branch.abl", "keyword.other.abl"] }, // 'NEW'
80
80
  { "startIndex": 73, "endIndex": 74, "scopes": ["source.abl", "meta.block.abl", "meta.block.branch.abl"] }, // ' '
81
- { "startIndex": 74, "endIndex": 106, "scopes": ["source.abl", "meta.block.abl", "meta.block.branch.abl", "entity.name.type.abl"] } // 'StopConditionException() &ENDIF:'
81
+ { "startIndex": 74, "endIndex": 96, "scopes": ["source.abl", "meta.block.abl", "meta.block.branch.abl", "entity.name.type.abl"] }, // 'StopConditionException'
82
+ { "startIndex": 96, "endIndex": 97, "scopes": ["source.abl", "meta.block.abl", "meta.block.branch.abl", "meta.function.arguments.abl", "meta.brace.round.js"] }, // '('
83
+ { "startIndex": 97, "endIndex": 98, "scopes": ["source.abl", "meta.block.abl", "meta.block.branch.abl", "meta.brace.round.js"] }, // ')'
84
+ { "startIndex": 98, "endIndex": 99, "scopes": ["source.abl", "meta.block.abl", "meta.block.branch.abl"] }, // ' '
85
+ { "startIndex": 99, "endIndex": 105, "scopes": ["source.abl", "meta.block.abl", "meta.block.branch.abl", "storage.type.function.abl"] }, // '&ENDIF'
86
+ { "startIndex": 105, "endIndex": 106, "scopes": ["source.abl", "punctuation.terminator.abl"] } // ':'
82
87
  ]
83
88
  ];
84
89
  shared.itShouldMatchExpectedScopes(statement, expectedTokens);
@@ -6,7 +6,7 @@ describe('', () => {
6
6
  let expectedTokens = [
7
7
  { "startIndex": 0, "endIndex": 3, "scopes": ["source.abl", "keyword.other.abl"] }, // 'run'
8
8
  { "startIndex": 3, "endIndex": 4, "scopes": ["source.abl"] }, // ' '
9
- { "startIndex": 4, "endIndex": 10, "scopes": ["source.abl", "meta.other.procedure.abl"] }, // 'getOEM'
9
+ { "startIndex": 4, "endIndex": 10, "scopes": ["source.abl", "entity.name.procedure.abl"] }, // 'getOEM'
10
10
  { "startIndex": 10, "endIndex": 11, "scopes": ["source.abl", "meta.function.arguments.abl", "meta.brace.round.js"] }, // '('
11
11
  { "startIndex": 11, "endIndex": 12, "scopes": ["source.abl", "meta.function.arguments.abl"] }, // ' '
12
12
  { "startIndex": 12, "endIndex": 16, "scopes": ["source.abl", "meta.function.arguments.abl", "variable.other.abl"] }, // 'host'
@@ -558,8 +558,8 @@ describe('', () => {
558
558
  ],
559
559
  [
560
560
  { "startIndex": 0, "endIndex": 2, "scopes": ["source.abl"] }, // ' '
561
- { "startIndex": 2, "endIndex": 13, "scopes": ["source.abl", "meta.block.label.abl"] }, // 'TRANSACTION'
562
- { "startIndex": 13, "endIndex": 15, "scopes": ["source.abl"] } // ':'
561
+ { "startIndex": 2, "endIndex": 13, "scopes": ["source.abl", "keyword.other.abl"] }, // 'TRANSACTION'
562
+ { "startIndex": 13, "endIndex": 14, "scopes": ["source.abl", "punctuation.terminator.abl"] } // ':'
563
563
  ]
564
564
  ];
565
565
  shared.itShouldMatchExpectedScopes(statement, expectedTokens);
@@ -154,3 +154,75 @@ describe('', () => {
154
154
  ];
155
155
  shared.itShouldMatchExpectedScopes(statement, expectedTokens);
156
156
  })
157
+
158
+ describe('', () => {
159
+ let statement = `define output parameter table for ttCustomer.`;
160
+ let expectedTokens = [
161
+ { "startIndex": 0, "endIndex": 6, "scopes": ["source.abl", "meta.define.abl", "keyword.other.abl"] }, // 'define'
162
+ { "startIndex": 6, "endIndex": 7, "scopes": ["source.abl", "meta.define.abl"] }, // ' '
163
+ { "startIndex": 7, "endIndex": 13, "scopes": ["source.abl", "meta.define.abl", "keyword.other.abl"] }, // 'output'
164
+ { "startIndex": 13, "endIndex": 14, "scopes": ["source.abl", "meta.define.abl"] }, // ' '
165
+ { "startIndex": 14, "endIndex": 23, "scopes": ["source.abl", "meta.define.abl", "keyword.other.abl"] }, // 'parameter'
166
+ { "startIndex": 23, "endIndex": 24, "scopes": ["source.abl", "meta.define.abl"] }, // ' '
167
+ { "startIndex": 24, "endIndex": 29, "scopes": ["source.abl", "meta.define.abl", "keyword.other.abl"] }, // 'table'
168
+ { "startIndex": 29, "endIndex": 30, "scopes": ["source.abl", "meta.define.abl"] }, // ' '
169
+ { "startIndex": 30, "endIndex": 33, "scopes": ["source.abl", "meta.define.abl", "keyword.other.abl"] }, // 'for'
170
+ { "startIndex": 33, "endIndex": 34, "scopes": ["source.abl", "meta.define.abl"] }, // ' '
171
+ { "startIndex": 34, "endIndex": 44, "scopes": ["source.abl", "meta.define.abl", "storage.data.table.abl"] }, // 'ttCustomer'
172
+ { "startIndex": 44, "endIndex": 45, "scopes": ["source.abl", "meta.define.abl", "punctuation.terminator.abl"] } // '.'
173
+ ];
174
+ shared.itShouldMatchExpectedScopes(statement, expectedTokens);
175
+ })
176
+
177
+ describe('', () => {
178
+ let statement = `define output parameter dataset for dsCustomer.`;
179
+ let expectedTokens = [
180
+ { "startIndex": 0, "endIndex": 6, "scopes": ["source.abl", "meta.define.abl", "keyword.other.abl"] }, // 'define'
181
+ { "startIndex": 6, "endIndex": 7, "scopes": ["source.abl", "meta.define.abl"] }, // ' '
182
+ { "startIndex": 7, "endIndex": 13, "scopes": ["source.abl", "meta.define.abl", "keyword.other.abl"] }, // 'output'
183
+ { "startIndex": 13, "endIndex": 14, "scopes": ["source.abl", "meta.define.abl"] }, // ' '
184
+ { "startIndex": 14, "endIndex": 23, "scopes": ["source.abl", "meta.define.abl", "keyword.other.abl"] }, // 'parameter'
185
+ { "startIndex": 23, "endIndex": 24, "scopes": ["source.abl", "meta.define.abl"] }, // ' '
186
+ { "startIndex": 24, "endIndex": 31, "scopes": ["source.abl", "meta.define.abl", "keyword.other.abl"] }, // 'dataset'
187
+ { "startIndex": 31, "endIndex": 32, "scopes": ["source.abl", "meta.define.abl"] }, // ' '
188
+ { "startIndex": 32, "endIndex": 35, "scopes": ["source.abl", "meta.define.abl", "keyword.other.abl"] }, // 'for'
189
+ { "startIndex": 35, "endIndex": 36, "scopes": ["source.abl", "meta.define.abl"] }, // ' '
190
+ { "startIndex": 36, "endIndex": 46, "scopes": ["source.abl", "meta.define.abl", "storage.data.dataset.abl"] }, // 'dsCustomer'
191
+ { "startIndex": 46, "endIndex": 47, "scopes": ["source.abl", "meta.define.abl", "punctuation.terminator.abl"] } // '.'
192
+ ];
193
+ shared.itShouldMatchExpectedScopes(statement, expectedTokens);
194
+ })
195
+
196
+ describe('', () => {
197
+ let statement = `define output parameter table-handle vTableHandle.`;
198
+ let expectedTokens = [
199
+ { "startIndex": 0, "endIndex": 6, "scopes": ["source.abl", "meta.define.abl", "keyword.other.abl"] }, // 'define'
200
+ { "startIndex": 6, "endIndex": 7, "scopes": ["source.abl", "meta.define.abl"] }, // ' '
201
+ { "startIndex": 7, "endIndex": 13, "scopes": ["source.abl", "meta.define.abl", "keyword.other.abl"] }, // 'output'
202
+ { "startIndex": 13, "endIndex": 14, "scopes": ["source.abl", "meta.define.abl"] }, // ' '
203
+ { "startIndex": 14, "endIndex": 23, "scopes": ["source.abl", "meta.define.abl", "keyword.other.abl"] }, // 'parameter'
204
+ { "startIndex": 23, "endIndex": 24, "scopes": ["source.abl", "meta.define.abl"] }, // ' '
205
+ { "startIndex": 24, "endIndex": 36, "scopes": ["source.abl", "meta.define.abl", "keyword.other.abl"] }, // 'table-handle'
206
+ { "startIndex": 36, "endIndex": 37, "scopes": ["source.abl", "meta.define.abl"] }, // ' '
207
+ { "startIndex": 37, "endIndex": 49, "scopes": ["source.abl", "meta.define.abl", "variable.other.abl"] }, // 'vTableHandle'
208
+ { "startIndex": 49, "endIndex": 50, "scopes": ["source.abl", "meta.define.abl", "punctuation.terminator.abl"] } // '.'
209
+ ];
210
+ shared.itShouldMatchExpectedScopes(statement, expectedTokens);
211
+ })
212
+
213
+ describe('', () => {
214
+ let statement = `define output parameter dataset-handle vDatasetHandle.`;
215
+ let expectedTokens = [
216
+ { "startIndex": 0, "endIndex": 6, "scopes": ["source.abl", "meta.define.abl", "keyword.other.abl"] }, // 'define'
217
+ { "startIndex": 6, "endIndex": 7, "scopes": ["source.abl", "meta.define.abl"] }, // ' '
218
+ { "startIndex": 7, "endIndex": 13, "scopes": ["source.abl", "meta.define.abl", "keyword.other.abl"] }, // 'output'
219
+ { "startIndex": 13, "endIndex": 14, "scopes": ["source.abl", "meta.define.abl"] }, // ' '
220
+ { "startIndex": 14, "endIndex": 23, "scopes": ["source.abl", "meta.define.abl", "keyword.other.abl"] }, // 'parameter'
221
+ { "startIndex": 23, "endIndex": 24, "scopes": ["source.abl", "meta.define.abl"] }, // ' '
222
+ { "startIndex": 24, "endIndex": 38, "scopes": ["source.abl", "meta.define.abl", "keyword.other.abl"] }, // 'dataset-handle'
223
+ { "startIndex": 38, "endIndex": 39, "scopes": ["source.abl", "meta.define.abl"] }, // ' '
224
+ { "startIndex": 39, "endIndex": 53, "scopes": ["source.abl", "meta.define.abl", "variable.other.abl"] }, // 'vDatasetHandle'
225
+ { "startIndex": 53, "endIndex": 54, "scopes": ["source.abl", "meta.define.abl", "punctuation.terminator.abl"] } // '.'
226
+ ];
227
+ shared.itShouldMatchExpectedScopes(statement, expectedTokens);
228
+ })