abl-tmlanguage 1.3.8 → 1.3.10

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 (41) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/README.md +73 -39
  3. package/abl.tmLanguage.json +812 -580
  4. package/index.js +110 -71
  5. package/package.json +6 -6
  6. package/spec/annotations/annotation.spec.js +8 -2
  7. package/spec/array-extent/issue#5.spec.js +9 -9
  8. package/spec/blocks/block-labels.spec.js +3 -3
  9. package/spec/blocks/block-options.spec.js +18 -0
  10. package/spec/comments/comment-in-block-statement.spec.js +1 -1
  11. package/spec/comments/spacious-comment.spec.js +73 -0
  12. package/spec/create-widgets/create-window.spec.js +221 -0
  13. package/spec/db-table-and-field/create-alias.spec.js +101 -0
  14. package/spec/db-table-and-field/create-record.spec.js +43 -0
  15. package/spec/db-table-and-field/find-record.spec.js +91 -0
  16. package/spec/db-table-and-field/new-record.spec.js +137 -0
  17. package/spec/define/define-browse.spec.js +454 -0
  18. package/spec/define/define-query.spec.js +101 -0
  19. package/spec/define-variable/extent.spec.js +6 -6
  20. package/spec/define-variable/var-statement.spec.js +375 -0
  21. package/spec/include/include-file-name.spec.js +224 -0
  22. package/spec/include/vscode-abl-issue#77.spec.js +2 -2
  23. package/spec/input-output/input-from.spec.js +501 -0
  24. package/spec/input-output/output-to.spec.js +456 -0
  25. package/spec/method-attribute-property-call/get-set-method-name.spec.js +57 -12
  26. package/spec/method-attribute-property-call/method-call.spec.js +93 -0
  27. package/spec/method-definition/constructor.spec.js +4 -4
  28. package/spec/method-definition/method.spec.js +227 -6
  29. package/spec/misc-statements/array-for.spec.js +21 -0
  30. package/spec/misc-statements/class-in-var-name.spec.js +4 -4
  31. package/spec/misc-statements/guid.spec.js +97 -0
  32. package/spec/misc-statements/if-then.spec.js +118 -1
  33. package/spec/preprocesors/proparse-preprocessor.spec.js +66 -0
  34. package/spec/procedure-definition/vscode-abl-issue#26.spec.js +6 -6
  35. package/spec/run-statement/run-statement.spec.js +128 -3
  36. package/spec/type-name/argument.spec.js +10 -11
  37. package/spec/type-name/cast.spec.js +8 -10
  38. package/spec/type-name/define-variable.spec.js +28 -146
  39. package/spec/type-name/get-class.spec.js +18 -18
  40. package/spec/type-name/new.spec.js +70 -10
  41. package/spec/type-name/parameter-as.spec.js +66 -21
package/index.js CHANGED
@@ -1,5 +1,5 @@
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
+ // This script create 3 sections: keywords-<A-Z>, handle-attributes-<A-Z> and abl-functions-<A-Z> . ABL keywords can only be in
2
+ // one of these sections. The "keywords" section contains statements that are not in the attributes or function sections
3
3
  // kwlist.txt file can be generated with `prowin -zgenkwlist > abl-keywords.txt`
4
4
  //
