abl-tmlanguage 1.1.2 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/README.md +12 -0
- package/abl.tmLanguage.json +2734 -229
- package/azure-pipelines.yml +3 -2
- package/package.json +9 -9
- package/spec/analyze-suspend-resume/analyze-suspend-resume.spec.js +10 -10
- package/spec/array-extent/issue#5.spec.js +18 -18
- package/spec/define-buffer/simple-single-line.spec.js +138 -0
- package/spec/define-parameter/simple-single-line.spec.js +103 -75
- package/spec/define-stream/simple-single-line.spec.js +32 -31
- package/spec/define-variable/extent.spec.js +228 -0
- package/spec/define-variable/issue#6.spec.js +256 -198
- package/spec/define-variable/issue#9.spec.js +38 -32
- package/spec/define-variable/simple-single-line.spec.js +87 -87
- package/spec/define-variable/single-line-with-a-comment-at-the-end.spec.js +62 -62
- package/spec/define-variable/single-line-with-a-space-and-a-comment-at-the-end.spec.js +56 -56
- package/spec/define-variable/tm-issue#2.spec.js +20 -20
- package/spec/do/do-blocks.spec.js +89 -0
- package/spec/do/issue#3.spec.js +67 -60
- package/spec/function-call/vscode-abl-issue#19.spec.js +110 -107
- package/spec/global-scoped-define/global-define.spec.js +11 -11
- package/spec/global-scoped-define/scoped-define-with-procedure-keyword.spec.js +26 -26
- package/spec/include/abl-tmlanguage-issues#5.spec.js +44 -44
- package/spec/include/vscode-abl-issue#45.spec.js +14 -14
- package/spec/include/vscode-abl-issue#80.spec.js +26 -26
- package/spec/method-definition/constructor.spec.js +174 -0
- package/spec/method-definition/method.spec.js +185 -0
- package/spec/procedure-definition/empty-proc.spec.js +20 -18
- package/spec/procedure-definition/vscode-abl-issue#22.spec.js +46 -42
- package/spec/procedure-definition/vscode-abl-issue#26.spec.js +23 -16
- package/spec/procedure-definition/vscode-abl-issue#62.spec.js +36 -0
- package/spec/shared.js +84 -42
- package/spec/strings/vscode-abl-issue#11.spec.js +110 -114
- package/spec/strings/vscode-abl-issue#28.spec.js +27 -27
- package/spec/type-name/argument.spec.js +209 -0
- package/spec/type-name/cast.spec.js +165 -0
- package/spec/type-name/define-class.spec.js +471 -0
- package/spec/type-name/define-enum.spec.js +44 -0
- package/spec/type-name/define-interface.spec.js +159 -0
- package/spec/type-name/define-property.spec.js +301 -0
- package/spec/type-name/define-temp-table.spec.js +434 -0
- package/spec/type-name/define-type-spec.js +435 -0
- package/spec/type-name/define-variable-property.spec.js +264 -0
- package/spec/type-name/define-variable.spec.js +504 -0
- package/spec/type-name/get-class.spec.js +91 -0
- package/spec/type-name/new.spec.js +126 -0
- package/spec/type-name/parameter-as.spec.js +838 -0
- package/spec/type-name/type-name-spec.js +587 -0
- package/spec/type-name/using.spec.js +115 -0
|
@@ -2,24 +2,24 @@ const { assert, expect } = require('chai');
|
|
|
2
2
|
const shared = require('../shared.js');
|
|
3
3
|
|
|
4
4
|
describe('', () => {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
5
|
+
//label-with-a-dot-inside.spec
|
|
6
|
+
let statement = `def var foo as char no-undo. /* bar.baz */`;
|
|
7
|
+
let expectedTokens = [
|
|
8
|
+
{ "startIndex": 0, "endIndex": 3, "scopes": ["source.abl", "meta.define.abl", "keyword.other.abl"] },
|
|
9
|
+
{ "startIndex": 3, "endIndex": 4, "scopes": ["source.abl", "meta.define.abl"] },
|
|
10
|
+
{ "startIndex": 4, "endIndex": 7, "scopes": ["source.abl", "meta.define.abl", "keyword.other.abl"] },
|
|
11
|
+
{ "startIndex": 7, "endIndex": 8, "scopes": ["source.abl", "meta.define.abl"] },
|
|
12
|
+
{ "startIndex": 8, "endIndex": 11, "scopes": ["source.abl", "meta.define.abl", "variable.other.abl"] },
|
|
13
|
+
{ "startIndex": 11, "endIndex": 12, "scopes": ["source.abl", "meta.define.abl"] },
|
|
14
|
+
{ "startIndex": 12, "endIndex": 14, "scopes": ["source.abl", "meta.define.abl", "keyword.other.abl"] },
|
|
15
|
+
{ "startIndex": 14, "endIndex": 15, "scopes": ["source.abl", "meta.define.abl"] },
|
|
16
|
+
{ "startIndex": 15, "endIndex": 19, "scopes": ["source.abl", "meta.define.abl", "storage.type.abl"] },
|
|
17
|
+
{ "startIndex": 19, "endIndex": 20, "scopes": ["source.abl", "meta.define.abl"] },
|
|
18
|
+
{ "startIndex": 20, "endIndex": 27, "scopes": ["source.abl", "meta.define.abl", "keyword.other.abl"] },
|
|
19
|
+
{ "startIndex": 27, "endIndex": 28, "scopes": ["source.abl", "meta.define.abl", "punctuation.terminator.abl"] },
|
|
20
|
+
{ "startIndex": 28, "endIndex": 29, "scopes": ["source.abl"] },
|
|
21
|
+
{ "startIndex": 29, "endIndex": 31, "scopes": ["source.abl", "comment.block.source.abl"] },
|
|
22
|
+
{ "startIndex": 31, "endIndex": 40, "scopes": ["source.abl", "comment.block.source.abl", "comment"] },
|
|
23
|
+
{ "startIndex": 40, "endIndex": 42, "scopes": ["source.abl", "comment.block.source.abl"] }];
|
|
24
|
+
shared.itShouldMatchExpectedScopes(statement, expectedTokens);
|
|
25
25
|
})
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
const { assert, expect } = require('chai');
|
|
2
|
+
const shared = require('../shared.js');
|
|
3
|
+
|
|
4
|
+
describe('', () => {
|
|
5
|
+
//label-with-a-dot-inside.spec
|
|
6
|
+
let statement = `
|
|
7
|
+
DO mI = 1 TO 3 on error undo, throw:
|
|
8
|
+
/* comment */
|
|
9
|
+
END.`;
|
|
10
|
+
let expectedTokens = [
|
|
11
|
+
[
|
|
12
|
+
{ "startIndex": 0, "endIndex": 1, "scopes": ["source.abl"] } // ''
|
|
13
|
+
],
|
|
14
|
+
[
|
|
15
|
+
{ "startIndex": 0, "endIndex": 2, "scopes": ["source.abl", "meta.block.abl", "keyword.other.abl"] }, // 'DO'
|
|
16
|
+
{ "startIndex": 2, "endIndex": 3, "scopes": ["source.abl", "meta.block.abl"] }, // ' '
|
|
17
|
+
{ "startIndex": 3, "endIndex": 5, "scopes": ["source.abl", "meta.block.abl", "variable.other.abl"] }, // 'mI'
|
|
18
|
+
{ "startIndex": 5, "endIndex": 6, "scopes": ["source.abl", "meta.block.abl"] }, // ' '
|
|
19
|
+
{ "startIndex": 6, "endIndex": 7, "scopes": ["source.abl", "meta.block.abl", "keyword.operator.source.abl"] }, // '='
|
|
20
|
+
{ "startIndex": 7, "endIndex": 8, "scopes": ["source.abl", "meta.block.abl"] }, // ' '
|
|
21
|
+
{ "startIndex": 8, "endIndex": 9, "scopes": ["source.abl", "meta.block.abl", "constant.numeric.source.abl"] }, // '1'
|
|
22
|
+
{ "startIndex": 9, "endIndex": 13, "scopes": ["source.abl", "meta.block.abl", "keyword.other"] }, // ' TO '
|
|
23
|
+
{ "startIndex": 13, "endIndex": 14, "scopes": ["source.abl", "meta.block.abl", "constant.numeric.source.abl"] }, // '3'
|
|
24
|
+
{ "startIndex": 14, "endIndex": 15, "scopes": ["source.abl", "meta.block.abl", "meta.block.branch.abl"] }, // ' '
|
|
25
|
+
{ "startIndex": 15, "endIndex": 17, "scopes": ["source.abl", "meta.block.abl", "meta.block.branch.abl", "keyword.other.abl"] }, // 'on'
|
|
26
|
+
{ "startIndex": 17, "endIndex": 18, "scopes": ["source.abl", "meta.block.abl", "meta.block.branch.abl"] }, // ' '
|
|
27
|
+
{ "startIndex": 18, "endIndex": 23, "scopes": ["source.abl", "meta.block.abl", "meta.block.branch.abl", "keyword.other.abl"] }, // 'error'
|
|
28
|
+
{ "startIndex": 23, "endIndex": 24, "scopes": ["source.abl", "meta.block.abl", "meta.block.branch.abl"] }, // ' '
|
|
29
|
+
{ "startIndex": 24, "endIndex": 28, "scopes": ["source.abl", "meta.block.abl", "meta.block.branch.abl", "keyword.other.abl"] }, // 'undo'
|
|
30
|
+
{ "startIndex": 28, "endIndex": 29, "scopes": ["source.abl", "meta.block.abl", "meta.block.branch.abl", "separator.comma.abl"] }, // ','
|
|
31
|
+
{ "startIndex": 29, "endIndex": 30, "scopes": ["source.abl", "meta.block.abl", "meta.block.branch.abl"] }, // ' '
|
|
32
|
+
{ "startIndex": 30, "endIndex": 35, "scopes": ["source.abl", "meta.block.abl", "meta.block.branch.abl", "keyword.other.abl"] }, // 'throw'
|
|
33
|
+
{ "startIndex": 35, "endIndex": 36, "scopes": ["source.abl", "meta.block.abl"] } // ':'
|
|
34
|
+
],
|
|
35
|
+
[
|
|
36
|
+
{ "startIndex": 0, "endIndex": 4, "scopes": ["source.abl"] }, // ' '
|
|
37
|
+
{ "startIndex": 4, "endIndex": 6, "scopes": ["source.abl", "comment.block.source.abl"] }, // '/*'
|
|
38
|
+
{ "startIndex": 6, "endIndex": 15, "scopes": ["source.abl", "comment.block.source.abl", "comment"] }, // ' comment '
|
|
39
|
+
{ "startIndex": 15, "endIndex": 17, "scopes": ["source.abl", "comment.block.source.abl"] } // '*/'
|
|
40
|
+
],
|
|
41
|
+
[
|
|
42
|
+
{ "startIndex": 0, "endIndex": 3, "scopes": ["source.abl", "keyword.other.abl"] }, // 'END'
|
|
43
|
+
{ "startIndex": 3, "endIndex": 4, "scopes": ["source.abl", "punctuation.terminator.abl"] } // '.'
|
|
44
|
+
]];
|
|
45
|
+
shared.itShouldMatchExpectedScopes(statement, expectedTokens);
|
|
46
|
+
})
|
|
47
|
+
|
|
48
|
+
describe('', () => {
|
|
49
|
+
//label-with-a-dot-inside.spec
|
|
50
|
+
let statement = `
|
|
51
|
+
DO WHILE mI <= 10:
|
|
52
|
+
mI = mI + 1.
|
|
53
|
+
END.`;
|
|
54
|
+
let expectedTokens = [
|
|
55
|
+
[
|
|
56
|
+
{ "startIndex": 0, "endIndex": 1, "scopes": ["source.abl"] } // ''
|
|
57
|
+
],
|
|
58
|
+
[
|
|
59
|
+
{ "startIndex": 0, "endIndex": 2, "scopes": ["source.abl", "meta.block.abl", "keyword.other.abl"] }, // 'DO'
|
|
60
|
+
{ "startIndex": 2, "endIndex": 3, "scopes": ["source.abl", "meta.block.abl"] }, // ' '
|
|
61
|
+
{ "startIndex": 3, "endIndex": 8, "scopes": ["source.abl", "meta.block.abl", "keyword.other.abl"] }, // 'WHILE'
|
|
62
|
+
{ "startIndex": 8, "endIndex": 9, "scopes": ["source.abl", "meta.block.abl"] }, // ' '
|
|
63
|
+
{ "startIndex": 9, "endIndex": 11, "scopes": ["source.abl", "meta.block.abl", "variable.other.abl"] }, // 'mI'
|
|
64
|
+
{ "startIndex": 11, "endIndex": 12, "scopes": ["source.abl", "meta.block.abl"] }, // ' '
|
|
65
|
+
{ "startIndex": 12, "endIndex": 14, "scopes": ["source.abl", "meta.block.abl", "keyword.operator.source.abl"] }, // '<='
|
|
66
|
+
{ "startIndex": 14, "endIndex": 15, "scopes": ["source.abl", "meta.block.abl"] }, // ' '
|
|
67
|
+
{ "startIndex": 15, "endIndex": 17, "scopes": ["source.abl", "meta.block.abl", "constant.numeric.source.abl"] }, // '10'
|
|
68
|
+
{ "startIndex": 17, "endIndex": 18, "scopes": ["source.abl", "meta.block.abl"] } // ':'
|
|
69
|
+
],
|
|
70
|
+
[
|
|
71
|
+
{ "startIndex": 0, "endIndex": 4, "scopes": ["source.abl"] }, // ' '
|
|
72
|
+
{ "startIndex": 4, "endIndex": 6, "scopes": ["source.abl", "variable.other.abl"] }, // 'mI'
|
|
73
|
+
{ "startIndex": 6, "endIndex": 7, "scopes": ["source.abl"] }, // ' '
|
|
74
|
+
{ "startIndex": 7, "endIndex": 8, "scopes": ["source.abl", "keyword.operator.source.abl"] }, // '='
|
|
75
|
+
{ "startIndex": 8, "endIndex": 9, "scopes": ["source.abl"] }, // ' '
|
|
76
|
+
{ "startIndex": 9, "endIndex": 11, "scopes": ["source.abl", "variable.other.abl"] }, // 'mI'
|
|
77
|
+
{ "startIndex": 11, "endIndex": 12, "scopes": ["source.abl"] }, // ' '
|
|
78
|
+
{ "startIndex": 12, "endIndex": 13, "scopes": ["source.abl", "keyword.operator.source.abl"] }, // '+'
|
|
79
|
+
{ "startIndex": 13, "endIndex": 14, "scopes": ["source.abl"] }, // ' '
|
|
80
|
+
{ "startIndex": 14, "endIndex": 15, "scopes": ["source.abl", "constant.numeric.source.abl"] }, // '1'
|
|
81
|
+
{ "startIndex": 15, "endIndex": 16, "scopes": ["source.abl", "punctuation.terminator.abl"] } // '.'
|
|
82
|
+
],
|
|
83
|
+
[
|
|
84
|
+
{ "startIndex": 0, "endIndex": 3, "scopes": ["source.abl", "keyword.other.abl"] }, // 'END'
|
|
85
|
+
{ "startIndex": 3, "endIndex": 4, "scopes": ["source.abl", "punctuation.terminator.abl"] } // '.'
|
|
86
|
+
]
|
|
87
|
+
];
|
|
88
|
+
shared.itShouldMatchExpectedScopes(statement, expectedTokens);
|
|
89
|
+
})
|
package/spec/do/issue#3.spec.js
CHANGED
|
@@ -2,73 +2,80 @@ const { assert, expect } = require('chai');
|
|
|
2
2
|
const shared = require('../shared.js');
|
|
3
3
|
|
|
4
4
|
describe('', () => {
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
//label-with-a-dot-inside.spec
|
|
6
|
+
let statement = `
|
|
7
7
|
DO mI = 1 TO 3:
|
|
8
8
|
/* comment */
|
|
9
9
|
END.`;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
10
|
+
let expectedTokens = [
|
|
11
|
+
[
|
|
12
|
+
{ "startIndex": 0, "endIndex": 1, "scopes": ["source.abl"] } // ''
|
|
13
|
+
],
|
|
14
|
+
[
|
|
15
|
+
{ "startIndex": 0, "endIndex": 2, "scopes": ["source.abl", "meta.block.abl", "keyword.other.abl"] }, // 'DO'
|
|
16
|
+
{ "startIndex": 2, "endIndex": 3, "scopes": ["source.abl", "meta.block.abl"] }, // ' '
|
|
17
|
+
{ "startIndex": 3, "endIndex": 5, "scopes": ["source.abl", "meta.block.abl", "variable.other.abl"] }, // 'mI'
|
|
18
|
+
{ "startIndex": 5, "endIndex": 6, "scopes": ["source.abl", "meta.block.abl"] }, // ' '
|
|
19
|
+
{ "startIndex": 6, "endIndex": 7, "scopes": ["source.abl", "meta.block.abl", "keyword.operator.source.abl"] }, // '='
|
|
20
|
+
{ "startIndex": 7, "endIndex": 8, "scopes": ["source.abl", "meta.block.abl"] }, // ' '
|
|
21
|
+
{ "startIndex": 8, "endIndex": 9, "scopes": ["source.abl", "meta.block.abl", "constant.numeric.source.abl"] }, // '1'
|
|
22
|
+
{ "startIndex": 9, "endIndex": 13, "scopes": ["source.abl", "meta.block.abl", "keyword.other"] }, // ' TO '
|
|
23
|
+
{ "startIndex": 13, "endIndex": 14, "scopes": ["source.abl", "meta.block.abl", "constant.numeric.source.abl"] }, // '3'
|
|
24
|
+
{ "startIndex": 14, "endIndex": 15, "scopes": ["source.abl", "meta.block.abl"] } // ':'
|
|
25
|
+
],
|
|
26
|
+
[
|
|
27
|
+
{ "startIndex": 0, "endIndex": 4, "scopes": ["source.abl"] }, // ' '
|
|
28
|
+
{ "startIndex": 4, "endIndex": 6, "scopes": ["source.abl", "comment.block.source.abl"] }, // '/*'
|
|
29
|
+
{ "startIndex": 6, "endIndex": 15, "scopes": ["source.abl", "comment.block.source.abl", "comment"] }, // ' comment '
|
|
30
|
+
{ "startIndex": 15, "endIndex": 17, "scopes": ["source.abl", "comment.block.source.abl"] } // '*/'
|
|
31
|
+
],
|
|
32
|
+
[
|
|
33
|
+
{ "startIndex": 0, "endIndex": 3, "scopes": ["source.abl", "keyword.other.abl"] }, // 'END'
|
|
34
|
+
{ "startIndex": 3, "endIndex": 4, "scopes": ["source.abl", "punctuation.terminator.abl"] } // '.'
|
|
35
|
+
]
|
|
36
|
+
]
|
|
37
|
+
shared.itShouldMatchExpectedScopes(statement, expectedTokens);
|
|
35
38
|
})
|
|
36
39
|
|
|
37
40
|
describe('', () => {
|
|
38
|
-
|
|
39
|
-
|
|
41
|
+
//label-with-a-dot-inside.spec
|
|
42
|
+
let statement = `
|
|
40
43
|
DO WHILE mI <= 10:
|
|
41
44
|
mI = mI + 1.
|
|
42
45
|
END.`;
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
46
|
+
let expectedTokens = [
|
|
47
|
+
[
|
|
48
|
+
{ "startIndex": 0, "endIndex": 1, "scopes": ["source.abl"] } // ''
|
|
49
|
+
],
|
|
50
|
+
[
|
|
51
|
+
{ "startIndex": 0, "endIndex": 2, "scopes": ["source.abl", "meta.block.abl", "keyword.other.abl"] }, // 'DO'
|
|
52
|
+
{ "startIndex": 2, "endIndex": 3, "scopes": ["source.abl", "meta.block.abl"] }, // ' '
|
|
53
|
+
{ "startIndex": 3, "endIndex": 8, "scopes": ["source.abl", "meta.block.abl", "keyword.other.abl"] }, // 'WHILE'
|
|
54
|
+
{ "startIndex": 8, "endIndex": 9, "scopes": ["source.abl", "meta.block.abl"] }, // ' '
|
|
55
|
+
{ "startIndex": 9, "endIndex": 11, "scopes": ["source.abl", "meta.block.abl", "variable.other.abl"] }, // 'mI'
|
|
56
|
+
{ "startIndex": 11, "endIndex": 12, "scopes": ["source.abl", "meta.block.abl"] }, // ' '
|
|
57
|
+
{ "startIndex": 12, "endIndex": 14, "scopes": ["source.abl", "meta.block.abl", "keyword.operator.source.abl"] }, // '<='
|
|
58
|
+
{ "startIndex": 14, "endIndex": 15, "scopes": ["source.abl", "meta.block.abl"] }, // ' '
|
|
59
|
+
{ "startIndex": 15, "endIndex": 17, "scopes": ["source.abl", "meta.block.abl", "constant.numeric.source.abl"] }, // '10'
|
|
60
|
+
{ "startIndex": 17, "endIndex": 18, "scopes": ["source.abl", "meta.block.abl"] } // ':'
|
|
61
|
+
],
|
|
62
|
+
[
|
|
63
|
+
{ "startIndex": 0, "endIndex": 4, "scopes": ["source.abl"] }, // ' '
|
|
64
|
+
{ "startIndex": 4, "endIndex": 6, "scopes": ["source.abl", "variable.other.abl"] }, // 'mI'
|
|
65
|
+
{ "startIndex": 6, "endIndex": 7, "scopes": ["source.abl"] }, // ' '
|
|
66
|
+
{ "startIndex": 7, "endIndex": 8, "scopes": ["source.abl", "keyword.operator.source.abl"] }, // '='
|
|
67
|
+
{ "startIndex": 8, "endIndex": 9, "scopes": ["source.abl"] }, // ' '
|
|
68
|
+
{ "startIndex": 9, "endIndex": 11, "scopes": ["source.abl", "variable.other.abl"] }, // 'mI'
|
|
69
|
+
{ "startIndex": 11, "endIndex": 12, "scopes": ["source.abl"] }, // ' '
|
|
70
|
+
{ "startIndex": 12, "endIndex": 13, "scopes": ["source.abl", "keyword.operator.source.abl"] }, // '+'
|
|
71
|
+
{ "startIndex": 13, "endIndex": 14, "scopes": ["source.abl"] }, // ' '
|
|
72
|
+
{ "startIndex": 14, "endIndex": 15, "scopes": ["source.abl", "constant.numeric.source.abl"] }, // '1'
|
|
73
|
+
{ "startIndex": 15, "endIndex": 16, "scopes": ["source.abl", "punctuation.terminator.abl"] } // '.'
|
|
74
|
+
],
|
|
75
|
+
[
|
|
76
|
+
{ "startIndex": 0, "endIndex": 3, "scopes": ["source.abl", "keyword.other.abl"] }, // 'END'
|
|
77
|
+
{ "startIndex": 3, "endIndex": 4, "scopes": ["source.abl", "punctuation.terminator.abl"] } // '.'
|
|
78
|
+
]
|
|
79
|
+
]
|
|
80
|
+
shared.itShouldMatchExpectedScopes(statement, expectedTokens);
|
|
74
81
|
})
|
|
@@ -2,125 +2,128 @@ const { assert, expect } = require('chai');
|
|
|
2
2
|
const shared = require('../shared.js');
|
|
3
3
|
|
|
4
4
|
describe('', () => {
|
|
5
|
-
|
|
6
|
-
`def var c_test as char no-undo.
|
|
5
|
+
let statement =
|
|
6
|
+
`def var c_test as char no-undo.
|
|
7
7
|
c_test = 'Test message':u.
|
|
8
8
|
trim(c_test)`;
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
]
|
|
42
|
-
|
|
10
|
+
let expectedTokens = [
|
|
11
|
+
[
|
|
12
|
+
{ "startIndex": 0, "endIndex": 3, "scopes": ["source.abl", "meta.define.abl", "keyword.other.abl"] }, // 'def'
|
|
13
|
+
{ "startIndex": 3, "endIndex": 4, "scopes": ["source.abl", "meta.define.abl"] }, // ' '
|
|
14
|
+
{ "startIndex": 4, "endIndex": 7, "scopes": ["source.abl", "meta.define.abl", "keyword.other.abl"] }, // 'var'
|
|
15
|
+
{ "startIndex": 7, "endIndex": 8, "scopes": ["source.abl", "meta.define.abl"] }, // ' '
|
|
16
|
+
{ "startIndex": 8, "endIndex": 14, "scopes": ["source.abl", "meta.define.abl", "variable.other.abl"] }, // 'c_test'
|
|
17
|
+
{ "startIndex": 14, "endIndex": 15, "scopes": ["source.abl", "meta.define.abl"] }, // ' '
|
|
18
|
+
{ "startIndex": 15, "endIndex": 17, "scopes": ["source.abl", "meta.define.abl", "keyword.other.abl"] }, // 'as'
|
|
19
|
+
{ "startIndex": 17, "endIndex": 18, "scopes": ["source.abl", "meta.define.abl"] }, // ' '
|
|
20
|
+
{ "startIndex": 18, "endIndex": 22, "scopes": ["source.abl", "meta.define.abl", "storage.type.abl"] }, // 'char'
|
|
21
|
+
{ "startIndex": 22, "endIndex": 23, "scopes": ["source.abl", "meta.define.abl"] }, // ' '
|
|
22
|
+
{ "startIndex": 23, "endIndex": 30, "scopes": ["source.abl", "meta.define.abl", "keyword.other.abl"] }, // 'no-undo'
|
|
23
|
+
{ "startIndex": 30, "endIndex": 31, "scopes": ["source.abl", "meta.define.abl", "punctuation.terminator.abl"] } // '.'
|
|
24
|
+
],
|
|
25
|
+
[
|
|
26
|
+
{ "startIndex": 0, "endIndex": 6, "scopes": ["source.abl", "variable.other.abl"] }, // 'c_test'
|
|
27
|
+
{ "startIndex": 6, "endIndex": 7, "scopes": ["source.abl"] }, // ' '
|
|
28
|
+
{ "startIndex": 7, "endIndex": 8, "scopes": ["source.abl", "keyword.operator.source.abl"] }, // '='
|
|
29
|
+
{ "startIndex": 8, "endIndex": 9, "scopes": ["source.abl"] }, // ' '
|
|
30
|
+
{ "startIndex": 9, "endIndex": 10, "scopes": ["source.abl", "string.single.complex.abl", "punctuation.definition.string.begin.abl"] }, // '''
|
|
31
|
+
{ "startIndex": 10, "endIndex": 22, "scopes": ["source.abl", "string.single.complex.abl"] }, // 'Test message'
|
|
32
|
+
{ "startIndex": 22, "endIndex": 23, "scopes": ["source.abl", "string.single.complex.abl", "punctuation.definition.string.end.abl"] }, // '''
|
|
33
|
+
{ "startIndex": 23, "endIndex": 25, "scopes": ["source.abl", "support.other.abl"] }, // ':u'
|
|
34
|
+
{ "startIndex": 25, "endIndex": 26, "scopes": ["source.abl", "punctuation.terminator.abl"] } // '.'
|
|
35
|
+
],
|
|
36
|
+
[
|
|
37
|
+
{ "startIndex": 0, "endIndex": 4, "scopes": ["source.abl", "meta.function-call.abl", "support.function.abl"] }, // 'trim'
|
|
38
|
+
{ "startIndex": 4, "endIndex": 5, "scopes": ["source.abl", "meta.function-call.abl", "meta.function.arguments.abl", "meta.brace.round.js"] }, // '('
|
|
39
|
+
{ "startIndex": 5, "endIndex": 11, "scopes": ["source.abl", "meta.function-call.abl", "meta.function.arguments.abl", "variable.other.abl"] }, // 'c_test'
|
|
40
|
+
{ "startIndex": 11, "endIndex": 12, "scopes": ["source.abl", "meta.brace.round.js"] } // ')'
|
|
41
|
+
]
|
|
42
|
+
];
|
|
43
|
+
shared.itShouldMatchExpectedScopes(statement, expectedTokens);
|
|
43
44
|
})
|
|
44
45
|
|
|
45
46
|
describe('', () => {
|
|
46
|
-
|
|
47
|
-
`def var c_test as char no-undo.
|
|
47
|
+
let statement =
|
|
48
|
+
`def var c_test as char no-undo.
|
|
48
49
|
c_test = 'Test message':u.
|
|
49
50
|
trim( c_test)`;
|
|
50
51
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
]
|
|
84
|
-
|
|
52
|
+
let expectedTokens = [
|
|
53
|
+
[
|
|
54
|
+
{ "startIndex": 0, "endIndex": 3, "scopes": ["source.abl", "meta.define.abl", "keyword.other.abl"] }, // 'def'
|
|
55
|
+
{ "startIndex": 3, "endIndex": 4, "scopes": ["source.abl", "meta.define.abl"] }, // ' '
|
|
56
|
+
{ "startIndex": 4, "endIndex": 7, "scopes": ["source.abl", "meta.define.abl", "keyword.other.abl"] }, // 'var'
|
|
57
|
+
{ "startIndex": 7, "endIndex": 8, "scopes": ["source.abl", "meta.define.abl"] }, // ' '
|
|
58
|
+
{ "startIndex": 8, "endIndex": 14, "scopes": ["source.abl", "meta.define.abl", "variable.other.abl"] }, // 'c_test'
|
|
59
|
+
{ "startIndex": 14, "endIndex": 15, "scopes": ["source.abl", "meta.define.abl"] }, // ' '
|
|
60
|
+
{ "startIndex": 15, "endIndex": 17, "scopes": ["source.abl", "meta.define.abl", "keyword.other.abl"] }, // 'as'
|
|
61
|
+
{ "startIndex": 17, "endIndex": 18, "scopes": ["source.abl", "meta.define.abl"] }, // ' '
|
|
62
|
+
{ "startIndex": 18, "endIndex": 22, "scopes": ["source.abl", "meta.define.abl", "storage.type.abl"] }, // 'char'
|
|
63
|
+
{ "startIndex": 22, "endIndex": 23, "scopes": ["source.abl", "meta.define.abl"] }, // ' '
|
|
64
|
+
{ "startIndex": 23, "endIndex": 30, "scopes": ["source.abl", "meta.define.abl", "keyword.other.abl"] }, // 'no-undo'
|
|
65
|
+
{ "startIndex": 30, "endIndex": 31, "scopes": ["source.abl", "meta.define.abl", "punctuation.terminator.abl"] } // '.'
|
|
66
|
+
],
|
|
67
|
+
[
|
|
68
|
+
{ "startIndex": 0, "endIndex": 6, "scopes": ["source.abl", "variable.other.abl"] }, // 'c_test'
|
|
69
|
+
{ "startIndex": 6, "endIndex": 7, "scopes": ["source.abl"] }, // ' '
|
|
70
|
+
{ "startIndex": 7, "endIndex": 8, "scopes": ["source.abl", "keyword.operator.source.abl"] }, // '='
|
|
71
|
+
{ "startIndex": 8, "endIndex": 9, "scopes": ["source.abl"] }, // ' '
|
|
72
|
+
{ "startIndex": 9, "endIndex": 10, "scopes": ["source.abl", "string.single.complex.abl", "punctuation.definition.string.begin.abl"] }, // '''
|
|
73
|
+
{ "startIndex": 10, "endIndex": 22, "scopes": ["source.abl", "string.single.complex.abl"] }, // 'Test message'
|
|
74
|
+
{ "startIndex": 22, "endIndex": 23, "scopes": ["source.abl", "string.single.complex.abl", "punctuation.definition.string.end.abl"] }, // '''
|
|
75
|
+
{ "startIndex": 23, "endIndex": 25, "scopes": ["source.abl", "support.other.abl"] }, // ':u'
|
|
76
|
+
{ "startIndex": 25, "endIndex": 26, "scopes": ["source.abl", "punctuation.terminator.abl"] } // '.'
|
|
77
|
+
],
|
|
78
|
+
[
|
|
79
|
+
{ "startIndex": 0, "endIndex": 4, "scopes": ["source.abl", "meta.function-call.abl", "support.function.abl"] }, // 'trim'
|
|
80
|
+
{ "startIndex": 4, "endIndex": 5, "scopes": ["source.abl", "meta.function-call.abl", "meta.function.arguments.abl", "meta.brace.round.js"] }, // '('
|
|
81
|
+
{ "startIndex": 5, "endIndex": 6, "scopes": ["source.abl", "meta.function-call.abl", "meta.function.arguments.abl"] }, // ' '
|
|
82
|
+
{ "startIndex": 6, "endIndex": 12, "scopes": ["source.abl", "meta.function-call.abl", "meta.function.arguments.abl", "variable.other.abl"] }, // 'c_test'
|
|
83
|
+
{ "startIndex": 12, "endIndex": 13, "scopes": ["source.abl", "meta.brace.round.js"] } // ')'
|
|
84
|
+
]
|
|
85
|
+
];
|
|
86
|
+
shared.itShouldMatchExpectedScopes(statement, expectedTokens);
|
|
85
87
|
})
|
|
86
88
|
describe('', () => {
|
|
87
|
-
|
|
88
|
-
`def var c_test as char no-undo.
|
|
89
|
+
let statement =
|
|
90
|
+
`def var c_test as char no-undo.
|
|
89
91
|
c_test = 'Test message':u.
|
|
90
92
|
trim(c_test )`;
|
|
91
93
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
]
|
|
125
|
-
|
|
94
|
+
let expectedTokens = [
|
|
95
|
+
[
|
|
96
|
+
{ "startIndex": 0, "endIndex": 3, "scopes": ["source.abl", "meta.define.abl", "keyword.other.abl"] }, // 'def'
|
|
97
|
+
{ "startIndex": 3, "endIndex": 4, "scopes": ["source.abl", "meta.define.abl"] }, // ' '
|
|
98
|
+
{ "startIndex": 4, "endIndex": 7, "scopes": ["source.abl", "meta.define.abl", "keyword.other.abl"] }, // 'var'
|
|
99
|
+
{ "startIndex": 7, "endIndex": 8, "scopes": ["source.abl", "meta.define.abl"] }, // ' '
|
|
100
|
+
{ "startIndex": 8, "endIndex": 14, "scopes": ["source.abl", "meta.define.abl", "variable.other.abl"] }, // 'c_test'
|
|
101
|
+
{ "startIndex": 14, "endIndex": 15, "scopes": ["source.abl", "meta.define.abl"] }, // ' '
|
|
102
|
+
{ "startIndex": 15, "endIndex": 17, "scopes": ["source.abl", "meta.define.abl", "keyword.other.abl"] }, // 'as'
|
|
103
|
+
{ "startIndex": 17, "endIndex": 18, "scopes": ["source.abl", "meta.define.abl"] }, // ' '
|
|
104
|
+
{ "startIndex": 18, "endIndex": 22, "scopes": ["source.abl", "meta.define.abl", "storage.type.abl"] }, // 'char'
|
|
105
|
+
{ "startIndex": 22, "endIndex": 23, "scopes": ["source.abl", "meta.define.abl"] }, // ' '
|
|
106
|
+
{ "startIndex": 23, "endIndex": 30, "scopes": ["source.abl", "meta.define.abl", "keyword.other.abl"] }, // 'no-undo'
|
|
107
|
+
{ "startIndex": 30, "endIndex": 31, "scopes": ["source.abl", "meta.define.abl", "punctuation.terminator.abl"] } // '.'
|
|
108
|
+
],
|
|
109
|
+
[
|
|
110
|
+
{ "startIndex": 0, "endIndex": 6, "scopes": ["source.abl", "variable.other.abl"] }, // 'c_test'
|
|
111
|
+
{ "startIndex": 6, "endIndex": 7, "scopes": ["source.abl"] }, // ' '
|
|
112
|
+
{ "startIndex": 7, "endIndex": 8, "scopes": ["source.abl", "keyword.operator.source.abl"] }, // '='
|
|
113
|
+
{ "startIndex": 8, "endIndex": 9, "scopes": ["source.abl"] }, // ' '
|
|
114
|
+
{ "startIndex": 9, "endIndex": 10, "scopes": ["source.abl", "string.single.complex.abl", "punctuation.definition.string.begin.abl"] }, // '''
|
|
115
|
+
{ "startIndex": 10, "endIndex": 22, "scopes": ["source.abl", "string.single.complex.abl"] }, // 'Test message'
|
|
116
|
+
{ "startIndex": 22, "endIndex": 23, "scopes": ["source.abl", "string.single.complex.abl", "punctuation.definition.string.end.abl"] }, // '''
|
|
117
|
+
{ "startIndex": 23, "endIndex": 25, "scopes": ["source.abl", "support.other.abl"] }, // ':u'
|
|
118
|
+
{ "startIndex": 25, "endIndex": 26, "scopes": ["source.abl", "punctuation.terminator.abl"] } // '.'
|
|
119
|
+
],
|
|
120
|
+
[
|
|
121
|
+
{ "startIndex": 0, "endIndex": 4, "scopes": ["source.abl", "meta.function-call.abl", "support.function.abl"] }, // 'trim'
|
|
122
|
+
{ "startIndex": 4, "endIndex": 5, "scopes": ["source.abl", "meta.function-call.abl", "meta.function.arguments.abl", "meta.brace.round.js"] }, // '('
|
|
123
|
+
{ "startIndex": 5, "endIndex": 11, "scopes": ["source.abl", "meta.function-call.abl", "meta.function.arguments.abl", "variable.other.abl"] }, // 'c_test'
|
|
124
|
+
{ "startIndex": 11, "endIndex": 12, "scopes": ["source.abl", "meta.function-call.abl", "meta.function.arguments.abl"] }, // ' '
|
|
125
|
+
{ "startIndex": 12, "endIndex": 13, "scopes": ["source.abl", "meta.brace.round.js"] } // ')'
|
|
126
|
+
]
|
|
127
|
+
];
|
|
128
|
+
shared.itShouldMatchExpectedScopes(statement, expectedTokens);
|
|
126
129
|
})
|