abl-tmlanguage 1.3.5 → 1.3.6
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.tmLanguage.json +101 -17
- package/index.js +39 -39
- package/package.json +1 -1
- package/spec/function-call/can-find.spec.js +240 -0
package/abl.tmLanguage.json
CHANGED
|
@@ -438,6 +438,9 @@
|
|
|
438
438
|
{
|
|
439
439
|
"include": "#record-buffer-functions"
|
|
440
440
|
},
|
|
441
|
+
{
|
|
442
|
+
"include": "#can-find"
|
|
443
|
+
},
|
|
441
444
|
{
|
|
442
445
|
"include": "#release"
|
|
443
446
|
},
|
|
@@ -1176,18 +1179,35 @@
|
|
|
1176
1179
|
}
|
|
1177
1180
|
},
|
|
1178
1181
|
"of-phrase": {
|
|
1179
|
-
"
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
"
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1182
|
+
"patterns": [
|
|
1183
|
+
{
|
|
1184
|
+
"comment": " This matches OF <table>",
|
|
1185
|
+
"match": "(?i)\\s*(of)\\s+([\\w\\-#$%]+(\\.[\\w\\-#$%]+)?)\\s*",
|
|
1186
|
+
"captures": {
|
|
1187
|
+
"1": {
|
|
1188
|
+
"name": "keyword.other.abl"
|
|
1189
|
+
},
|
|
1190
|
+
"2": {
|
|
1191
|
+
"name": "storage.data.table.abl"
|
|
1192
|
+
}
|
|
1193
|
+
}
|
|
1186
1194
|
},
|
|
1187
|
-
|
|
1188
|
-
"
|
|
1195
|
+
{
|
|
1196
|
+
"comment": " This matches <table> OF <table>",
|
|
1197
|
+
"match": "(?i)\\s*([\\w\\-#$%]+(\\.[\\w\\-#$%]+)?)\\s+(of)\\s+([\\w\\-#$%]+(\\.[\\w\\-#$%]+)?)\\s*",
|
|
1198
|
+
"captures": {
|
|
1199
|
+
"1": {
|
|
1200
|
+
"name": "storage.data.table.abl"
|
|
1201
|
+
},
|
|
1202
|
+
"3": {
|
|
1203
|
+
"name": "keyword.other.abl"
|
|
1204
|
+
},
|
|
1205
|
+
"4": {
|
|
1206
|
+
"name": "storage.data.table.abl"
|
|
1207
|
+
}
|
|
1208
|
+
}
|
|
1189
1209
|
}
|
|
1190
|
-
|
|
1210
|
+
]
|
|
1191
1211
|
},
|
|
1192
1212
|
"for-join": {
|
|
1193
1213
|
"comment": "Captures something like ', salesrep where' or 'salesrep where', when the latter is at the beginning of a line. 'OF' phrases handled by of-phrase",
|
|
@@ -1435,6 +1455,9 @@
|
|
|
1435
1455
|
{
|
|
1436
1456
|
"include": "#record-buffer-functions"
|
|
1437
1457
|
},
|
|
1458
|
+
{
|
|
1459
|
+
"include": "#can-find"
|
|
1460
|
+
},
|
|
1438
1461
|
{
|
|
1439
1462
|
"include": "#comment"
|
|
1440
1463
|
},
|
|
@@ -2332,6 +2355,64 @@
|
|
|
2332
2355
|
}
|
|
2333
2356
|
}
|
|
2334
2357
|
},
|
|
2358
|
+
"can-find": {
|
|
2359
|
+
"comment": "This captures CAN-FIND( until either the closing brace, or a keyword like WHERE or a lock status. Based on the doc at https://docs.progress.com/bundle/abl-reference/page/CAN-FIND-function.html",
|
|
2360
|
+
"begin": "(?i)\\s*(can-find)\\s*(\\()",
|
|
2361
|
+
"beginCaptures": {
|
|
2362
|
+
"1": {
|
|
2363
|
+
"name": "support.function.abl"
|
|
2364
|
+
},
|
|
2365
|
+
"2": {
|
|
2366
|
+
"name": "meta.brace.round.js"
|
|
2367
|
+
}
|
|
2368
|
+
},
|
|
2369
|
+
"end": "(?i)\\b(?=\\)|where|no-lock|share-lock|using|no-prefetch|no-wait)\\s*",
|
|
2370
|
+
"patterns": [
|
|
2371
|
+
{
|
|
2372
|
+
"include": "#parens"
|
|
2373
|
+
},
|
|
2374
|
+
{
|
|
2375
|
+
"include": "#comment"
|
|
2376
|
+
},
|
|
2377
|
+
{
|
|
2378
|
+
"include": "#string"
|
|
2379
|
+
},
|
|
2380
|
+
{
|
|
2381
|
+
"include": "#numeric"
|
|
2382
|
+
},
|
|
2383
|
+
{
|
|
2384
|
+
"match": "(?i)\\b(first|last)\\b",
|
|
2385
|
+
"captures": {
|
|
2386
|
+
"1": {
|
|
2387
|
+
"name": "keyword.other.abl"
|
|
2388
|
+
}
|
|
2389
|
+
}
|
|
2390
|
+
},
|
|
2391
|
+
{
|
|
2392
|
+
"include": "#use-index"
|
|
2393
|
+
},
|
|
2394
|
+
{
|
|
2395
|
+
"include": "#of-phrase"
|
|
2396
|
+
},
|
|
2397
|
+
{
|
|
2398
|
+
"include": "#db-dot-table"
|
|
2399
|
+
},
|
|
2400
|
+
{
|
|
2401
|
+
"include": "#db-dot-table-dot-field"
|
|
2402
|
+
}
|
|
2403
|
+
]
|
|
2404
|
+
},
|
|
2405
|
+
"use-index": {
|
|
2406
|
+
"match": "(?i)\\b(use-index)\\s+([a-z][a-z0-9\\-\\_\\$]*)\\b",
|
|
2407
|
+
"captures": {
|
|
2408
|
+
"1": {
|
|
2409
|
+
"name": "keyword.other.abl"
|
|
2410
|
+
},
|
|
2411
|
+
"2": {
|
|
2412
|
+
"name": "storage.data.table.abl"
|
|
2413
|
+
}
|
|
2414
|
+
}
|
|
2415
|
+
},
|
|
2335
2416
|
"access-modifier": {
|
|
2336
2417
|
"match": "(?i)\\s*(package-private|private|package-protected|protected|public|static|override|abstract|final)\\b",
|
|
2337
2418
|
"captures": {
|
|
@@ -2963,7 +3044,7 @@
|
|
|
2963
3044
|
"include": "#parens"
|
|
2964
3045
|
},
|
|
2965
3046
|
{
|
|
2966
|
-
"match": "(?i)\\s*(input-output|output|input|table-handle|dataset-handle|APPEND|BY-VALUE|BY-REFERENCE|BIND)\\s*",
|
|
3047
|
+
"match": "(?i)\\s*(input-output|input-outpu|input-outp|input-out|input-ou|input-o|output|input|table-handle|dataset-handle|APPEND|BY-VALUE|BY-REFERENCE|BIND)\\s*",
|
|
2967
3048
|
"captures": {
|
|
2968
3049
|
"1": {
|
|
2969
3050
|
"name": "keyword.other.abl"
|
|
@@ -3004,6 +3085,9 @@
|
|
|
3004
3085
|
{
|
|
3005
3086
|
"include": "#abl-system-handles"
|
|
3006
3087
|
},
|
|
3088
|
+
{
|
|
3089
|
+
"include": "#can-find"
|
|
3090
|
+
},
|
|
3007
3091
|
{
|
|
3008
3092
|
"include": "#abl-functions"
|
|
3009
3093
|
},
|
|
@@ -3581,7 +3665,7 @@
|
|
|
3581
3665
|
]
|
|
3582
3666
|
},
|
|
3583
3667
|
"keywords-A": {
|
|
3584
|
-
|
|
3668
|
+
"match": "(?i)\\b(avg|average|averag|avera|aver|ave|available|automatic|auto-endkey|authorization|audit-policy|audit-control|attribute-type|attachment|attach|at|assign|assembly|ask-overwrite|ascending|ascendin|ascendi|ascend|ascen|asce|asc|as-cursor|as|array-message|array-messag|array-messa|array-mess|array-mes|array-me|array-m|apply|application|append-line|append|anywhere|any-printable|any-key|any|ansi-only|and|ambiguous|alternate-key|alter|allow-replication|all|alert-box|aggregate|advise|add|active-window|active-form|across|accumulate|accumulat|accumula|accumul|accumu|accum|abstract|abort)\\b",
|
|
3585
3669
|
"captures": {
|
|
3586
3670
|
"1": {
|
|
3587
3671
|
"name": "keyword.other.abl"
|
|
@@ -3621,7 +3705,7 @@
|
|
|
3621
3705
|
}
|
|
3622
3706
|
},
|
|
3623
3707
|
"keywords-F": {
|
|
3624
|
-
|
|
3708
|
+
"match": "(?i)\\b(function-call-type|function|full-height|fromnoreorder|from-pixels|from-pixel|from-pixe|from-pix|from-pi|from-p|from-current|from-curren|from-curre|from-curr|from-cur|from-chars|from-char|from-cha|from-ch|from-c|from|frame-value|frame|forwards|forward|format|form|force-file|for|font-table|font|focus-in|focus|float|flags|fixed-only|fix-codepage|first|firehose-cursor|finder|find-wrap-around|find-select|find-previous|find-prev-occurrence|find-next-occurrence|find-next|find-global|find-case-sensitive|find|finally|final|filters|fill-in|filename|file-information|file-informatio|file-informati|file-informat|file-informa|file-inform|file-infor|file-info|file-access-time|file-access-tim|file-access-ti|file-access-t|file-access-date|file-access-dat|file-access-da|file-access-d|file|fields|field|fetch|false-leaks|false)\\b",
|
|
3625
3709
|
"captures": {
|
|
3626
3710
|
"1": {
|
|
3627
3711
|
"name": "keyword.other.abl"
|
|
@@ -3685,7 +3769,7 @@
|
|
|
3685
3769
|
}
|
|
3686
3770
|
},
|
|
3687
3771
|
"keywords-N": {
|
|
3688
|
-
|
|
3772
|
+
"match": "(?i)\\b(numeric|num-selected|num-copies|null|not-active|not|none|non-serializable|node-type|no-word-wrap|no-wait|no-undo|no-underline|no-underlin|no-underli|no-underl|no-under|no-unde|no-und|no-tab-stop|no-tab-sto|no-tab-st|no-tab-s|no-tab-|no-tab|no-separators|no-separate-connection|no-scrolling|no-scrollbar-vertical|no-scrollbar-vertica|no-scrollbar-vertic|no-scrollbar-verti|no-scrollbar-vert|no-scrollbar-ver|no-scrollbar-ve|no-scrollbar-v|no-schema-marshall|no-schema-marshal|no-row-markers|no-return-value|no-return-valu|no-return-val|no-query-unique-added|no-query-unique-adde|no-query-unique-add|no-query-unique-ad|no-query-unique-a|no-query-unique-|no-query-unique|no-query-uniqu|no-query-uniq|no-query-uni|no-query-un|no-query-u|no-query-order-added|no-query-order-adde|no-query-order-add|no-query-order-ad|no-query-order-a|no-query-order-|no-query-order|no-query-orde|no-query-ord|no-query-or|no-query-o|no-prefetch|no-prefetc|no-prefet|no-prefe|no-pause|no-message|no-messag|no-messa|no-mess|no-mes|no-map|no-lookahead|no-lock|no-lobs|no-labels|no-label|no-keycache-join|no-join-by-sqldb|no-inherit-fgcolor|no-inherit-fgcolo|no-inherit-fgcol|no-inherit-fgco|no-inherit-fgc|no-inherit-bgcolor|no-inherit-bgcolo|no-inherit-bgcol|no-inherit-bgco|no-inherit-bgc|no-index-hint|no-hide|no-help|no-firehose-cursor|no-fill|no-fil|no-fi|no-f|no-error|no-echo|no-drag|no-debug|no-convert-3d-colors|no-convert-3d-color|no-convert-3d-colo|no-convert-3d-col|no-convert-3d-co|no-convert-3d-c|no-convert-3d-|no-convert-3d|no-convert|no-console|no-column-scrolling|no-column-scrollin|no-column-scrolli|no-column-scroll|no-column-scrol|no-column-scro|no-column-scr|no-column-sc|no-box|no-bind-where|no-auto-validate|no-auto-trim|no-auto-tri|no-attr-space|no-attr-spac|no-attr-spa|no-attr-sp|no-attr-s|no-attr-list|no-attr-lis|no-attr-li|no-attr-l|no-attr|no-assign|no-array-message|no-array-messag|no-array-messa|no-array-mess|no-array-mes|no-array-me|no-array-m|no-apply|no|next-word|next-prompt|next-frame|next-error|next|new-line|new-instance|new|nested|ne|native|namespace-uri|namespace-prefix)\\b",
|
|
3689
3773
|
"captures": {
|
|
3690
3774
|
"1": {
|
|
3691
3775
|
"name": "keyword.other.abl"
|
|
@@ -3765,7 +3849,7 @@
|
|
|
3765
3849
|
}
|
|
3766
3850
|
},
|
|
3767
3851
|
"keywords-X": {
|
|
3768
|
-
|
|
3852
|
+
"match": "(?i)\\b(xref-xml|xref|xor|xml-node-name|xcode|x-of|x-noderef|x-document)\\b",
|
|
3769
3853
|
"captures": {
|
|
3770
3854
|
"1": {
|
|
3771
3855
|
"name": "keyword.other.abl"
|
|
@@ -4749,7 +4833,7 @@
|
|
|
4749
4833
|
},
|
|
4750
4834
|
"abl-functions-F": {
|
|
4751
4835
|
"name": "meta.function-call.abl",
|
|
4752
|
-
|
|
4836
|
+
"begin": "(?i)\\s*(frame-value|frame-valu|frame-val|frame-row|frame-name|frame-line|frame-index|frame-inde|frame-file|frame-field|frame-down|frame-db|frame-col|first-of|first|fill)\\s*(?=\\()",
|
|
4753
4837
|
"beginCaptures": {
|
|
4754
4838
|
"1": {
|
|
4755
4839
|
"name": "support.function.abl"
|
|
@@ -4889,7 +4973,7 @@
|
|
|
4889
4973
|
},
|
|
4890
4974
|
"abl-functions-N": {
|
|
4891
4975
|
"name": "meta.function-call.abl",
|
|
4892
|
-
|
|
4976
|
+
"begin": "(?i)\\s*(num-results|num-entries|num-dbs|num-aliases|num-aliase|num-alias|num-alia|num-ali|now|not entered|normalize|next-value|new)\\s*(?=\\()",
|
|
4893
4977
|
"beginCaptures": {
|
|
4894
4978
|
"1": {
|
|
4895
4979
|
"name": "support.function.abl"
|
package/index.js
CHANGED
|
@@ -57,7 +57,6 @@ alsoStatements.push('single-run');
|
|
|
57
57
|
alsoStatements.push('transaction');
|
|
58
58
|
alsoStatements.push('xml-node-name');
|
|
59
59
|
|
|
60
|
-
|
|
61
60
|
let functionsNotStatements = [];
|
|
62
61
|
functionsNotStatements.push('set-size');
|
|
63
62
|
|
|
@@ -73,30 +72,28 @@ lineReaderMethods.on('line', line => {
|
|
|
73
72
|
let results;
|
|
74
73
|
line = line.toLowerCase();
|
|
75
74
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
let keyWord = kw[0].split('(')[0];
|
|
75
|
+
let kw = line.split(' ');
|
|
76
|
+
let charIdx = kw[0].charCodeAt(0) - 97;
|
|
77
|
+
let keyWord = kw[0].split('(')[0];
|
|
80
78
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
}
|
|
85
|
-
} else if (kw.includes('method')) {
|
|
86
|
-
if (!methodBlocks[charIdx].includes(keyWord)) {
|
|
87
|
-
methodBlocks[charIdx].push(keyWord);
|
|
88
|
-
}
|
|
79
|
+
if (kw.includes('attribute')) {
|
|
80
|
+
if (!attributeBlocks[charIdx].includes(keyWord)) {
|
|
81
|
+
attributeBlocks[charIdx].push(keyWord);
|
|
89
82
|
}
|
|
83
|
+
} else if (kw.includes('method')) {
|
|
84
|
+
if (!methodBlocks[charIdx].includes(keyWord)) {
|
|
85
|
+
methodBlocks[charIdx].push(keyWord);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
90
88
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
}
|
|
89
|
+
if (alsoStatements.includes(keyWord)) {
|
|
90
|
+
if (!keywordBlocks[charIdx].includes(keyWord)) {
|
|
91
|
+
keywordBlocks[charIdx].push(keyWord);
|
|
95
92
|
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
93
|
+
}
|
|
94
|
+
if (alsoFunctions.includes(keyWord)) {
|
|
95
|
+
if (!functionBlocks[charIdx].includes(keyWord)) {
|
|
96
|
+
functionBlocks[charIdx].push(keyWord);
|
|
100
97
|
}
|
|
101
98
|
}
|
|
102
99
|
});
|
|
@@ -105,7 +102,7 @@ lineReaderFunctions.on('line', line => {
|
|
|
105
102
|
let results;
|
|
106
103
|
line = line.toLowerCase();
|
|
107
104
|
|
|
108
|
-
|
|
105
|
+
let kw = line.split(' ');
|
|
109
106
|
|
|
110
107
|
let kw = line.split(' ');
|
|
111
108
|
let kwName = '';
|
|
@@ -118,6 +115,10 @@ lineReaderFunctions.on('line', line => {
|
|
|
118
115
|
} else {
|
|
119
116
|
kwName = kw.slice(0, kw.indexOf('function')).join(' ');
|
|
120
117
|
}
|
|
118
|
+
}
|
|
119
|
+
} else if (kw.includes('statement')) {
|
|
120
|
+
for (const keyWord of kw) {
|
|
121
|
+
let charIdx = keyWord.charCodeAt(0) - 97;
|
|
121
122
|
|
|
122
123
|
// CAPS letter alphabet
|
|
123
124
|
let charIdx = kwName.charCodeAt(0) - 97;
|
|
@@ -156,28 +157,27 @@ lineReaderFunctions.on('line', line => {
|
|
|
156
157
|
lineReaderKeywords.on('line', line => {
|
|
157
158
|
let results;
|
|
158
159
|
line = line.toLowerCase();
|
|
159
|
-
if (!line.startsWith("#")) {
|
|
160
|
-
while ((results = re.exec(line)) !== null) {
|
|
161
|
-
let kw = results[0];
|
|
162
|
-
// CAPS letter alphabet
|
|
163
|
-
let charIdx = kw.charCodeAt(0) - 97;
|
|
164
160
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
161
|
+
while ((results = re.exec(line)) !== null) {
|
|
162
|
+
let kw = results[0];
|
|
163
|
+
// CAPS letter alphabet
|
|
164
|
+
let charIdx = kw.charCodeAt(0) - 97;
|
|
168
165
|
|
|
169
|
-
|
|
170
|
-
|
|
166
|
+
if (kw.indexOf('(') !== -1) {
|
|
167
|
+
let kwParts = kw.split('(');
|
|
168
|
+
let fullKw = kwParts[0] + kwParts[1];
|
|
171
169
|
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
kw += element;
|
|
170
|
+
kw = kwParts[0];
|
|
171
|
+
addToBlock(charIdx, fullKw, kw);
|
|
175
172
|
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
173
|
+
let kwComplete = kwParts[1];
|
|
174
|
+
for (const element of kwComplete) {
|
|
175
|
+
kw += element;
|
|
176
|
+
|
|
177
|
+
addToBlock(charIdx, fullKw, kw);
|
|
180
178
|
}
|
|
179
|
+
} else {
|
|
180
|
+
addToBlock(charIdx, kw, kw);
|
|
181
181
|
}
|
|
182
182
|
}
|
|
183
183
|
});
|
package/package.json
CHANGED
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
const { assert, expect } = require('chai');
|
|
2
|
+
const shared = require('../shared.js');
|
|
3
|
+
|
|
4
|
+
describe('', () => {
|
|
5
|
+
let statement = `IF NOT CAN-FIND(InstanceChildren WHERE InstanceChildren.contPath = pcPath AND
|
|
6
|
+
InstanceChildren.contName = pcFile AND
|
|
7
|
+
InstanceChildren.parentInstanceID = Instance.ID AND
|
|
8
|
+
InstanceChildren.ID = cField) THEN DO: end.`;
|
|
9
|
+
let expectedTokens = [
|
|
10
|
+
[
|
|
11
|
+
{ "startIndex": 0, "endIndex": 2, "scopes": ["source.abl", "keyword.other.abl"] }, // 'IF'
|
|
12
|
+
{ "startIndex": 2, "endIndex": 3, "scopes": ["source.abl"] }, // ' '
|
|
13
|
+
{ "startIndex": 3, "endIndex": 6, "scopes": ["source.abl", "keyword.operator.source.abl"] }, // 'NOT'
|
|
14
|
+
{ "startIndex": 6, "endIndex": 7, "scopes": ["source.abl"] }, // ' '
|
|
15
|
+
{ "startIndex": 7, "endIndex": 15, "scopes": ["source.abl", "support.function.abl"] }, // 'CAN-FIND'
|
|
16
|
+
{ "startIndex": 15, "endIndex": 16, "scopes": ["source.abl", "meta.brace.round.js"] }, // '('
|
|
17
|
+
{ "startIndex": 16, "endIndex": 32, "scopes": ["source.abl", "storage.data.table.abl"] }, // 'InstanceChildren'
|
|
18
|
+
{ "startIndex": 32, "endIndex": 33, "scopes": ["source.abl"] }, // ' '
|
|
19
|
+
{ "startIndex": 33, "endIndex": 38, "scopes": ["source.abl", "keyword.other.abl"] }, // 'WHERE'
|
|
20
|
+
{ "startIndex": 38, "endIndex": 39, "scopes": ["source.abl"] }, // ' '
|
|
21
|
+
{ "startIndex": 39, "endIndex": 64, "scopes": ["source.abl", "storage.data.table.abl"] }, // 'InstanceChildren.contPath'
|
|
22
|
+
{ "startIndex": 64, "endIndex": 73, "scopes": ["source.abl"] }, // ' '
|
|
23
|
+
{ "startIndex": 73, "endIndex": 74, "scopes": ["source.abl", "keyword.operator.source.abl"] }, // '='
|
|
24
|
+
{ "startIndex": 74, "endIndex": 75, "scopes": ["source.abl"] }, // ' '
|
|
25
|
+
{ "startIndex": 75, "endIndex": 81, "scopes": ["source.abl", "variable.other.abl"] }, // 'pcPath'
|
|
26
|
+
{ "startIndex": 81, "endIndex": 87, "scopes": ["source.abl"] }, // ' '
|
|
27
|
+
{ "startIndex": 87, "endIndex": 90, "scopes": ["source.abl", "keyword.other.abl"] } // 'AND'
|
|
28
|
+
],
|
|
29
|
+
[
|
|
30
|
+
{ "startIndex": 0, "endIndex": 4, "scopes": ["source.abl"] }, // ' '
|
|
31
|
+
{ "startIndex": 4, "endIndex": 29, "scopes": ["source.abl", "storage.data.table.abl"] }, // 'InstanceChildren.contName'
|
|
32
|
+
{ "startIndex": 29, "endIndex": 38, "scopes": ["source.abl"] }, // ' '
|
|
33
|
+
{ "startIndex": 38, "endIndex": 39, "scopes": ["source.abl", "keyword.operator.source.abl"] }, // '='
|
|
34
|
+
{ "startIndex": 39, "endIndex": 40, "scopes": ["source.abl"] }, // ' '
|
|
35
|
+
{ "startIndex": 40, "endIndex": 46, "scopes": ["source.abl", "variable.other.abl"] }, // 'pcFile'
|
|
36
|
+
{ "startIndex": 46, "endIndex": 52, "scopes": ["source.abl"] }, // ' '
|
|
37
|
+
{ "startIndex": 52, "endIndex": 55, "scopes": ["source.abl", "keyword.other.abl"] } // 'AND'
|
|
38
|
+
],
|
|
39
|
+
[
|
|
40
|
+
{ "startIndex": 0, "endIndex": 2, "scopes": ["source.abl"] }, // ' '
|
|
41
|
+
{ "startIndex": 2, "endIndex": 35, "scopes": ["source.abl", "storage.data.table.abl"] }, // 'InstanceChildren.parentInstanceID'
|
|
42
|
+
{ "startIndex": 35, "endIndex": 36, "scopes": ["source.abl"] }, // ' '
|
|
43
|
+
{ "startIndex": 36, "endIndex": 37, "scopes": ["source.abl", "keyword.operator.source.abl"] }, // '='
|
|
44
|
+
{ "startIndex": 37, "endIndex": 38, "scopes": ["source.abl"] }, // ' '
|
|
45
|
+
{ "startIndex": 38, "endIndex": 49, "scopes": ["source.abl", "storage.data.table.abl"] }, // 'Instance.ID'
|
|
46
|
+
{ "startIndex": 49, "endIndex": 50, "scopes": ["source.abl"] }, // ' '
|
|
47
|
+
{ "startIndex": 50, "endIndex": 53, "scopes": ["source.abl", "keyword.other.abl"] } // 'AND'
|
|
48
|
+
],
|
|
49
|
+
[
|
|
50
|
+
{ "startIndex": 0, "endIndex": 2, "scopes": ["source.abl"] }, // ' '
|
|
51
|
+
{ "startIndex": 2, "endIndex": 21, "scopes": ["source.abl", "storage.data.table.abl"] }, // 'InstanceChildren.ID'
|
|
52
|
+
{ "startIndex": 21, "endIndex": 36, "scopes": ["source.abl"] }, // ' '
|
|
53
|
+
{ "startIndex": 36, "endIndex": 37, "scopes": ["source.abl", "keyword.operator.source.abl"] }, // '='
|
|
54
|
+
{ "startIndex": 37, "endIndex": 38, "scopes": ["source.abl"] }, // ' '
|
|
55
|
+
{ "startIndex": 38, "endIndex": 44, "scopes": ["source.abl", "variable.other.abl"] }, // 'cField'
|
|
56
|
+
{ "startIndex": 44, "endIndex": 45, "scopes": ["source.abl", "meta.brace.round.js"] }, // ')'
|
|
57
|
+
{ "startIndex": 45, "endIndex": 46, "scopes": ["source.abl"] }, // ' '
|
|
58
|
+
{ "startIndex": 46, "endIndex": 50, "scopes": ["source.abl", "keyword.other.abl"] }, // 'THEN'
|
|
59
|
+
{ "startIndex": 50, "endIndex": 51, "scopes": ["source.abl", "meta.block.abl"] }, // ' '
|
|
60
|
+
{ "startIndex": 51, "endIndex": 53, "scopes": ["source.abl", "meta.block.abl", "keyword.other.abl"] }, // 'DO'
|
|
61
|
+
{ "startIndex": 53, "endIndex": 54, "scopes": ["source.abl", "punctuation.terminator.abl"] }, // ':'
|
|
62
|
+
{ "startIndex": 54, "endIndex": 55, "scopes": ["source.abl"] }, // ' '
|
|
63
|
+
{ "startIndex": 55, "endIndex": 58, "scopes": ["source.abl", "keyword.other.abl"] }, // 'end'
|
|
64
|
+
{ "startIndex": 58, "endIndex": 59, "scopes": ["source.abl", "punctuation.terminator.abl"] } // '.'
|
|
65
|
+
]
|
|
66
|
+
];
|
|
67
|
+
shared.itShouldMatchExpectedScopes(statement, expectedTokens);
|
|
68
|
+
})
|
|
69
|
+
|
|
70
|
+
describe('', () => {
|
|
71
|
+
let statement = `any_trig = (IF CAN-FIND(FIRST dictdb._Field-trig OF bField) THEN yes else no).`;
|
|
72
|
+
let expectedTokens = [
|
|
73
|
+
{ "startIndex": 0, "endIndex": 8, "scopes": ["source.abl", "variable.other.abl"] }, // 'any_trig'
|
|
74
|
+
{ "startIndex": 8, "endIndex": 9, "scopes": ["source.abl"] }, // ' '
|
|
75
|
+
{ "startIndex": 9, "endIndex": 10, "scopes": ["source.abl", "keyword.operator.source.abl"] }, // '='
|
|
76
|
+
{ "startIndex": 10, "endIndex": 11, "scopes": ["source.abl"] }, // ' '
|
|
77
|
+
{ "startIndex": 11, "endIndex": 12, "scopes": ["source.abl", "meta.function.arguments.abl", "meta.brace.round.js"] }, // '('
|
|
78
|
+
{ "startIndex": 12, "endIndex": 14, "scopes": ["source.abl", "meta.function.arguments.abl", "variable.other.abl"] }, // 'IF'
|
|
79
|
+
{ "startIndex": 14, "endIndex": 15, "scopes": ["source.abl", "meta.function.arguments.abl"] }, // ' '
|
|
80
|
+
{ "startIndex": 15, "endIndex": 23, "scopes": ["source.abl", "meta.function.arguments.abl", "support.function.abl"] }, // 'CAN-FIND'
|
|
81
|
+
{ "startIndex": 23, "endIndex": 24, "scopes": ["source.abl", "meta.function.arguments.abl", "meta.brace.round.js"] }, // '('
|
|
82
|
+
{ "startIndex": 24, "endIndex": 29, "scopes": ["source.abl", "meta.function.arguments.abl", "keyword.other.abl"] }, // 'FIRST'
|
|
83
|
+
{ "startIndex": 29, "endIndex": 30, "scopes": ["source.abl", "meta.function.arguments.abl"] }, // ' '
|
|
84
|
+
{ "startIndex": 30, "endIndex": 48, "scopes": ["source.abl", "meta.function.arguments.abl", "storage.data.table.abl"] }, // 'dictdb._Field-trig'
|
|
85
|
+
{ "startIndex": 48, "endIndex": 49, "scopes": ["source.abl", "meta.function.arguments.abl"] }, // ' '
|
|
86
|
+
{ "startIndex": 49, "endIndex": 51, "scopes": ["source.abl", "meta.function.arguments.abl", "keyword.other.abl"] }, // 'OF'
|
|
87
|
+
{ "startIndex": 51, "endIndex": 52, "scopes": ["source.abl", "meta.function.arguments.abl"] }, // ' '
|
|
88
|
+
{ "startIndex": 52, "endIndex": 58, "scopes": ["source.abl", "meta.function.arguments.abl", "storage.data.table.abl"] }, // 'bField'
|
|
89
|
+
{ "startIndex": 58, "endIndex": 59, "scopes": ["source.abl", "meta.brace.round.js"] }, // ')'
|
|
90
|
+
{ "startIndex": 59, "endIndex": 60, "scopes": ["source.abl"] }, // ' '
|
|
91
|
+
{ "startIndex": 60, "endIndex": 64, "scopes": ["source.abl", "keyword.other.abl"] }, // 'THEN'
|
|
92
|
+
{ "startIndex": 64, "endIndex": 65, "scopes": ["source.abl"] }, // ' '
|
|
93
|
+
{ "startIndex": 65, "endIndex": 68, "scopes": ["source.abl", "constant.language.abl"] }, // 'yes'
|
|
94
|
+
{ "startIndex": 68, "endIndex": 69, "scopes": ["source.abl"] }, // ' '
|
|
95
|
+
{ "startIndex": 69, "endIndex": 73, "scopes": ["source.abl", "keyword.other.abl"] }, // 'else'
|
|
96
|
+
{ "startIndex": 73, "endIndex": 74, "scopes": ["source.abl"] }, // ' '
|
|
97
|
+
{ "startIndex": 74, "endIndex": 76, "scopes": ["source.abl", "constant.language.abl"] }, // 'no'
|
|
98
|
+
{ "startIndex": 76, "endIndex": 77, "scopes": ["source.abl", "meta.brace.round.js"] }, // ')'
|
|
99
|
+
{ "startIndex": 77, "endIndex": 78, "scopes": ["source.abl", "punctuation.terminator.abl"] } // '.'
|
|
100
|
+
];
|
|
101
|
+
shared.itShouldMatchExpectedScopes(statement, expectedTokens);
|
|
102
|
+
})
|
|
103
|
+
|
|
104
|
+
describe('', () => {
|
|
105
|
+
let statement = `STRING(CAN-FIND(FIRST DICTDB._Index-field OF DICTDB._Field),"y/n":u)`;
|
|
106
|
+
let expectedTokens = [
|
|
107
|
+
{ "startIndex": 0, "endIndex": 6, "scopes": ["source.abl", "meta.function-call.abl", "support.function.abl"] }, // 'STRING'
|
|
108
|
+
{ "startIndex": 6, "endIndex": 7, "scopes": ["source.abl", "meta.function-call.abl", "meta.function.arguments.abl", "meta.brace.round.js"] }, // '('
|
|
109
|
+
{ "startIndex": 7, "endIndex": 15, "scopes": ["source.abl", "meta.function-call.abl", "meta.function.arguments.abl", "support.function.abl"] }, // 'CAN-FIND'
|
|
110
|
+
{ "startIndex": 15, "endIndex": 16, "scopes": ["source.abl", "meta.function-call.abl", "meta.function.arguments.abl", "meta.brace.round.js"] }, // '('
|
|
111
|
+
{ "startIndex": 16, "endIndex": 21, "scopes": ["source.abl", "meta.function-call.abl", "meta.function.arguments.abl", "keyword.other.abl"] }, // 'FIRST'
|
|
112
|
+
{ "startIndex": 21, "endIndex": 22, "scopes": ["source.abl", "meta.function-call.abl", "meta.function.arguments.abl"] }, // ' '
|
|
113
|
+
{ "startIndex": 22, "endIndex": 41, "scopes": ["source.abl", "meta.function-call.abl", "meta.function.arguments.abl", "storage.data.table.abl"] }, // 'DICTDB._Index-field'
|
|
114
|
+
{ "startIndex": 41, "endIndex": 42, "scopes": ["source.abl", "meta.function-call.abl", "meta.function.arguments.abl"] }, // ' '
|
|
115
|
+
{ "startIndex": 42, "endIndex": 44, "scopes": ["source.abl", "meta.function-call.abl", "meta.function.arguments.abl", "keyword.other.abl"] }, // 'OF'
|
|
116
|
+
{ "startIndex": 44, "endIndex": 45, "scopes": ["source.abl", "meta.function-call.abl", "meta.function.arguments.abl"] }, // ' '
|
|
117
|
+
{ "startIndex": 45, "endIndex": 58, "scopes": ["source.abl", "meta.function-call.abl", "meta.function.arguments.abl", "storage.data.table.abl"] }, // 'DICTDB._Field'
|
|
118
|
+
{ "startIndex": 58, "endIndex": 59, "scopes": ["source.abl", "meta.function-call.abl", "meta.brace.round.js"] }, // ')'
|
|
119
|
+
{ "startIndex": 59, "endIndex": 60, "scopes": ["source.abl", "punctuation.separator.comma.abl"] }, // ','
|
|
120
|
+
{ "startIndex": 60, "endIndex": 61, "scopes": ["source.abl", "string.double.complex.abl", "punctuation.definition.string.begin.abl"] }, // '"'
|
|
121
|
+
{ "startIndex": 61, "endIndex": 64, "scopes": ["source.abl", "string.double.complex.abl"] }, // 'y/n'
|
|
122
|
+
{ "startIndex": 64, "endIndex": 65, "scopes": ["source.abl", "string.double.complex.abl", "punctuation.definition.string.end.abl"] }, // '"'
|
|
123
|
+
{ "startIndex": 65, "endIndex": 67, "scopes": ["source.abl", "string.double.complex.abl", "support.other.abl"] }, // ':u'
|
|
124
|
+
{ "startIndex": 67, "endIndex": 68, "scopes": ["source.abl", "meta.brace.round.js"] } // ')'
|
|
125
|
+
];
|
|
126
|
+
shared.itShouldMatchExpectedScopes(statement, expectedTokens);
|
|
127
|
+
})
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
describe('', () => {
|
|
131
|
+
let statement = `if can-find(customer 2) then. `;
|
|
132
|
+
let expectedTokens = [
|
|
133
|
+
{ "startIndex": 0, "endIndex": 2, "scopes": ["source.abl", "keyword.other.abl"] }, // 'if'
|
|
134
|
+
{ "startIndex": 2, "endIndex": 3, "scopes": ["source.abl"] }, // ' '
|
|
135
|
+
{ "startIndex": 3, "endIndex": 11, "scopes": ["source.abl", "support.function.abl"] }, // 'can-find'
|
|
136
|
+
{ "startIndex": 11, "endIndex": 12, "scopes": ["source.abl", "meta.brace.round.js"] }, // '('
|
|
137
|
+
{ "startIndex": 12, "endIndex": 20, "scopes": ["source.abl", "storage.data.table.abl"] }, // 'customer'
|
|
138
|
+
{ "startIndex": 20, "endIndex": 21, "scopes": ["source.abl"] }, // ' '
|
|
139
|
+
{ "startIndex": 21, "endIndex": 22, "scopes": ["source.abl", "constant.numeric.source.abl"] }, // '2'
|
|
140
|
+
{ "startIndex": 22, "endIndex": 23, "scopes": ["source.abl", "meta.brace.round.js"] }, // ')'
|
|
141
|
+
{ "startIndex": 23, "endIndex": 24, "scopes": ["source.abl"] }, // ' '
|
|
142
|
+
{ "startIndex": 24, "endIndex": 28, "scopes": ["source.abl", "keyword.other.abl"] }, // 'then'
|
|
143
|
+
{ "startIndex": 28, "endIndex": 29, "scopes": ["source.abl", "punctuation.terminator.abl"] }, // '.'
|
|
144
|
+
{ "startIndex": 29, "endIndex": 31, "scopes": ["source.abl"] } // ' '
|
|
145
|
+
];
|
|
146
|
+
shared.itShouldMatchExpectedScopes(statement, expectedTokens);
|
|
147
|
+
})
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
describe('', () => {
|
|
151
|
+
let statement = `if can-find(department "100") then. `;
|
|
152
|
+
let expectedTokens = [
|
|
153
|
+
{ "startIndex": 0, "endIndex": 2, "scopes": ["source.abl", "keyword.other.abl"] }, // 'if'
|
|
154
|
+
{ "startIndex": 2, "endIndex": 3, "scopes": ["source.abl"] }, // ' '
|
|
155
|
+
{ "startIndex": 3, "endIndex": 11, "scopes": ["source.abl", "support.function.abl"] }, // 'can-find'
|
|
156
|
+
{ "startIndex": 11, "endIndex": 12, "scopes": ["source.abl", "meta.brace.round.js"] }, // '('
|
|
157
|
+
{ "startIndex": 12, "endIndex": 22, "scopes": ["source.abl", "storage.data.table.abl"] }, // 'department'
|
|
158
|
+
{ "startIndex": 22, "endIndex": 23, "scopes": ["source.abl"] }, // ' '
|
|
159
|
+
{ "startIndex": 23, "endIndex": 24, "scopes": ["source.abl", "string.double.complex.abl", "punctuation.definition.string.begin.abl"] }, // '"'
|
|
160
|
+
{ "startIndex": 24, "endIndex": 27, "scopes": ["source.abl", "string.double.complex.abl"] }, // '100'
|
|
161
|
+
{ "startIndex": 27, "endIndex": 28, "scopes": ["source.abl", "string.double.complex.abl", "punctuation.definition.string.end.abl"] }, // '"'
|
|
162
|
+
{ "startIndex": 28, "endIndex": 29, "scopes": ["source.abl", "meta.brace.round.js"] }, // ')'
|
|
163
|
+
{ "startIndex": 29, "endIndex": 30, "scopes": ["source.abl"] }, // ' '
|
|
164
|
+
{ "startIndex": 30, "endIndex": 34, "scopes": ["source.abl", "storage.data.table.abl"] }, // 'then'
|
|
165
|
+
{ "startIndex": 34, "endIndex": 37, "scopes": ["source.abl"] } // '. '
|
|
166
|
+
];
|
|
167
|
+
shared.itShouldMatchExpectedScopes(statement, expectedTokens);
|
|
168
|
+
})
|
|
169
|
+
|
|
170
|
+
describe('', () => {
|
|
171
|
+
let statement = `if can-find(department where department.dept-code eq "100" use-index codeIndex) then. `;
|
|
172
|
+
let expectedTokens = [
|
|
173
|
+
{ "startIndex": 0, "endIndex": 2, "scopes": ["source.abl", "keyword.other.abl"] }, // 'if'
|
|
174
|
+
{ "startIndex": 2, "endIndex": 3, "scopes": ["source.abl"] }, // ' '
|
|
175
|
+
{ "startIndex": 3, "endIndex": 11, "scopes": ["source.abl", "support.function.abl"] }, // 'can-find'
|
|
176
|
+
{ "startIndex": 11, "endIndex": 12, "scopes": ["source.abl", "meta.brace.round.js"] }, // '('
|
|
177
|
+
{ "startIndex": 12, "endIndex": 22, "scopes": ["source.abl", "storage.data.table.abl"] }, // 'department'
|
|
178
|
+
{ "startIndex": 22, "endIndex": 23, "scopes": ["source.abl"] }, // ' '
|
|
179
|
+
{ "startIndex": 23, "endIndex": 28, "scopes": ["source.abl", "keyword.other.abl"] }, // 'where'
|
|
180
|
+
{ "startIndex": 28, "endIndex": 29, "scopes": ["source.abl"] }, // ' '
|
|
181
|
+
{ "startIndex": 29, "endIndex": 49, "scopes": ["source.abl", "storage.data.table.abl"] }, // 'department.dept-code'
|
|
182
|
+
{ "startIndex": 49, "endIndex": 50, "scopes": ["source.abl"] }, // ' '
|
|
183
|
+
{ "startIndex": 50, "endIndex": 52, "scopes": ["source.abl", "keyword.operator.source.abl"] }, // 'eq'
|
|
184
|
+
{ "startIndex": 52, "endIndex": 53, "scopes": ["source.abl"] }, // ' '
|
|
185
|
+
{ "startIndex": 53, "endIndex": 54, "scopes": ["source.abl", "string.double.complex.abl", "punctuation.definition.string.begin.abl"] }, // '"'
|
|
186
|
+
{ "startIndex": 54, "endIndex": 57, "scopes": ["source.abl", "string.double.complex.abl"] }, // '100'
|
|
187
|
+
{ "startIndex": 57, "endIndex": 58, "scopes": ["source.abl", "string.double.complex.abl", "punctuation.definition.string.end.abl"] }, // '"'
|
|
188
|
+
{ "startIndex": 58, "endIndex": 59, "scopes": ["source.abl"] }, // ' '
|
|
189
|
+
{ "startIndex": 59, "endIndex": 68, "scopes": ["source.abl", "keyword.other.abl"] }, // 'use-index'
|
|
190
|
+
{ "startIndex": 68, "endIndex": 69, "scopes": ["source.abl"] }, // ' '
|
|
191
|
+
{ "startIndex": 69, "endIndex": 78, "scopes": ["source.abl", "variable.other.abl"] }, // 'codeIndex'
|
|
192
|
+
{ "startIndex": 78, "endIndex": 79, "scopes": ["source.abl", "meta.brace.round.js"] }, // ')'
|
|
193
|
+
{ "startIndex": 79, "endIndex": 80, "scopes": ["source.abl"] }, // ' '
|
|
194
|
+
{ "startIndex": 80, "endIndex": 84, "scopes": ["source.abl", "keyword.other.abl"] }, // 'then'
|
|
195
|
+
{ "startIndex": 84, "endIndex": 85, "scopes": ["source.abl", "punctuation.terminator.abl"] }, // '.'
|
|
196
|
+
{ "startIndex": 85, "endIndex": 87, "scopes": ["source.abl"] } // ' '
|
|
197
|
+
];
|
|
198
|
+
shared.itShouldMatchExpectedScopes(statement, expectedTokens);
|
|
199
|
+
})
|
|
200
|
+
|
|
201
|
+
describe('', () => {
|
|
202
|
+
let statement = `if
|
|
203
|
+
can-find(
|
|
204
|
+
first department
|
|
205
|
+
where department.dept-code eq ttFoo.Code)
|
|
206
|
+
then.`;
|
|
207
|
+
let expectedTokens = [
|
|
208
|
+
[
|
|
209
|
+
{ "startIndex": 0, "endIndex": 2, "scopes": ["source.abl", "keyword.other.abl"] } // 'if'
|
|
210
|
+
],
|
|
211
|
+
[
|
|
212
|
+
{ "startIndex": 0, "endIndex": 4, "scopes": ["source.abl"] }, // ' '
|
|
213
|
+
{ "startIndex": 4, "endIndex": 12, "scopes": ["source.abl", "support.function.abl"] }, // 'can-find'
|
|
214
|
+
{ "startIndex": 12, "endIndex": 13, "scopes": ["source.abl", "meta.brace.round.js"] } // '('
|
|
215
|
+
],
|
|
216
|
+
[
|
|
217
|
+
{ "startIndex": 0, "endIndex": 8, "scopes": ["source.abl"] }, // ' '
|
|
218
|
+
{ "startIndex": 8, "endIndex": 13, "scopes": ["source.abl", "keyword.other.abl"] }, // 'first'
|
|
219
|
+
{ "startIndex": 13, "endIndex": 14, "scopes": ["source.abl"] }, // ' '
|
|
220
|
+
{ "startIndex": 14, "endIndex": 24, "scopes": ["source.abl", "storage.data.table.abl"] } // 'department'
|
|
221
|
+
],
|
|
222
|
+
[
|
|
223
|
+
{ "startIndex": 0, "endIndex": 11, "scopes": ["source.abl"] }, // ' '
|
|
224
|
+
{ "startIndex": 11, "endIndex": 16, "scopes": ["source.abl", "keyword.other.abl"] }, // 'where'
|
|
225
|
+
{ "startIndex": 16, "endIndex": 17, "scopes": ["source.abl"] }, // ' '
|
|
226
|
+
{ "startIndex": 17, "endIndex": 37, "scopes": ["source.abl", "storage.data.table.abl"] }, // 'department.dept-code'
|
|
227
|
+
{ "startIndex": 37, "endIndex": 38, "scopes": ["source.abl"] }, // ' '
|
|
228
|
+
{ "startIndex": 38, "endIndex": 40, "scopes": ["source.abl", "keyword.operator.source.abl"] }, // 'eq'
|
|
229
|
+
{ "startIndex": 40, "endIndex": 41, "scopes": ["source.abl"] }, // ' '
|
|
230
|
+
{ "startIndex": 41, "endIndex": 51, "scopes": ["source.abl", "storage.data.table.abl"] }, // 'ttFoo.Code'
|
|
231
|
+
{ "startIndex": 51, "endIndex": 52, "scopes": ["source.abl", "meta.brace.round.js"] } // ')'
|
|
232
|
+
],
|
|
233
|
+
[
|
|
234
|
+
{ "startIndex": 0, "endIndex": 4, "scopes": ["source.abl", "keyword.other.abl"] }, // 'then'
|
|
235
|
+
{ "startIndex": 4, "endIndex": 5, "scopes": ["source.abl", "punctuation.terminator.abl"] } // '.'
|
|
236
|
+
]
|
|
237
|
+
];
|
|
238
|
+
shared.itShouldMatchExpectedScopes(statement, expectedTokens);
|
|
239
|
+
})
|
|
240
|
+
|