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.
- package/CHANGELOG.md +4 -0
- package/README.md +73 -39
- package/abl.tmLanguage.json +812 -580
- package/index.js +110 -71
- package/package.json +6 -6
- package/spec/annotations/annotation.spec.js +8 -2
- package/spec/array-extent/issue#5.spec.js +9 -9
- package/spec/blocks/block-labels.spec.js +3 -3
- package/spec/blocks/block-options.spec.js +18 -0
- package/spec/comments/comment-in-block-statement.spec.js +1 -1
- package/spec/comments/spacious-comment.spec.js +73 -0
- package/spec/create-widgets/create-window.spec.js +221 -0
- package/spec/db-table-and-field/create-alias.spec.js +101 -0
- package/spec/db-table-and-field/create-record.spec.js +43 -0
- package/spec/db-table-and-field/find-record.spec.js +91 -0
- package/spec/db-table-and-field/new-record.spec.js +137 -0
- package/spec/define/define-browse.spec.js +454 -0
- package/spec/define/define-query.spec.js +101 -0
- package/spec/define-variable/extent.spec.js +6 -6
- package/spec/define-variable/var-statement.spec.js +375 -0
- package/spec/include/include-file-name.spec.js +224 -0
- package/spec/include/vscode-abl-issue#77.spec.js +2 -2
- package/spec/input-output/input-from.spec.js +501 -0
- package/spec/input-output/output-to.spec.js +456 -0
- package/spec/method-attribute-property-call/get-set-method-name.spec.js +57 -12
- package/spec/method-attribute-property-call/method-call.spec.js +93 -0
- package/spec/method-definition/constructor.spec.js +4 -4
- package/spec/method-definition/method.spec.js +227 -6
- package/spec/misc-statements/array-for.spec.js +21 -0
- package/spec/misc-statements/class-in-var-name.spec.js +4 -4
- package/spec/misc-statements/guid.spec.js +97 -0
- package/spec/misc-statements/if-then.spec.js +118 -1
- package/spec/preprocesors/proparse-preprocessor.spec.js +66 -0
- package/spec/procedure-definition/vscode-abl-issue#26.spec.js +6 -6
- package/spec/run-statement/run-statement.spec.js +128 -3
- package/spec/type-name/argument.spec.js +10 -11
- package/spec/type-name/cast.spec.js +8 -10
- package/spec/type-name/define-variable.spec.js +28 -146
- package/spec/type-name/get-class.spec.js +18 -18
- package/spec/type-name/new.spec.js +70 -10
- package/spec/type-name/parameter-as.spec.js +66 -21
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
const { assert, expect } = require('chai');
|
|
2
|
+
const shared = require('../shared.js');
|
|
3
|
+
|
|
4
|
+
describe('', () => {
|
|
5
|
+
let statement = `if new ( customer) then message 'new'.`;
|
|
6
|
+
let expectedTokens = [
|
|
7
|
+
{ "startIndex": 0, "endIndex": 2, "scopes": ["source.abl", "keyword.other.abl"] }, // 'if'
|
|
8
|
+
{ "startIndex": 2, "endIndex": 3, "scopes": ["source.abl"] }, // ' '
|
|
9
|
+
{ "startIndex": 3, "endIndex": 6, "scopes": ["source.abl", "support.function.abl"] }, // 'new'
|
|
10
|
+
{ "startIndex": 6, "endIndex": 7, "scopes": ["source.abl"] }, // ' '
|
|
11
|
+
{ "startIndex": 7, "endIndex": 8, "scopes": ["source.abl", "meta.brace.round.js"] }, // '('
|
|
12
|
+
{ "startIndex": 8, "endIndex": 9, "scopes": ["source.abl"] }, // ' '
|
|
13
|
+
{ "startIndex": 9, "endIndex": 17, "scopes": ["source.abl", "storage.data.table.abl"] }, // 'customer'
|
|
14
|
+
{ "startIndex": 17, "endIndex": 18, "scopes": ["source.abl", "meta.brace.round.js"] }, // ')'
|
|
15
|
+
{ "startIndex": 18, "endIndex": 19, "scopes": ["source.abl"] }, // ' '
|
|
16
|
+
{ "startIndex": 19, "endIndex": 23, "scopes": ["source.abl", "keyword.other.abl"] }, // 'then'
|
|
17
|
+
{ "startIndex": 23, "endIndex": 24, "scopes": ["source.abl"] }, // ' '
|
|
18
|
+
{ "startIndex": 24, "endIndex": 31, "scopes": ["source.abl", "keyword.other.abl"] }, // 'message'
|
|
19
|
+
{ "startIndex": 31, "endIndex": 32, "scopes": ["source.abl"] }, // ' '
|
|
20
|
+
{ "startIndex": 32, "endIndex": 33, "scopes": ["source.abl", "string.single.complex.abl", "punctuation.definition.string.begin.abl"] }, // '''
|
|
21
|
+
{ "startIndex": 33, "endIndex": 36, "scopes": ["source.abl", "string.single.complex.abl"] }, // 'new'
|
|
22
|
+
{ "startIndex": 36, "endIndex": 37, "scopes": ["source.abl", "string.single.complex.abl", "punctuation.definition.string.end.abl"] }, // '''
|
|
23
|
+
{ "startIndex": 37, "endIndex": 38, "scopes": ["source.abl", "punctuation.terminator.abl"] } // '.'
|
|
24
|
+
];
|
|
25
|
+
shared.itShouldMatchExpectedScopes(statement, expectedTokens);
|
|
26
|
+
})
|
|
27
|
+
|
|
28
|
+
describe('', () => {
|
|
29
|
+
let statement = `if new customer then message 'new'.`;
|
|
30
|
+
let expectedTokens = [
|
|
31
|
+
{ "startIndex": 0, "endIndex": 2, "scopes": ["source.abl", "keyword.other.abl"] }, // 'if'
|
|
32
|
+
{ "startIndex": 2, "endIndex": 3, "scopes": ["source.abl"] }, // ' '
|
|
33
|
+
{ "startIndex": 3, "endIndex": 6, "scopes": ["source.abl", "support.function.abl"] }, // 'new'
|
|
34
|
+
{ "startIndex": 6, "endIndex": 7, "scopes": ["source.abl"] }, // ' '
|
|
35
|
+
{ "startIndex": 7, "endIndex": 15, "scopes": ["source.abl", "storage.data.table.abl"] }, // 'customer'
|
|
36
|
+
{ "startIndex": 15, "endIndex": 16, "scopes": ["source.abl"] }, // ' '
|
|
37
|
+
{ "startIndex": 16, "endIndex": 20, "scopes": ["source.abl", "keyword.other.abl"] }, // 'then'
|
|
38
|
+
{ "startIndex": 20, "endIndex": 21, "scopes": ["source.abl"] }, // ' '
|
|
39
|
+
{ "startIndex": 21, "endIndex": 28, "scopes": ["source.abl", "keyword.other.abl"] }, // 'message'
|
|
40
|
+
{ "startIndex": 28, "endIndex": 29, "scopes": ["source.abl"] }, // ' '
|
|
41
|
+
{ "startIndex": 29, "endIndex": 30, "scopes": ["source.abl", "string.single.complex.abl", "punctuation.definition.string.begin.abl"] }, // '''
|
|
42
|
+
{ "startIndex": 30, "endIndex": 33, "scopes": ["source.abl", "string.single.complex.abl"] }, // 'new'
|
|
43
|
+
{ "startIndex": 33, "endIndex": 34, "scopes": ["source.abl", "string.single.complex.abl", "punctuation.definition.string.end.abl"] }, // '''
|
|
44
|
+
{ "startIndex": 34, "endIndex": 35, "scopes": ["source.abl", "punctuation.terminator.abl"] } // '.'
|
|
45
|
+
];
|
|
46
|
+
shared.itShouldMatchExpectedScopes(statement, expectedTokens);
|
|
47
|
+
})
|
|
48
|
+
|
|
49
|
+
describe('', () => {
|
|
50
|
+
let statement = `if new ( s2k.customer) then message 'new'.`;
|
|
51
|
+
let expectedTokens = [
|
|
52
|
+
{ "startIndex": 0, "endIndex": 2, "scopes": ["source.abl", "keyword.other.abl"] }, // 'if'
|
|
53
|
+
{ "startIndex": 2, "endIndex": 3, "scopes": ["source.abl"] }, // ' '
|
|
54
|
+
{ "startIndex": 3, "endIndex": 6, "scopes": ["source.abl", "support.function.abl"] }, // 'new'
|
|
55
|
+
{ "startIndex": 6, "endIndex": 7, "scopes": ["source.abl"] }, // ' '
|
|
56
|
+
{ "startIndex": 7, "endIndex": 8, "scopes": ["source.abl", "meta.brace.round.js"] }, // '('
|
|
57
|
+
{ "startIndex": 8, "endIndex": 9, "scopes": ["source.abl"] }, // ' '
|
|
58
|
+
{ "startIndex": 9, "endIndex": 21, "scopes": ["source.abl", "storage.data.table.abl"] }, // 's2k.customer'
|
|
59
|
+
{ "startIndex": 21, "endIndex": 22, "scopes": ["source.abl", "meta.brace.round.js"] }, // ')'
|
|
60
|
+
{ "startIndex": 22, "endIndex": 23, "scopes": ["source.abl"] }, // ' '
|
|
61
|
+
{ "startIndex": 23, "endIndex": 27, "scopes": ["source.abl", "keyword.other.abl"] }, // 'then'
|
|
62
|
+
{ "startIndex": 27, "endIndex": 28, "scopes": ["source.abl"] }, // ' '
|
|
63
|
+
{ "startIndex": 28, "endIndex": 35, "scopes": ["source.abl", "keyword.other.abl"] }, // 'message'
|
|
64
|
+
{ "startIndex": 35, "endIndex": 36, "scopes": ["source.abl"] }, // ' '
|
|
65
|
+
{ "startIndex": 36, "endIndex": 37, "scopes": ["source.abl", "string.single.complex.abl", "punctuation.definition.string.begin.abl"] }, // '''
|
|
66
|
+
{ "startIndex": 37, "endIndex": 40, "scopes": ["source.abl", "string.single.complex.abl"] }, // 'new'
|
|
67
|
+
{ "startIndex": 40, "endIndex": 41, "scopes": ["source.abl", "string.single.complex.abl", "punctuation.definition.string.end.abl"] }, // '''
|
|
68
|
+
{ "startIndex": 41, "endIndex": 42, "scopes": ["source.abl", "punctuation.terminator.abl"] } // '.'
|
|
69
|
+
];
|
|
70
|
+
shared.itShouldMatchExpectedScopes(statement, expectedTokens);
|
|
71
|
+
})
|
|
72
|
+
|
|
73
|
+
describe('', () => {
|
|
74
|
+
let statement = `if new s2k.customer then message 'new'.`;
|
|
75
|
+
let expectedTokens = [
|
|
76
|
+
{ "startIndex": 0, "endIndex": 2, "scopes": ["source.abl", "keyword.other.abl"] }, // 'if'
|
|
77
|
+
{ "startIndex": 2, "endIndex": 3, "scopes": ["source.abl"] }, // ' '
|
|
78
|
+
{ "startIndex": 3, "endIndex": 6, "scopes": ["source.abl", "support.function.abl"] }, // 'new'
|
|
79
|
+
{ "startIndex": 6, "endIndex": 7, "scopes": ["source.abl"] }, // ' '
|
|
80
|
+
{ "startIndex": 7, "endIndex": 19, "scopes": ["source.abl", "storage.data.table.abl"] }, // 's2k.customer'
|
|
81
|
+
{ "startIndex": 19, "endIndex": 20, "scopes": ["source.abl"] }, // ' '
|
|
82
|
+
{ "startIndex": 20, "endIndex": 24, "scopes": ["source.abl", "keyword.other.abl"] }, // 'then'
|
|
83
|
+
{ "startIndex": 24, "endIndex": 25, "scopes": ["source.abl"] }, // ' '
|
|
84
|
+
{ "startIndex": 25, "endIndex": 32, "scopes": ["source.abl", "keyword.other.abl"] }, // 'message'
|
|
85
|
+
{ "startIndex": 32, "endIndex": 33, "scopes": ["source.abl"] }, // ' '
|
|
86
|
+
{ "startIndex": 33, "endIndex": 34, "scopes": ["source.abl", "string.single.complex.abl", "punctuation.definition.string.begin.abl"] }, // '''
|
|
87
|
+
{ "startIndex": 34, "endIndex": 37, "scopes": ["source.abl", "string.single.complex.abl"] }, // 'new'
|
|
88
|
+
{ "startIndex": 37, "endIndex": 38, "scopes": ["source.abl", "string.single.complex.abl", "punctuation.definition.string.end.abl"] }, // '''
|
|
89
|
+
{ "startIndex": 38, "endIndex": 39, "scopes": ["source.abl", "punctuation.terminator.abl"] } // '.'
|
|
90
|
+
];
|
|
91
|
+
shared.itShouldMatchExpectedScopes(statement, expectedTokens);
|
|
92
|
+
})
|
|
93
|
+
|
|
94
|
+
describe('', () => {
|
|
95
|
+
let statement = `if new ( _index-field) then message 'new'.`;
|
|
96
|
+
let expectedTokens = [
|
|
97
|
+
{ "startIndex": 0, "endIndex": 2, "scopes": ["source.abl", "keyword.other.abl"] }, // 'if'
|
|
98
|
+
{ "startIndex": 2, "endIndex": 3, "scopes": ["source.abl"] }, // ' '
|
|
99
|
+
{ "startIndex": 3, "endIndex": 6, "scopes": ["source.abl", "support.function.abl"] }, // 'new'
|
|
100
|
+
{ "startIndex": 6, "endIndex": 7, "scopes": ["source.abl"] }, // ' '
|
|
101
|
+
{ "startIndex": 7, "endIndex": 8, "scopes": ["source.abl", "meta.brace.round.js"] }, // '('
|
|
102
|
+
{ "startIndex": 8, "endIndex": 9, "scopes": ["source.abl"] }, // ' '
|
|
103
|
+
{ "startIndex": 9, "endIndex": 21, "scopes": ["source.abl", "storage.data.table.abl"] }, // '_index-field'
|
|
104
|
+
{ "startIndex": 21, "endIndex": 22, "scopes": ["source.abl", "meta.brace.round.js"] }, // ')'
|
|
105
|
+
{ "startIndex": 22, "endIndex": 23, "scopes": ["source.abl"] }, // ' '
|
|
106
|
+
{ "startIndex": 23, "endIndex": 27, "scopes": ["source.abl", "keyword.other.abl"] }, // 'then'
|
|
107
|
+
{ "startIndex": 27, "endIndex": 28, "scopes": ["source.abl"] }, // ' '
|
|
108
|
+
{ "startIndex": 28, "endIndex": 35, "scopes": ["source.abl", "keyword.other.abl"] }, // 'message'
|
|
109
|
+
{ "startIndex": 35, "endIndex": 36, "scopes": ["source.abl"] }, // ' '
|
|
110
|
+
{ "startIndex": 36, "endIndex": 37, "scopes": ["source.abl", "string.single.complex.abl", "punctuation.definition.string.begin.abl"] }, // '''
|
|
111
|
+
{ "startIndex": 37, "endIndex": 40, "scopes": ["source.abl", "string.single.complex.abl"] }, // 'new'
|
|
112
|
+
{ "startIndex": 40, "endIndex": 41, "scopes": ["source.abl", "string.single.complex.abl", "punctuation.definition.string.end.abl"] }, // '''
|
|
113
|
+
{ "startIndex": 41, "endIndex": 42, "scopes": ["source.abl", "punctuation.terminator.abl"] } // '.'
|
|
114
|
+
];
|
|
115
|
+
shared.itShouldMatchExpectedScopes(statement, expectedTokens);
|
|
116
|
+
})
|
|
117
|
+
|
|
118
|
+
describe('', () => {
|
|
119
|
+
let statement = `if new _field then message 'new'.`;
|
|
120
|
+
let expectedTokens = [
|
|
121
|
+
{ "startIndex": 0, "endIndex": 2, "scopes": ["source.abl", "keyword.other.abl"] }, // 'if'
|
|
122
|
+
{ "startIndex": 2, "endIndex": 3, "scopes": ["source.abl"] }, // ' '
|
|
123
|
+
{ "startIndex": 3, "endIndex": 6, "scopes": ["source.abl", "support.function.abl"] }, // 'new'
|
|
124
|
+
{ "startIndex": 6, "endIndex": 7, "scopes": ["source.abl"] }, // ' '
|
|
125
|
+
{ "startIndex": 7, "endIndex": 13, "scopes": ["source.abl", "storage.data.table.abl"] }, // '_field'
|
|
126
|
+
{ "startIndex": 13, "endIndex": 14, "scopes": ["source.abl"] }, // ' '
|
|
127
|
+
{ "startIndex": 14, "endIndex": 18, "scopes": ["source.abl", "keyword.other.abl"] }, // 'then'
|
|
128
|
+
{ "startIndex": 18, "endIndex": 19, "scopes": ["source.abl"] }, // ' '
|
|
129
|
+
{ "startIndex": 19, "endIndex": 26, "scopes": ["source.abl", "keyword.other.abl"] }, // 'message'
|
|
130
|
+
{ "startIndex": 26, "endIndex": 27, "scopes": ["source.abl"] }, // ' '
|
|
131
|
+
{ "startIndex": 27, "endIndex": 28, "scopes": ["source.abl", "string.single.complex.abl", "punctuation.definition.string.begin.abl"] }, // '''
|
|
132
|
+
{ "startIndex": 28, "endIndex": 31, "scopes": ["source.abl", "string.single.complex.abl"] }, // 'new'
|
|
133
|
+
{ "startIndex": 31, "endIndex": 32, "scopes": ["source.abl", "string.single.complex.abl", "punctuation.definition.string.end.abl"] }, // '''
|
|
134
|
+
{ "startIndex": 32, "endIndex": 33, "scopes": ["source.abl", "punctuation.terminator.abl"] } // '.'
|
|
135
|
+
];
|
|
136
|
+
shared.itShouldMatchExpectedScopes(statement, expectedTokens);
|
|
137
|
+
})
|