abl-tmlanguage 1.3.5 → 1.3.7
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 +167 -48
- package/index.js +13 -10
- package/package.json +1 -1
- package/spec/blocks/on-quit.spec.js +32 -32
- package/spec/comments/comment-in-block-statement.spec.js +18 -18
- package/spec/define-frame/issue#173.spec.js +48 -0
- package/spec/do/do-blocks.spec.js +52 -52
- package/spec/function-call/can-find.spec.js +240 -0
- package/spec/misc-statements/class-in-var-name.spec.js +205 -0
- package/spec/misc-statements/export-delimiter.spec.js +37 -0
- package/spec/misc-statements/if-then.spec.js +8 -8
- package/spec/misc-statements/issue#173.spec.js +100 -0
- package/spec/misc-statements/skip-statement-and-fuction.spec.js +36 -0
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
const { assert, expect } = require('chai');
|
|
2
|
+
const shared = require('../shared.js');
|
|
3
|
+
|
|
4
|
+
describe('', () => {
|
|
5
|
+
let statement = `if (check-value = true) then
|
|
6
|
+
message "Yes" view-as alert-box.`;
|
|
7
|
+
let expectedTokens = [
|
|
8
|
+
[
|
|
9
|
+
{ "startIndex": 0, "endIndex": 2, "scopes": ["source.abl", "keyword.other.abl"] }, // 'if'
|
|
10
|
+
{ "startIndex": 2, "endIndex": 3, "scopes": ["source.abl"] }, // ' '
|
|
11
|
+
{ "startIndex": 3, "endIndex": 4, "scopes": ["source.abl", "meta.brace.round.js"] }, // '('
|
|
12
|
+
{ "startIndex": 4, "endIndex": 15, "scopes": ["source.abl", "variable.other.abl"] }, // 'check-value'
|
|
13
|
+
{ "startIndex": 15, "endIndex": 16, "scopes": ["source.abl"] }, // ' '
|
|
14
|
+
{ "startIndex": 16, "endIndex": 17, "scopes": ["source.abl", "keyword.operator.source.abl"] }, // '='
|
|
15
|
+
{ "startIndex": 17, "endIndex": 18, "scopes": ["source.abl"] }, // ' '
|
|
16
|
+
{ "startIndex": 18, "endIndex": 22, "scopes": ["source.abl", "constant.language.abl"] }, // 'true'
|
|
17
|
+
{ "startIndex": 22, "endIndex": 23, "scopes": ["source.abl", "meta.brace.round.js"] }, // ')'
|
|
18
|
+
{ "startIndex": 23, "endIndex": 24, "scopes": ["source.abl"] }, // ' '
|
|
19
|
+
{ "startIndex": 24, "endIndex": 28, "scopes": ["source.abl", "keyword.other.abl"] } // 'then'
|
|
20
|
+
],
|
|
21
|
+
[
|
|
22
|
+
{ "startIndex": 0, "endIndex": 2, "scopes": ["source.abl"] }, // ' '
|
|
23
|
+
{ "startIndex": 2, "endIndex": 9, "scopes": ["source.abl", "keyword.other.abl"] }, // 'message'
|
|
24
|
+
{ "startIndex": 9, "endIndex": 10, "scopes": ["source.abl"] }, // ' '
|
|
25
|
+
{ "startIndex": 10, "endIndex": 11, "scopes": ["source.abl", "string.double.complex.abl", "punctuation.definition.string.begin.abl"] }, // '"'
|
|
26
|
+
{ "startIndex": 11, "endIndex": 14, "scopes": ["source.abl", "string.double.complex.abl"] }, // 'Yes'
|
|
27
|
+
{ "startIndex": 14, "endIndex": 15, "scopes": ["source.abl", "string.double.complex.abl", "punctuation.definition.string.end.abl"] }, // '"'
|
|
28
|
+
{ "startIndex": 15, "endIndex": 16, "scopes": ["source.abl"] }, // ' '
|
|
29
|
+
{ "startIndex": 16, "endIndex": 23, "scopes": ["source.abl", "keyword.other.abl"] }, // 'view-as'
|
|
30
|
+
{ "startIndex": 23, "endIndex": 24, "scopes": ["source.abl"] }, // ' '
|
|
31
|
+
{ "startIndex": 24, "endIndex": 33, "scopes": ["source.abl", "keyword.other.abl"] }, // 'alert-box'
|
|
32
|
+
{ "startIndex": 33, "endIndex": 34, "scopes": ["source.abl", "punctuation.terminator.abl"] } // '.'
|
|
33
|
+
]
|
|
34
|
+
];
|
|
35
|
+
shared.itShouldMatchExpectedScopes(statement, expectedTokens);
|
|
36
|
+
})
|
|
37
|
+
|
|
38
|
+
describe('', () => {
|
|
39
|
+
let statement = `define variable new-data as integer no-undo.
|
|
40
|
+
define variable check-value as logical no-undo.
|
|
41
|
+
|
|
42
|
+
assign
|
|
43
|
+
new-data = 12345
|
|
44
|
+
check-value = true.`;
|
|
45
|
+
let expectedTokens = [
|
|
46
|
+
[
|
|
47
|
+
{ "startIndex": 0, "endIndex": 6, "scopes": ["source.abl", "meta.define.abl", "keyword.other.abl"] }, // 'define'
|
|
48
|
+
{ "startIndex": 6, "endIndex": 7, "scopes": ["source.abl", "meta.define.abl"] }, // ' '
|
|
49
|
+
{ "startIndex": 7, "endIndex": 15, "scopes": ["source.abl", "meta.define.abl", "keyword.other.abl"] }, // 'variable'
|
|
50
|
+
{ "startIndex": 15, "endIndex": 16, "scopes": ["source.abl", "meta.define.abl"] }, // ' '
|
|
51
|
+
{ "startIndex": 16, "endIndex": 24, "scopes": ["source.abl", "meta.define.abl", "variable.other.abl"] }, // 'new-data'
|
|
52
|
+
{ "startIndex": 24, "endIndex": 25, "scopes": ["source.abl", "meta.define.abl"] }, // ' '
|
|
53
|
+
{ "startIndex": 25, "endIndex": 27, "scopes": ["source.abl", "meta.define.abl", "keyword.other.abl"] }, // 'as'
|
|
54
|
+
{ "startIndex": 27, "endIndex": 28, "scopes": ["source.abl", "meta.define.abl"] }, // ' '
|
|
55
|
+
{ "startIndex": 28, "endIndex": 35, "scopes": ["source.abl", "meta.define.abl", "storage.type.abl"] }, // 'integer'
|
|
56
|
+
{ "startIndex": 35, "endIndex": 36, "scopes": ["source.abl", "meta.define.abl"] }, // ' '
|
|
57
|
+
{ "startIndex": 36, "endIndex": 43, "scopes": ["source.abl", "meta.define.abl", "keyword.other.abl"] }, // 'no-undo'
|
|
58
|
+
{ "startIndex": 43, "endIndex": 44, "scopes": ["source.abl", "meta.define.abl", "punctuation.terminator.abl"] } // '.'
|
|
59
|
+
],
|
|
60
|
+
[
|
|
61
|
+
{ "startIndex": 0, "endIndex": 6, "scopes": ["source.abl", "meta.define.abl", "keyword.other.abl"] }, // 'define'
|
|
62
|
+
{ "startIndex": 6, "endIndex": 7, "scopes": ["source.abl", "meta.define.abl"] }, // ' '
|
|
63
|
+
{ "startIndex": 7, "endIndex": 15, "scopes": ["source.abl", "meta.define.abl", "keyword.other.abl"] }, // 'variable'
|
|
64
|
+
{ "startIndex": 15, "endIndex": 16, "scopes": ["source.abl", "meta.define.abl"] }, // ' '
|
|
65
|
+
{ "startIndex": 16, "endIndex": 27, "scopes": ["source.abl", "meta.define.abl", "variable.other.abl"] }, // 'check-value'
|
|
66
|
+
{ "startIndex": 27, "endIndex": 28, "scopes": ["source.abl", "meta.define.abl"] }, // ' '
|
|
67
|
+
{ "startIndex": 28, "endIndex": 30, "scopes": ["source.abl", "meta.define.abl", "keyword.other.abl"] }, // 'as'
|
|
68
|
+
{ "startIndex": 30, "endIndex": 31, "scopes": ["source.abl", "meta.define.abl"] }, // ' '
|
|
69
|
+
{ "startIndex": 31, "endIndex": 38, "scopes": ["source.abl", "meta.define.abl", "storage.type.abl"] }, // 'logical'
|
|
70
|
+
{ "startIndex": 38, "endIndex": 39, "scopes": ["source.abl", "meta.define.abl"] }, // ' '
|
|
71
|
+
{ "startIndex": 39, "endIndex": 46, "scopes": ["source.abl", "meta.define.abl", "keyword.other.abl"] }, // 'no-undo'
|
|
72
|
+
{ "startIndex": 46, "endIndex": 47, "scopes": ["source.abl", "meta.define.abl", "punctuation.terminator.abl"] } // '.'
|
|
73
|
+
],
|
|
74
|
+
[
|
|
75
|
+
{ "startIndex": 0, "endIndex": 1, "scopes": ["source.abl"] } // ''
|
|
76
|
+
],
|
|
77
|
+
[
|
|
78
|
+
{ "startIndex": 0, "endIndex": 6, "scopes": ["source.abl", "keyword.other.abl"] }, // 'assign'
|
|
79
|
+
],
|
|
80
|
+
[
|
|
81
|
+
{ "startIndex": 0, "endIndex": 2, "scopes": ["source.abl"] }, // ' '
|
|
82
|
+
{ "startIndex": 2, "endIndex": 10, "scopes": ["source.abl", "variable.other.abl"] }, // 'new-data'
|
|
83
|
+
{ "startIndex": 10, "endIndex": 11, "scopes": ["source.abl"] }, // ' '
|
|
84
|
+
{ "startIndex": 11, "endIndex": 12, "scopes": ["source.abl", "keyword.operator.source.abl"] }, // '='
|
|
85
|
+
{ "startIndex": 12, "endIndex": 13, "scopes": ["source.abl"] }, // ' '
|
|
86
|
+
{ "startIndex": 13, "endIndex": 18, "scopes": ["source.abl", "constant.numeric.source.abl"] } // '12345'
|
|
87
|
+
],
|
|
88
|
+
[
|
|
89
|
+
{ "startIndex": 0, "endIndex": 2, "scopes": ["source.abl"] }, // ' '
|
|
90
|
+
{ "startIndex": 2, "endIndex": 13, "scopes": ["source.abl", "variable.other.abl"] }, // 'check-value'
|
|
91
|
+
{ "startIndex": 13, "endIndex": 14, "scopes": ["source.abl"] }, // ' '
|
|
92
|
+
{ "startIndex": 14, "endIndex": 15, "scopes": ["source.abl", "keyword.operator.source.abl"] }, // '='
|
|
93
|
+
{ "startIndex": 15, "endIndex": 16, "scopes": ["source.abl"] }, // ' '
|
|
94
|
+
{ "startIndex": 16, "endIndex": 20, "scopes": ["source.abl", "constant.language.abl"] }, // 'true'
|
|
95
|
+
{ "startIndex": 20, "endIndex": 21, "scopes": ["source.abl", "punctuation.terminator.abl"] } // '.'
|
|
96
|
+
]
|
|
97
|
+
];
|
|
98
|
+
shared.itShouldMatchExpectedScopes(statement, expectedTokens);
|
|
99
|
+
})
|
|
100
|
+
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
const { assert, expect } = require('chai');
|
|
2
|
+
const shared = require('../shared.js');
|
|
3
|
+
|
|
4
|
+
describe('', () => {
|
|
5
|
+
let statement = `put unformatted
|
|
6
|
+
"fasa"
|
|
7
|
+
skip
|
|
8
|
+
skip(3).`;
|
|
9
|
+
let expectedTokens = [
|
|
10
|
+
[
|
|
11
|
+
{ "startIndex": 0, "endIndex": 3, "scopes": ["source.abl", "keyword.other.abl"] }, // 'put'
|
|
12
|
+
{ "startIndex": 3, "endIndex": 4, "scopes": ["source.abl"] }, // ' '
|
|
13
|
+
{ "startIndex": 4, "endIndex": 15, "scopes": ["source.abl", "keyword.other.abl"] } // 'unformatted'
|
|
14
|
+
],
|
|
15
|
+
[
|
|
16
|
+
{ "startIndex": 0, "endIndex": 4, "scopes": ["source.abl"] }, // ' '
|
|
17
|
+
{ "startIndex": 4, "endIndex": 5, "scopes": ["source.abl", "string.double.complex.abl", "punctuation.definition.string.begin.abl"] }, // '"'
|
|
18
|
+
{ "startIndex": 5, "endIndex": 9, "scopes": ["source.abl", "string.double.complex.abl"] }, // 'fasa'
|
|
19
|
+
{ "startIndex": 9, "endIndex": 10, "scopes": ["source.abl", "string.double.complex.abl", "punctuation.definition.string.end.abl"] } // '"'
|
|
20
|
+
],
|
|
21
|
+
[
|
|
22
|
+
{ "startIndex": 0, "endIndex": 4, "scopes": ["source.abl"] }, // ' '
|
|
23
|
+
{ "startIndex": 4, "endIndex": 8, "scopes": ["source.abl", "keyword.other.abl"] } // 'skip'
|
|
24
|
+
],
|
|
25
|
+
[
|
|
26
|
+
{ "startIndex": 0, "endIndex": 4, "scopes": ["source.abl", "meta.function-call.abl"] }, // ' '
|
|
27
|
+
{ "startIndex": 4, "endIndex": 8, "scopes": ["source.abl", "meta.function-call.abl", "support.function.abl"] }, // 'skip'
|
|
28
|
+
{ "startIndex": 8, "endIndex": 9, "scopes": ["source.abl", "meta.function-call.abl", "meta.function.arguments.abl", "meta.brace.round.js"] }, // '('
|
|
29
|
+
{ "startIndex": 9, "endIndex": 10, "scopes": ["source.abl", "meta.function-call.abl", "meta.function.arguments.abl", "constant.numeric.source.abl"] }, // '3'
|
|
30
|
+
{ "startIndex": 10, "endIndex": 11, "scopes": ["source.abl", "meta.function-call.abl", "meta.brace.round.js"] }, // ')'
|
|
31
|
+
{ "startIndex": 11, "endIndex": 12, "scopes": ["source.abl", "punctuation.terminator.abl"] } // '.'
|
|
32
|
+
]
|
|
33
|
+
];
|
|
34
|
+
shared.itShouldMatchExpectedScopes(statement, expectedTokens);
|
|
35
|
+
})
|
|
36
|
+
|