5
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//
@@ -28,9 +28,9 @@ let lineReaderKeywords = require('readline').createInterface({
28
28
  let output = 'grammar.json';
29
29
  let result = {};
30
30
  let attributeBlocks = [[], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], []];
31
- let methodBlocks = [[], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], []];
32
- let keywordBlocks = [[], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], []];
33
- let functionBlocks = [[], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], []];
31
+ let methodBlocks = [[], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], []];
32
+ let keywordBlocks = [[], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], []];
33
+ let functionBlocks = [[], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], []];
34
34
  const re = /(?:\w|-|\()+(?=\s|$)/g
35
35
 
36
36
  // The doc is not always accurate ...
@@ -44,6 +44,7 @@ alsoStatements.push('available');
44
44
  alsoStatements.push('bgcolor');
45
45
  alsoStatements.push('centered');
46
46
  alsoStatements.push('context-help-id');
47
+ alsoStatements.push('column-label');
47
48
  alsoStatements.push('dcolor');
48
49
  alsoStatements.push('default');
49
50
  alsoStatements.push('delete');
@@ -53,14 +54,18 @@ alsoStatements.push('fgcolor');
53
54
  alsoStatements.push('first');
54
55
  alsoStatements.push('flat-button');
55
56
  alsoStatements.push('font');
57
+ alsoStatements.push('foreign-key-hidden');
56
58
  alsoStatements.push('format');
59
+ alsoStatements.push('hidden');
57
60
  alsoStatements.push('image-down');
58
- alsoStatements.push('image-up');
59
61
  alsoStatements.push('image-insensitive');
62
+ alsoStatements.push('image-up');
60
63
  alsoStatements.push('initial');
61
- alsoStatements.push('foreign-key-hidden');
64
+ alsoStatements.push('keep-frame-z-order');
62
65
  alsoStatements.push('label');
63
66
  alsoStatements.push('locked');
67
+ alsoStatements.push('max-button');
68
+ alsoStatements.push('message-area');
64
69
  alsoStatements.push('mouse-pointer');
65
70
  alsoStatements.push('namespace-prefix');
66
71
  alsoStatements.push('namespace-uri');
@@ -68,11 +73,18 @@ alsoStatements.push('nested');
68
73
  alsoStatements.push('no-focus');
69
74
  alsoStatements.push('pfcolor');
70
75
  alsoStatements.push('recursive');
76
+ alsoStatements.push('resize');
71
77
  alsoStatements.push('return-value');
72
78
  alsoStatements.push('row');
79
+ alsoStatements.push('scroll-bars');
80
+ alsoStatements.push('sensitive');
81
+ alsoStatements.push('separators');
73
82
  alsoStatements.push('serialize-hidden');
74
83
  alsoStatements.push('serialize-name');
75
84
  alsoStatements.push('single-run');
85
+ alsoStatements.push('status-area');
86
+ alsoStatements.push('three-d');
87
+ alsoStatements.push('title');
76
88
  alsoStatements.push('tooltip');
77
89
  alsoStatements.push('transaction');
78
90
  alsoStatements.push('view-as');
@@ -86,6 +98,7 @@ functionsNotStatements.push('set-size');
86
98
 
87
99
  let alsoFunctions = [];
88
100
  alsoFunctions.push('lower');
101
+ alsoFunctions.push('os-dir');
89
102
  alsoFunctions.push('relation-fields');
90
103
  alsoFunctions.push('return');
91
104
  alsoFunctions.push('skip');
@@ -93,6 +106,30 @@ alsoFunctions.push('substitute');
93
106
  alsoFunctions.push('this-object');
94
107
  alsoFunctions.push('value');
95
108
 
109
+ let alsoKeywords = [];
110
+ alsoKeywords.push('get-collation'); //plural version as key
111
+
112
+ // This may holds the keyword names and their regex entries
113
+ let keywordEntries = new Map();
114
+ let minKeywords = new Map();
115
+
116
+ // The documentation does not reflect all abbreviations
117
+ minKeywords.set('log', 'logical');
118
+ keywordEntries.set('logical', '(log(?:ical|ica|ic|i)?)|lo|l|(longch(?:ar|a)?)');
119
+
120
+ minKeywords.set('&glob', '&global-define');
121
+ keywordEntries.set('&global-define', '(?:&glob(?:al-define|al-defin|al-defi|al-def|al-de|al-d|al-|al|a)?)');
122
+
123
+ minKeywords.set('&scop', '&scoped-define');
124
+ keywordEntries.set('&scoped-define', '(?:&scop(?:ed-define|ed-defin|ed-defi|ed-def|ed-de|ed-d|ed-|ed|e)?)');
125
+
126
+ minKeywords.set('glob', 'global');
127
+ keywordEntries.set('global', '(?:glob(?:al|a)?)');
128
+
129
+ minKeywords.set('var', 'variable');
130
+ keywordEntries.set('variable', '(var(?:iable|iabl|iab|ia|i)?)');
131
+
132
+
96
133
  lineReaderMethods.on('line', line => {
97
134
  let results;
98
135
  line = line.toLowerCase();
@@ -132,21 +169,14 @@ lineReaderFunctions.on('line', line => {
132
169
  if (!line.startsWith("#")) {
133
170
 
134
171
  let kw = line.split(' ');
135
- let kwName = '';
136
172
 
137
173
  // This is to skip the FUNCTION statement
138
174
  if (kw.includes('function') && !kw.includes('statement')) {
139
-
140
- if (kw.includes('preprocessor')) {
141
- kwName = kw[0];
142
- } else {
143
- kwName = kw.slice(0, kw.indexOf('function')).join(' ');
144
- }
175
+ let kwName = kw[0];
145
176
 
146
177
  // CAPS letter alphabet
147
178
  let charIdx = kwName.charCodeAt(0) - 97;
148
-
149
- if (!functionBlocks[charIdx].includes(kwName) && !kwName.includes('...')) {
179
+ if (!functionBlocks[charIdx].includes(kwName)) {
150
180
  functionBlocks[charIdx].push(kwName);
151
181
  }
152
182
 
@@ -163,9 +193,7 @@ lineReaderFunctions.on('line', line => {
163
193
 
164
194
  if (keyWord.indexOf('(') !== -1) { continue; }
165
195
 
166
- if (keyWord.includes('...')) { break; }
167
-
168
- kw2 = keyWord.replace(",", "");
196
+ let kw2 = keyWord.replace(",", "");
169
197
 
170
198
  if (charIdx > 0 && functionsNotStatements.includes(kw2)) {
171
199
  functionBlocks[charIdx].push(kw2);
@@ -190,53 +218,80 @@ lineReaderKeywords.on('line', line => {
190
218
  let kwParts = kw.split('(');
191
219
  let fullKw = kwParts[0] + kwParts[1];
192
220
 
193
- kw = kwParts[0];
194
- addToBlock(charIdx, fullKw, kw);
195
-
196
- let kwComplete = kwParts[1];
197
- for (const element of kwComplete) {
198
- kw += element;
199
-
200
- addToBlock(charIdx, fullKw, kw);
221
+ // Add shortest version first, then the remainder in length order, eg
222
+ // (char(?:haracter|haracte|haract|harac|hara)?)?
223
+ // CHARACTER differs in the keywords from the actual behaviour
224
+ let kwRegex = '(' + kwParts[0] + '(?:';
225
+ for (let i = kwParts[1].length; i > 0; i--) {
226
+ kwRegex += kwParts[1].substring(0, i);
227
+ if (i > 1) {
228
+ kwRegex += '|';
229
+ }
201
230
  }
231
+ kwRegex += ')?)';
232
+ addToBlock(charIdx, fullKw, kwParts[0], kwRegex);
202
233
  } else {
203
- addToBlock(charIdx, kw, kw);
234
+ addToBlock(charIdx, kw, kw, kw);
204
235
  }
205
236
  }
206
237
  }
207
238
  });
239
+ // Find an appropriate keyword regex
240
+ function getKwRegex(fullKw) {
241
+ let kwRegex = keywordEntries.get(fullKw);
208
242
 
209
- function addToBlock(charIdx, fullKw, addKw) {
243
+ if (kwRegex) {
244
+ return kwRegex;
245
+ }
210
246
 
211
- if (attributeBlocks[charIdx].includes(fullKw)) {
212
- if (!attributeBlocks[charIdx].includes(addKw)) {
213
- attributeBlocks[charIdx].push(addKw);
214
- }
215
- } else if (methodBlocks[charIdx].includes(fullKw)) {
216
- if (!methodBlocks[charIdx].includes(addKw)) {
217
- methodBlocks[charIdx].push(addKw);
218
- }
219
- } else if (functionBlocks[charIdx].includes(fullKw)) {
220
- if (!functionBlocks[charIdx].includes(addKw)) {
221
- functionBlocks[charIdx].push(addKw);
222
- }
223
- } else {
224
- if (!keywordBlocks[charIdx].includes(addKw)) {
225
- keywordBlocks[charIdx].push(addKw);
226
- }
247
+ if (minKeywords.has(fullKw)) {
248
+ return keywordEntries.get(minKeywords.get(fullKw));
227
249
  }
228
250
 
229
- if (alsoFunctions.includes(fullKw)) {
230
- if (!functionBlocks[charIdx].includes(addKw)) {
231
- functionBlocks[charIdx].push(addKw);
232
- }
251
+ if (alsoKeywords.includes(fullKw)) {
252
+ return fullKw;
233
253
  }
254
+ }
234
255
 
256
+ // Adds the kewword regex to the relevant block
257
+ function addToBlock(charIdx, fullKw, minKw, kwRegex) {
258
+ // We will use these to resolve the full keywords later
259
+ if (!minKeywords.has(minKw)) {
260
+ minKeywords.set(minKw, fullKw);
261
+ }
262
+ if (!keywordEntries.has(fullKw)) {
263
+ keywordEntries.set(fullKw, kwRegex);
264
+ }
265
+
266
+ if (!attributeBlocks[charIdx].includes(fullKw) &&
267
+ !methodBlocks[charIdx].includes(fullKw) &&
268
+ !functionBlocks[charIdx].includes(fullKw) &&
269
+ !keywordBlocks[charIdx].includes(fullKw)) {
270
+ keywordBlocks[charIdx].push(fullKw);
271
+ }
272
+
273
+ if (alsoFunctions.includes(fullKw) &&
274
+ !functionBlocks[charIdx].includes(fullKw)) {
275
+ functionBlocks[charIdx].push(fullKw);
276
+ }
235
277
  }
236
278
 
237
- lineReaderKeywords.on('close', () => {
279
+ // Replaces full keywords in an array with the regexes, if any
280
+ function replaceKeywordsWithRegex (kwArray) {
281
+ let regexBlocks = [];
238
282
 
239
- result['keywords'] = { patterns: [] }
283
+ for (idx in kwArray) {
284
+ regexBlocks[idx] = getKwRegex(kwArray[idx]);
285
+ }
286
+ return regexBlocks;
287
+ }
288
+
289
+ lineReaderFunctions.on('close', () => {
290
+
291
+ result['keywords'] = {
292
+ comment: "These scopes contain statements, not all the keywords. Methods, attributes and functions have their own scopes.",
293
+ patterns: [],
294
+ }
240
295
 
241
296
  for (var zz = 0; zz < 26; zz++) {
242
297
 
@@ -246,7 +301,7 @@ lineReaderKeywords.on('close', () => {
246
301
  result['keywords-' + String.fromCharCode(97 + zz).toUpperCase()] =
247
302
  {
248
303
  comment: "The keyword must not have a trailing variable character (one of #$-_%&)",
249
- match: "(?i)\\b(" + keywordBlocks[zz].sort(reverseSort).join('|') + ")\\b(?![\\#\\$\\-\\_\\%\\&])",
304
+ match: "(?i)\\b(" + replaceKeywordsWithRegex(keywordBlocks[zz]).sort().join('|') + ")\\b(?![#$\\-_%&])",
250
305
  captures: {
251
306
  1: {
252
307
  name: "keyword.other.abl"
@@ -265,7 +320,7 @@ lineReaderKeywords.on('close', () => {
265
320
 
266
321
  result['handle-attributes-' + String.fromCharCode(97 + zz).toUpperCase()] =
267
322
  {
268
- match: "(?i)(:)(" + attributeBlocks[zz].sort(reverseSort).join('|') + ")\\b(?![\\#\\$\\-\\_\\%\\&])",
323
+ match: "(?i)(:)(" + replaceKeywordsWithRegex(attributeBlocks[zz]).sort().join('|') + ")\\b(?![#$\\-_%&])",
269
324
  captures: {
270
325
  1: {
271
326
  name: "punctuation.separator.colon.abl"
@@ -286,7 +341,7 @@ lineReaderKeywords.on('close', () => {
286
341
 
287
342
  result['handle-methods-' + String.fromCharCode(97 + zz).toUpperCase()] =
288
343
  {
289
- begin: "(?i)(:)(" + methodBlocks[zz].sort(reverseSort).join('|') + ")\\s*(?=\\()",
344
+ begin: "(?i)(:)(" + replaceKeywordsWithRegex(methodBlocks[zz]).sort().join('|') + ")\\s*(?=\\()",
290
345
  beginCaptures: {
291
346
  1: {
292
347
  name: "punctuation.separator.colon.abl"
@@ -319,7 +374,7 @@ lineReaderKeywords.on('close', () => {
319
374
  result['abl-functions-' + String.fromCharCode(97 + zz).toUpperCase()] =
320
375
  {
321
376
  name: "meta.function-call.abl",
322
- begin: "(?i)\\s*(" + functionBlocks[zz].sort(reverseSort).join('|') + ")\\s*(?=\\()",
377
+ begin: "(?i)\\s*(" + replaceKeywordsWithRegex(functionBlocks[zz]).sort().join('|') + ")\\s*(?=\\()",
323
378
  beginCaptures: {
324
379
  1: {
325
380
  name: "support.function.abl"
@@ -341,19 +396,3 @@ lineReaderKeywords.on('close', () => {
341
396
  }
342
397
  fs.writeFileSync(output, JSON.stringify(result, undefined, 4));
343
398
  })
344
-
345
- // Sorts in reverse order - so that the longer versions of the keywords appear earlier in the regex
346
- function reverseSort(a, b) {
347
- const nameA = a.toLowerCase(); // ignore upper and lowercase
348
- const nameB = b.toLowerCase(); // ignore upper and lowercase
349
-
350
- if (nameA < nameB) {
351
- return 1;
352
- }
353
- if (nameA > nameB) {
354
- return -1;
355
- }
356
-
357
- // names are equal
358
- return 0;
359
- }
package/package.json CHANGED
@@ -1,21 +1,21 @@
1
1
  {
2
2
  "name": "abl-tmlanguage",
3
- "version": "1.3.8",
4
- "description": "Textmate grammar for Progress OpenEdge ABL Language",
3
+ "version": "1.3.10",
4
+ "description": "TextMate grammar for Progress OpenEdge ABL Language",
5
5
  "main": "",
6
6
  "repository": {
7
7
  "type": "git",
8
- "url": "git+https://github.com/chriscamicas/openedge-abl-syntax.git"
8
+ "url": "git@github.com:chriscamicas/abl-tmlanguage.git"
9
9
  },
10
10
  "author": "Christophe Camicas",
11
11
  "license": "MIT",
12
12
  "bugs": {
13
- "url": "https://github.com/chriscamicas/openedge-abl-syntax/issues"
13
+ "url": "https://github.com/chriscamicas/abl-tmlanguage/issues"
14
14
  },
15
- "homepage": "https://github.com/chriscamicas/openedge-abl-syntax#readme",
15
+ "homepage": "https://github.com/chriscamicas/abl-tmlanguage",
16
16
  "scripts": {
17
17
  "build": "node index.js",
18
- "test": "mocha spec/*/*.spec.js",
18
+ "test": "mocha spec/*/*.spec.js",
19
19
  "test:single": "mocha",
20
20
  "test:debug": "mocha 'spec/*/*.spec.js' -- --inspect-brk=5858"
21
21
  },
@@ -64,8 +64,14 @@ describe('', () => {
64
64
  { "startIndex": 33, "endIndex": 34, "scopes": ["source.abl", "meta.declaration.annotation.abl", "string.double.complex.abl", "punctuation.definition.string.end.abl"] }, // '"'
65
65
  { "startIndex": 34, "endIndex": 35, "scopes": ["source.abl", "meta.declaration.annotation.abl", "punctuation.separator.comma.abl"] }, // ','
66
66
  { "startIndex": 35, "endIndex": 36, "scopes": ["source.abl", "meta.declaration.annotation.abl"] }, // ' '
67
- { "startIndex": 36, "endIndex": 47, "scopes": ["source.abl", "meta.declaration.annotation.abl", "entity.other.attribute-name.abl"] }, // 'three='3').'
68
- { "startIndex": 47, "endIndex": 50, "scopes": ["source.abl", "meta.declaration.annotation.abl"] } // ' '
67
+ { "startIndex": 36, "endIndex": 41, "scopes": ["source.abl", "meta.declaration.annotation.abl", "entity.other.attribute-name.abl"] }, // 'three'
68
+ { "startIndex": 41, "endIndex": 42, "scopes": ["source.abl", "meta.declaration.annotation.abl", "keyword.operator.source.abl"] }, // '='
69
+ { "startIndex": 42, "endIndex": 43, "scopes": ["source.abl", "meta.declaration.annotation.abl", "string.single.complex.abl", "punctuation.definition.string.begin.abl"] }, // '''
70
+ { "startIndex": 43, "endIndex": 44, "scopes": ["source.abl", "meta.declaration.annotation.abl", "string.single.complex.abl"] }, // '3'
71
+ { "startIndex": 44, "endIndex": 45, "scopes": ["source.abl", "meta.declaration.annotation.abl", "string.single.complex.abl", "punctuation.definition.string.end.abl"] }, // '''
72
+ { "startIndex": 45, "endIndex": 46, "scopes": ["source.abl", "meta.declaration.annotation.abl", "meta.brace.round.js"] }, // ')'
73
+ { "startIndex": 46, "endIndex": 47, "scopes": ["source.abl", "punctuation.terminator.abl"] }, // '.'
74
+ { "startIndex": 47, "endIndex": 50, "scopes": ["source.abl"] } // ' '
69
75
  ];
70
76
  shared.itShouldMatchExpectedScopes(statement, expectedTokens);
71
77
  })
@@ -5,10 +5,10 @@ describe('', () => {
5
5
  //label-with-a-dot-inside.spec
6
6
  let statement = `mExtVar[mI]`;
7
7
  let expectedTokens = [
8
- { "startIndex": 0, "endIndex": 7, "scopes": ["source.abl", "variable.other.abl"] },
9
- { "startIndex": 7, "endIndex": 8, "scopes": ["source.abl", "meta.array.literal.abl", "meta.brace.square.abl"] },
10
- { "startIndex": 8, "endIndex": 10, "scopes": ["source.abl", "meta.array.literal.abl", "variable.other.abl"] },
11
- { "startIndex": 10, "endIndex": 11, "scopes": ["source.abl", "meta.array.literal.abl", "meta.brace.square.abl"] }
8
+ { "startIndex": 0, "endIndex": 7, "scopes": ["source.abl", "variable.other.abl"] }, // 'mExtVar'
9
+ { "startIndex": 7, "endIndex": 8, "scopes": ["source.abl", "meta.array.literal.abl", "punctuation.definition.bracket.square.begin.abl"] }, // '['
10
+ { "startIndex": 8, "endIndex": 10, "scopes": ["source.abl", "meta.array.literal.abl", "variable.other.abl"] }, // 'mI'
11
+ { "startIndex": 10, "endIndex": 11, "scopes": ["source.abl", "meta.array.literal.abl", "punctuation.definition.bracket.square.end.abl"] } // ']'
12
12
  ];
13
13
  shared.itShouldMatchExpectedScopes(statement, expectedTokens);
14
14
  })
@@ -16,11 +16,11 @@ describe('', () => {
16
16
  describe('', () => {
17
17
  let statement = `mExtVar[ mI]`;
18
18
  let expectedTokens = [
19
- { "startIndex": 0, "endIndex": 7, "scopes": ["source.abl", "variable.other.abl"] },
20
- { "startIndex": 7, "endIndex": 8, "scopes": ["source.abl", "meta.array.literal.abl", "meta.brace.square.abl"] },
21
- { "startIndex": 8, "endIndex": 9, "scopes": ["source.abl", "meta.array.literal.abl"] },
22
- { "startIndex": 9, "endIndex": 11, "scopes": ["source.abl", "meta.array.literal.abl", "variable.other.abl"] },
23
- { "startIndex": 11, "endIndex": 12, "scopes": ["source.abl", "meta.array.literal.abl", "meta.brace.square.abl"] }
19
+ { "startIndex": 0, "endIndex": 7, "scopes": ["source.abl", "variable.other.abl"] }, // 'mExtVar'
20
+ { "startIndex": 7, "endIndex": 8, "scopes": ["source.abl", "meta.array.literal.abl", "punctuation.definition.bracket.square.begin.abl"] }, // '['
21
+ { "startIndex": 8, "endIndex": 9, "scopes": ["source.abl", "meta.array.literal.abl"] }, // ' '
22
+ { "startIndex": 9, "endIndex": 11, "scopes": ["source.abl", "meta.array.literal.abl", "variable.other.abl"] }, // 'mI'
23
+ { "startIndex": 11, "endIndex": 12, "scopes": ["source.abl", "meta.array.literal.abl", "punctuation.definition.bracket.square.end.abl"] } // ']'
24
24
  ];
25
25
  shared.itShouldMatchExpectedScopes(statement, expectedTokens);
26
26
  })
@@ -106,7 +106,7 @@ share-lo:
106
106
  end.`;
107
107
  let expectedTokens = [
108
108
  [
109
- { "startIndex": 0, "endIndex": 11, "scopes": ["source.abl", "meta.block.label.abl"] }, // 'block-label'
109
+ { "startIndex": 0, "endIndex": 11, "scopes": ["source.abl", "entity.name.label.abl"] }, // 'block-label'
110
110
  { "startIndex": 11, "endIndex": 12, "scopes": ["source.abl", "punctuation.terminator.abl"] }, // ':'
111
111
  { "startIndex": 12, "endIndex": 13, "scopes": ["source.abl"] }, // ' '
112
112
  { "startIndex": 13, "endIndex": 16, "scopes": ["source.abl", "keyword.other.abl"] }, // 'for'
@@ -133,7 +133,7 @@ repeat for bCustomer:
133
133
  end.`;
134
134
  let expectedTokens = [
135
135
  [
136
- { "startIndex": 0, "endIndex": 11, "scopes": ["source.abl", "meta.block.label.abl"] }, // 'block-label'
136
+ { "startIndex": 0, "endIndex": 11, "scopes": ["source.abl", "entity.name.label.abl"] }, // 'block-label'
137
137
  { "startIndex": 11, "endIndex": 12, "scopes": ["source.abl", "punctuation.terminator.abl"] } // ':'
138
138
  ],
139
139
  [
@@ -158,7 +158,7 @@ for bCustomer exclusive-lock:
158
158
  end.`;
159
159
  let expectedTokens = [
160
160
  [
161
- { "startIndex": 0, "endIndex": 20, "scopes": ["source.abl", "meta.block.label.abl"] }, // 'EXCLUSIVE-LOCK-BLOCK'
161
+ { "startIndex": 0, "endIndex": 20, "scopes": ["source.abl", "entity.name.label.abl"] }, // 'EXCLUSIVE-LOCK-BLOCK'
162
162
  { "startIndex": 20, "endIndex": 21, "scopes": ["source.abl", "punctuation.terminator.abl"] } // ':'
163
163
  ],
164
164
  [
@@ -0,0 +1,18 @@
1
+ const { assert, expect } = require('chai');
2
+ const shared = require('../shared.js');
3
+
4
+ describe('', () => {
5
+ let statement = `do with frame {&FRAME-NAME}:`;
6
+ let expectedTokens = [
7
+ { "startIndex": 0, "endIndex": 2, "scopes": ["source.abl", "meta.block.abl", "keyword.other.abl"] }, // 'do'
8
+ { "startIndex": 2, "endIndex": 3, "scopes": ["source.abl", "meta.block.abl"] }, // ' '
9
+ { "startIndex": 3, "endIndex": 7, "scopes": ["source.abl", "meta.block.abl", "keyword.other.abl"] }, // 'with'
10
+ { "startIndex": 7, "endIndex": 8, "scopes": ["source.abl", "meta.block.abl"] }, // ' '
11
+ { "startIndex": 8, "endIndex": 13, "scopes": ["source.abl", "meta.block.abl", "keyword.other.abl"] }, // 'frame'
12
+ { "startIndex": 13, "endIndex": 14, "scopes": ["source.abl", "meta.block.abl"] }, // ' '
13
+ { "startIndex": 14, "endIndex": 27, "scopes": ["source.abl", "meta.block.abl", "storage.type.function.abl"] }, // '{&FRAME-NAME}'
14
+ { "startIndex": 27, "endIndex": 28, "scopes": ["source.abl", "punctuation.terminator.abl"] } // ':'
15
+ ]
16
+ shared.itShouldMatchExpectedScopes(statement, expectedTokens);
17
+ })
18
+
@@ -30,7 +30,7 @@ describe('', () => {
30
30
  { "startIndex": 0, "endIndex": 8, "scopes": ["source.abl", "meta.block.abl"] }, // ' '
31
31
  { "startIndex": 8, "endIndex": 11, "scopes": ["source.abl", "meta.block.abl", "storage.type.function.abl"] }, // '&IF'
32
32
  { "startIndex": 11, "endIndex": 12, "scopes": ["source.abl", "meta.block.abl"] }, // ' '
33
- { "startIndex": 12, "endIndex": 22, "scopes": ["source.abl", "meta.block.abl", "variable.other.abl"] }, // 'PROVERSION'
33
+ { "startIndex": 12, "endIndex": 22, "scopes": ["source.abl", "meta.block.abl", "support.function.abl"] }, // 'PROVERSION'
34
34
  { "startIndex": 22, "endIndex": 23, "scopes": ["source.abl", "meta.block.abl"] }, // ' '
35
35
  { "startIndex": 23, "endIndex": 25, "scopes": ["source.abl", "meta.block.abl", "keyword.operator.source.abl"] }, // 'NE'
36
36
  { "startIndex": 25, "endIndex": 26, "scopes": ["source.abl", "meta.block.abl"] }, // ' '
@@ -0,0 +1,73 @@
1
+ const { assert, expect } = require('chai');
2
+ const shared = require('../shared.js');
3
+
4
+ describe('', () => {
5
+ let statement = `/*ASSIGN ttPropath.codeEnv = ttEnv.codeEnv */`;
6
+ let expectedTokens = [
7
+ { "startIndex": 0, "endIndex": 2, "scopes": ["source.abl", "comment.block.source.abl"] }, // '/*'
8
+ { "startIndex": 2, "endIndex": 1739, "scopes": ["source.abl", "comment.block.source.abl", "comment"] }, // 'ASSIGN ttPropath.codeEnv = ttEnv.codeEnv '
9
+ { "startIndex": 1739, "endIndex": 1741, "scopes": ["source.abl", "comment.block.source.abl"] } // '*/'
10
+ ];
11
+ shared.itShouldMatchExpectedScopes(statement, expectedTokens);
12
+ })
13
+
14
+ describe('', () => {
15
+ let statement = `/* ttPropath.codeOrg = ttOrganisme.codeOrg asfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasa *//* ttPropath.codeOrg = ttOrganisme.codeOrg asfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasa */`;
16
+ let expectedTokens = [
17
+ { "startIndex": 0, "endIndex": 2, "scopes": ["source.abl", "comment.block.source.abl"] }, // '/*'
18
+ { "startIndex": 2, "endIndex": 1739, "scopes": ["source.abl", "comment.block.source.abl", "comment"] }, // ' ttPropath.codeOrg = ttOrganisme.codeOrg asfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasa '
19
+ { "startIndex": 1739, "endIndex": 1741, "scopes": ["source.abl", "comment.block.source.abl"] }, // '*/'
20
+ { "startIndex": 1741, "endIndex": 1743, "scopes": ["source.abl", "comment.block.source.abl"] }, // '/*'
21
+ { "startIndex": 1743, "endIndex": 3480, "scopes": ["source.abl", "comment.block.source.abl", "comment"] }, // ' ttPropath.codeOrg = ttOrganisme.codeOrg asfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasaasfagfagagasgagasgasgasgasgasgasasa '
22
+ { "startIndex": 3480, "endIndex": 3482, "scopes": ["source.abl", "comment.block.source.abl"] } // '*/'
23
+ ];
24
+ shared.itShouldMatchExpectedScopes(statement, expectedTokens);
25
+ })
26
+
27
+ describe('', () => {
28
+ let statement = `c = /* ttPropath.codeOrg /* comment inna comment, tasty */ */ = ttOrganisme.codeOrg`;
29
+ let expectedTokens = [
30
+ { "startIndex": 0, "endIndex": 1, "scopes": ["source.abl", "storage.type.abl"] }, // 'c'
31
+ { "startIndex": 1, "endIndex": 2, "scopes": ["source.abl"] }, // ' '
32
+ { "startIndex": 2, "endIndex": 3, "scopes": ["source.abl", "keyword.operator.source.abl"] }, // '='
33
+ { "startIndex": 3, "endIndex": 4, "scopes": ["source.abl"] }, // ' '
34
+ { "startIndex": 4, "endIndex": 6, "scopes": ["source.abl", "comment.block.source.abl"] }, // '/*'
35
+ { "startIndex": 6, "endIndex": 33, "scopes": ["source.abl", "comment.block.source.abl", "comment"] }, // ' ttPropath.codeOrg '
36
+ { "startIndex": 33, "endIndex": 35, "scopes": ["source.abl", "comment.block.source.abl", "comment", "comment.block.source.abl"] }, // '/*'
37
+ { "startIndex": 35, "endIndex": 64, "scopes": ["source.abl", "comment.block.source.abl", "comment", "comment.block.source.abl", "comment"] }, // ' comment inna comment, tasty '
38
+ { "startIndex": 64, "endIndex": 66, "scopes": ["source.abl", "comment.block.source.abl", "comment", "comment.block.source.abl"] }, // '*/'
39
+ { "startIndex": 66, "endIndex": 68, "scopes": ["source.abl", "comment.block.source.abl", "comment"] }, // ' '
40
+ { "startIndex": 68, "endIndex": 70, "scopes": ["source.abl", "comment.block.source.abl"] }, // '*/'
41
+ { "startIndex": 70, "endIndex": 75, "scopes": ["source.abl"] }, // ' '
42
+ { "startIndex": 75, "endIndex": 76, "scopes": ["source.abl", "keyword.operator.source.abl"] }, // '='
43
+ { "startIndex": 76, "endIndex": 77, "scopes": ["source.abl"] }, // ' '
44
+ { "startIndex": 77, "endIndex": 96, "scopes": ["source.abl", "storage.data.table.abl"] } // 'ttOrganisme.codeOrg'
45
+ ];
46
+ shared.itShouldMatchExpectedScopes(statement, expectedTokens);
47
+ })
48
+
49
+ describe('', () => {
50
+ let statement = `c = /* ttPropath.codeOrg /* comment inna /*and one more*/ comment, tasty */ */ = ttOrganisme.codeOrg`;
51
+ let expectedTokens = [
52
+ { "startIndex": 0, "endIndex": 1, "scopes": ["source.abl", "storage.type.abl"] }, // 'c'
53
+ { "startIndex": 1, "endIndex": 2, "scopes": ["source.abl"] }, // ' '
54
+ { "startIndex": 2, "endIndex": 3, "scopes": ["source.abl", "keyword.operator.source.abl"] }, // '='
55
+ { "startIndex": 3, "endIndex": 4, "scopes": ["source.abl"] }, // ' '
56
+ { "startIndex": 4, "endIndex": 6, "scopes": ["source.abl", "comment.block.source.abl"] }, // '/*'
57
+ { "startIndex": 6, "endIndex": 33, "scopes": ["source.abl", "comment.block.source.abl", "comment"] }, // ' ttPropath.codeOrg '
58
+ { "startIndex": 33, "endIndex": 35, "scopes": ["source.abl", "comment.block.source.abl", "comment", "comment.block.source.abl"] }, // '/*'
59
+ { "startIndex": 35, "endIndex": 49, "scopes": ["source.abl", "comment.block.source.abl", "comment", "comment.block.source.abl", "comment"] }, // ' comment inna '
60
+ { "startIndex": 49, "endIndex": 51, "scopes": ["source.abl", "comment.block.source.abl", "comment", "comment.block.source.abl", "comment", "comment.block.source.abl"] }, // '/*'
61
+ { "startIndex": 51, "endIndex": 63, "scopes": ["source.abl", "comment.block.source.abl", "comment", "comment.block.source.abl", "comment", "comment.block.source.abl", "comment"] }, // 'and one more'
62
+ { "startIndex": 63, "endIndex": 65, "scopes": ["source.abl", "comment.block.source.abl", "comment", "comment.block.source.abl", "comment", "comment.block.source.abl"] }, // '*/'
63
+ { "startIndex": 65, "endIndex": 81, "scopes": ["source.abl", "comment.block.source.abl", "comment", "comment.block.source.abl", "comment"] }, // ' comment, tasty '
64
+ { "startIndex": 81, "endIndex": 83, "scopes": ["source.abl", "comment.block.source.abl", "comment", "comment.block.source.abl"] }, // '*/'
65
+ { "startIndex": 83, "endIndex": 85, "scopes": ["source.abl", "comment.block.source.abl", "comment"] }, // ' '
66
+ { "startIndex": 85, "endIndex": 87, "scopes": ["source.abl", "comment.block.source.abl"] }, // '*/'
67
+ { "startIndex": 87, "endIndex": 92, "scopes": ["source.abl"] }, // ' '
68
+ { "startIndex": 92, "endIndex": 93, "scopes": ["source.abl", "keyword.operator.source.abl"] }, // '='
69
+ { "startIndex": 93, "endIndex": 94, "scopes": ["source.abl"] }, // ' '
70
+ { "startIndex": 94, "endIndex": 113, "scopes": ["source.abl", "storage.data.table.abl"] } // 'ttOrganisme.codeOrg'
71
+ ];
72
+ shared.itShouldMatchExpectedScopes(statement, expectedTokens);
73
+ })