abl-tmlanguage 1.1.3 → 1.3.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 +54 -1
- package/abl.tmLanguage.json +3534 -230
- package/azure-pipelines.yml +3 -2
- package/package.json +7 -6
- package/spec/analyze-suspend-resume/analyze-suspend-resume.spec.js +10 -10
- package/spec/annotations/annotation.spec.js +232 -0
- package/spec/array-extent/issue#5.spec.js +18 -18
- package/spec/blocks/finally-blocks.spec.js +90 -0
- package/spec/blocks/on-quit.spec.js +59 -0
- package/spec/comments/vscode-abl-issue#127.spec.js +165 -0
- package/spec/db-table-and-field/fields-except.spec.js +69 -0
- package/spec/db-table-and-field/foreach.spec.js +588 -0
- package/spec/db-table-and-field/issue#88.spec.js +120 -0
- package/spec/define-buffer/create-buffer.spec.js +110 -0
- package/spec/define-buffer/simple-single-line.spec.js +138 -0
- package/spec/define-parameter/simple-single-line.spec.js +140 -100
- package/spec/define-stream/simple-single-line.spec.js +32 -31
- package/spec/define-temp-table/define-index.spec.js +138 -0
- 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 +168 -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 +224 -0
- package/spec/do/issue#3.spec.js +69 -60
- package/spec/function-call/nested-functions.spec.js +128 -0
- 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 +40 -57
- package/spec/include/vscode-abl-issue#45.spec.js +15 -15
- package/spec/include/vscode-abl-issue#77.spec.js +129 -0
- package/spec/include/vscode-abl-issue#80.spec.js +40 -27
- package/spec/method-attribute-property-call/abl-method-attribute-call.spec.js +99 -0
- package/spec/method-attribute-property-call/connected-method.spec.js +30 -0
- package/spec/method-attribute-property-call/get-set-method-name.spec.js +96 -0
- package/spec/method-attribute-property-call/method-call.spec.js +112 -0
- package/spec/method-definition/constructor.spec.js +174 -0
- package/spec/method-definition/method.spec.js +320 -0
- package/spec/misc-statements/case-statement.spec.js +96 -0
- package/spec/misc-statements/copy-lob.spec.js +137 -0
- package/spec/misc-statements/if-then.spec.js +170 -0
- package/spec/misc-statements/return-statement.spec.js +53 -0
- package/spec/operators/operators.spec.js +78 -0
- package/spec/procedure-definition/empty-proc.spec.js +101 -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/run-statement/run-statement.spec.js +162 -0
- package/spec/shared.js +84 -42
- package/spec/strings/translation-attribute.spec.js +52 -0
- 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 +468 -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 +879 -0
- package/spec/type-name/using.spec.js +115 -0
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
const { assert, expect } = require('chai');
|
|
2
|
+
const shared = require('../shared.js');
|
|
3
|
+
|
|
4
|
+
describe('', () => {
|
|
5
|
+
let statement = `// Per https://tools.ietf.org/html/rfc2817 section 5.3, any 2xx status code is good
|
|
6
|
+
if (200 <= connectResponse:StatusCode and connectResponse:StatusCode < 300) then
|
|
7
|
+
do on error undo, throw:
|
|
8
|
+
// On success, we need to tell the socket connection to upgrade to TLS
|
|
9
|
+
moSocketLib:StartTls(baseRequest:URI:Host).
|
|
10
|
+
|
|
11
|
+
catch sockErr as Progress.Lang.Error:
|
|
12
|
+
Logger:Error(substitute('Unable to create HTTP tunnel to &1', baseRequest:URI:ToString()),
|
|
13
|
+
sockErr).
|
|
14
|
+
undo, throw sockErr.
|
|
15
|
+
end catch.
|
|
16
|
+
end.`;
|
|
17
|
+
let expectedTokens = [
|
|
18
|
+
[
|
|
19
|
+
{ "startIndex": 0, "endIndex": 83, "scopes": ["source.abl", "comment.line.double-slash.abl"] }, // '// Per https://tools.ietf.org/html/rfc2817 section 5.3, any 2xx status code is good'
|
|
20
|
+
],
|
|
21
|
+
[
|
|
22
|
+
{ "startIndex": 0, "endIndex": 2, "scopes": ["source.abl"] }, // ' '
|
|
23
|
+
{ "startIndex": 2, "endIndex": 4, "scopes": ["source.abl", "keyword.other.abl"] }, // 'if'
|
|
24
|
+
{ "startIndex": 4, "endIndex": 5, "scopes": ["source.abl"] }, // ' '
|
|
25
|
+
{ "startIndex": 5, "endIndex": 6, "scopes": ["source.abl", "meta.brace.round.js"] }, // '('
|
|
26
|
+
{ "startIndex": 6, "endIndex": 9, "scopes": ["source.abl", "constant.numeric.source.abl"] }, // '200'
|
|
27
|
+
{ "startIndex": 9, "endIndex": 10, "scopes": ["source.abl"] }, // ' '
|
|
28
|
+
{ "startIndex": 10, "endIndex": 12, "scopes": ["source.abl", "keyword.operator.source.abl"] }, // '<='
|
|
29
|
+
{ "startIndex": 12, "endIndex": 13, "scopes": ["source.abl"] }, // ' '
|
|
30
|
+
{ "startIndex": 13, "endIndex": 28, "scopes": ["source.abl", "variable.other.abl"] }, // 'connectResponse'
|
|
31
|
+
{ "startIndex": 28, "endIndex": 29, "scopes": ["source.abl", "punctuation.separator.colon.abl"] }, // ':'
|
|
32
|
+
{ "startIndex": 29, "endIndex": 39, "scopes": ["source.abl", "entity.name.function.abl"] }, // 'StatusCode'
|
|
33
|
+
{ "startIndex": 39, "endIndex": 40, "scopes": ["source.abl"] }, // ' '
|
|
34
|
+
{ "startIndex": 40, "endIndex": 43, "scopes": ["source.abl", "keyword.other.abl"] }, // 'and'
|
|
35
|
+
{ "startIndex": 43, "endIndex": 44, "scopes": ["source.abl"] }, // ' '
|
|
36
|
+
{ "startIndex": 44, "endIndex": 59, "scopes": ["source.abl", "variable.other.abl"] }, // 'connectResponse'
|
|
37
|
+
{ "startIndex": 59, "endIndex": 60, "scopes": ["source.abl", "punctuation.separator.colon.abl"] }, // ':'
|
|
38
|
+
{ "startIndex": 60, "endIndex": 70, "scopes": ["source.abl", "entity.name.function.abl"] }, // 'StatusCode'
|
|
39
|
+
{ "startIndex": 70, "endIndex": 71, "scopes": ["source.abl"] }, // ' '
|
|
40
|
+
{ "startIndex": 71, "endIndex": 72, "scopes": ["source.abl", "keyword.operator.source.abl"] }, // '<'
|
|
41
|
+
{ "startIndex": 72, "endIndex": 73, "scopes": ["source.abl"] }, // ' '
|
|
42
|
+
{ "startIndex": 73, "endIndex": 76, "scopes": ["source.abl", "constant.numeric.source.abl"] }, // '300'
|
|
43
|
+
{ "startIndex": 76, "endIndex": 77, "scopes": ["source.abl", "meta.brace.round.js"] }, // ')'
|
|
44
|
+
{ "startIndex": 77, "endIndex": 78, "scopes": ["source.abl"] }, // ' '
|
|
45
|
+
{ "startIndex": 78, "endIndex": 82, "scopes": ["source.abl", "keyword.other.abl"] } // 'then'
|
|
46
|
+
],
|
|
47
|
+
[
|
|
48
|
+
{ "startIndex": 0, "endIndex": 2, "scopes": ["source.abl", "meta.block.abl"] }, // ' '
|
|
49
|
+
{ "startIndex": 2, "endIndex": 4, "scopes": ["source.abl", "meta.block.abl", "keyword.other.abl"] }, // 'do'
|
|
50
|
+
{ "startIndex": 4, "endIndex": 5, "scopes": ["source.abl", "meta.block.abl"] }, // ' '
|
|
51
|
+
{ "startIndex": 5, "endIndex": 7, "scopes": ["source.abl", "meta.block.abl", "meta.block.branch.abl", "keyword.other.abl"] }, // 'on'
|
|
52
|
+
{ "startIndex": 7, "endIndex": 8, "scopes": ["source.abl", "meta.block.abl", "meta.block.branch.abl"] }, // ' '
|
|
53
|
+
{ "startIndex": 8, "endIndex": 13, "scopes": ["source.abl", "meta.block.abl", "meta.block.branch.abl", "keyword.other.abl"] }, // 'error'
|
|
54
|
+
{ "startIndex": 13, "endIndex": 14, "scopes": ["source.abl", "meta.block.abl", "meta.block.branch.abl"] }, // ' '
|
|
55
|
+
{ "startIndex": 14, "endIndex": 18, "scopes": ["source.abl", "meta.block.abl", "meta.block.branch.abl", "keyword.other.abl"] }, // 'undo'
|
|
56
|
+
{ "startIndex": 18, "endIndex": 19, "scopes": ["source.abl", "meta.block.abl", "punctuation.separator.comma.abl"] }, // ','
|
|
57
|
+
{ "startIndex": 19, "endIndex": 20, "scopes": ["source.abl", "meta.block.abl", "meta.block.branch.abl"] }, // ' '
|
|
58
|
+
{ "startIndex": 20, "endIndex": 25, "scopes": ["source.abl", "meta.block.abl", "meta.block.branch.abl", "keyword.other.abl"] }, // 'throw'
|
|
59
|
+
{ "startIndex": 25, "endIndex": 26, "scopes": ["source.abl", "punctuation.terminator.abl"] } // ':'
|
|
60
|
+
],
|
|
61
|
+
[
|
|
62
|
+
{ "startIndex": 0, "endIndex": 6, "scopes": ["source.abl"] }, // ' '
|
|
63
|
+
{ "startIndex": 6, "endIndex": 76, "scopes": ["source.abl", "comment.line.double-slash.abl"] } // '// On success, we need to tell the socket connection to upgrade to TLS'
|
|
64
|
+
],
|
|
65
|
+
[
|
|
66
|
+
{ "startIndex": 0, "endIndex": 6, "scopes": ["source.abl"] }, // ' '
|
|
67
|
+
{ "startIndex": 6, "endIndex": 17, "scopes": ["source.abl", "variable.other.abl"] }, // 'moSocketLib'
|
|
68
|
+
{ "startIndex": 17, "endIndex": 18, "scopes": ["source.abl", "punctuation.separator.colon.abl"] }, // ':'
|
|
69
|
+
{ "startIndex": 18, "endIndex": 26, "scopes": ["source.abl", "entity.name.function.abl"] }, // 'StartTls'
|
|
70
|
+
{ "startIndex": 26, "endIndex": 27, "scopes": ["source.abl", "meta.function.arguments.abl", "meta.brace.round.js"] }, // '('
|
|
71
|
+
{ "startIndex": 27, "endIndex": 38, "scopes": ["source.abl", "meta.function.arguments.abl", "variable.other.abl"] }, // 'baseRequest'
|
|
72
|
+
{ "startIndex": 38, "endIndex": 39, "scopes": ["source.abl", "meta.function.arguments.abl", "punctuation.separator.colon.abl"] }, // ':'
|
|
73
|
+
{ "startIndex": 39, "endIndex": 42, "scopes": ["source.abl", "meta.function.arguments.abl", "entity.name.function.abl"] }, // 'URI'
|
|
74
|
+
{ "startIndex": 42, "endIndex": 43, "scopes": ["source.abl", "meta.function.arguments.abl", "punctuation.separator.colon.abl"] }, // ':'
|
|
75
|
+
{ "startIndex": 43, "endIndex": 47, "scopes": ["source.abl", "meta.function.arguments.abl", "entity.name.function.abl"] }, // 'Host'
|
|
76
|
+
{ "startIndex": 47, "endIndex": 48, "scopes": ["source.abl", "meta.brace.round.js"] }, // ')'
|
|
77
|
+
{ "startIndex": 48, "endIndex": 49, "scopes": ["source.abl", "punctuation.terminator.abl"] } // '.'
|
|
78
|
+
],
|
|
79
|
+
[
|
|
80
|
+
{ "startIndex": 0, "endIndex": 1, "scopes": ["source.abl"] } // ''
|
|
81
|
+
],
|
|
82
|
+
[
|
|
83
|
+
{ "startIndex": 0, "endIndex": 6, "scopes": ["source.abl"] }, // ' '
|
|
84
|
+
{ "startIndex": 6, "endIndex": 11, "scopes": ["source.abl", "keyword.other.abl"] }, // 'catch'
|
|
85
|
+
{ "startIndex": 11, "endIndex": 12, "scopes": ["source.abl"] }, // ' '
|
|
86
|
+
{ "startIndex": 12, "endIndex": 19, "scopes": ["source.abl", "variable.parameter.abl"] }, // 'sockErr'
|
|
87
|
+
{ "startIndex": 19, "endIndex": 20, "scopes": ["source.abl"] }, // ' '
|
|
88
|
+
{ "startIndex": 20, "endIndex": 22, "scopes": ["source.abl", "keyword.other.abl"] }, // 'as'
|
|
89
|
+
{ "startIndex": 22, "endIndex": 23, "scopes": ["source.abl"] }, // ' '
|
|
90
|
+
{ "startIndex": 23, "endIndex": 42, "scopes": ["source.abl", "entity.name.type.abl"] }, // 'Progress.Lang.Error'
|
|
91
|
+
{ "startIndex": 42, "endIndex": 43, "scopes": ["source.abl"] } // ':'
|
|
92
|
+
],
|
|
93
|
+
[
|
|
94
|
+
{ "startIndex": 0, "endIndex": 10, "scopes": ["source.abl"] }, // ' '
|
|
95
|
+
{ "startIndex": 10, "endIndex": 16, "scopes": ["source.abl", "variable.other.abl"] }, // 'Logger'
|
|
96
|
+
{ "startIndex": 16, "endIndex": 17, "scopes": ["source.abl", "punctuation.separator.colon.abl"] }, // ':'
|
|
97
|
+
{ "startIndex": 17, "endIndex": 22, "scopes": ["source.abl", "entity.name.function.abl"] }, // 'Error'
|
|
98
|
+
{ "startIndex": 22, "endIndex": 23, "scopes": ["source.abl", "meta.function.arguments.abl", "meta.brace.round.js"] }, // '('
|
|
99
|
+
{ "startIndex": 23, "endIndex": 33, "scopes": ["source.abl", "meta.function.arguments.abl", "meta.function-call.abl", "support.function.abl"] }, // 'substitute'
|
|
100
|
+
{ "startIndex": 33, "endIndex": 34, "scopes": ["source.abl", "meta.function.arguments.abl", "meta.function-call.abl", "meta.function.arguments.abl", "meta.brace.round.js"] }, // '('
|
|
101
|
+
{ "startIndex": 34, "endIndex": 35, "scopes": ["source.abl", "meta.function.arguments.abl", "meta.function-call.abl", "meta.function.arguments.abl", "string.single.complex.abl", "punctuation.definition.string.begin.abl"] }, // '''
|
|
102
|
+
{ "startIndex": 35, "endIndex": 69, "scopes": ["source.abl", "meta.function.arguments.abl", "meta.function-call.abl", "meta.function.arguments.abl", "string.single.complex.abl"] }, // 'Unable to create HTTP tunnel to &1'
|
|
103
|
+
{ "startIndex": 69, "endIndex": 70, "scopes": ["source.abl", "meta.function.arguments.abl", "meta.function-call.abl", "meta.function.arguments.abl", "string.single.complex.abl", "punctuation.definition.string.end.abl"] }, // '''
|
|
104
|
+
{ "startIndex": 70, "endIndex": 71, "scopes": ["source.abl", "meta.function.arguments.abl", "meta.function-call.abl", "meta.function.arguments.abl", "punctuation.separator.comma.abl"] }, // ','
|
|
105
|
+
{ "startIndex": 71, "endIndex": 72, "scopes": ["source.abl", "meta.function.arguments.abl", "meta.function-call.abl", "meta.function.arguments.abl"] }, // ' '
|
|
106
|
+
{ "startIndex": 72, "endIndex": 83, "scopes": ["source.abl", "meta.function.arguments.abl", "meta.function-call.abl", "meta.function.arguments.abl", "variable.other.abl"] }, // 'baseRequest'
|
|
107
|
+
{ "startIndex": 83, "endIndex": 84, "scopes": ["source.abl", "meta.function.arguments.abl", "meta.function-call.abl", "meta.function.arguments.abl", "punctuation.separator.colon.abl"] }, // ':'
|
|
108
|
+
{ "startIndex": 84, "endIndex": 87, "scopes": ["source.abl", "meta.function.arguments.abl", "meta.function-call.abl", "meta.function.arguments.abl", "entity.name.function.abl"] }, // 'URI'
|
|
109
|
+
{ "startIndex": 87, "endIndex": 88, "scopes": ["source.abl", "meta.function.arguments.abl", "meta.function-call.abl", "meta.function.arguments.abl", "punctuation.separator.colon.abl"] }, // ':'
|
|
110
|
+
{ "startIndex": 88, "endIndex": 96, "scopes": ["source.abl", "meta.function.arguments.abl", "meta.function-call.abl", "meta.function.arguments.abl", "entity.name.function.abl"] }, // 'ToString'
|
|
111
|
+
{ "startIndex": 96, "endIndex": 97, "scopes": ["source.abl", "meta.function.arguments.abl", "meta.function-call.abl", "meta.function.arguments.abl", "meta.brace.round.js"] }, // '('
|
|
112
|
+
{ "startIndex": 97, "endIndex": 98, "scopes": ["source.abl", "meta.function.arguments.abl", "meta.function-call.abl", "meta.brace.round.js"] }, // ')'
|
|
113
|
+
{ "startIndex": 98, "endIndex": 99, "scopes": ["source.abl", "meta.brace.round.js"] }, // ')'
|
|
114
|
+
{ "startIndex": 99, "endIndex": 100, "scopes": ["source.abl", "punctuation.separator.comma.abl"] } // ','
|
|
115
|
+
],
|
|
116
|
+
[
|
|
117
|
+
{ "startIndex": 0, "endIndex": 24, "scopes": ["source.abl"] }, // ' '
|
|
118
|
+
{ "startIndex": 24, "endIndex": 31, "scopes": ["source.abl", "variable.other.abl"] }, // 'sockErr'
|
|
119
|
+
{ "startIndex": 31, "endIndex": 32, "scopes": ["source.abl", "meta.brace.round.js"] }, // ')'
|
|
120
|
+
{ "startIndex": 32, "endIndex": 33, "scopes": ["source.abl", "punctuation.terminator.abl"] } // '.'
|
|
121
|
+
],
|
|
122
|
+
[
|
|
123
|
+
{ "startIndex": 0, "endIndex": 10, "scopes": ["source.abl"] }, // ' '
|
|
124
|
+
{ "startIndex": 10, "endIndex": 14, "scopes": ["source.abl", "keyword.other.abl"] }, // 'undo'
|
|
125
|
+
{ "startIndex": 14, "endIndex": 15, "scopes": ["source.abl", "punctuation.separator.comma.abl"] }, // ','
|
|
126
|
+
{ "startIndex": 15, "endIndex": 16, "scopes": ["source.abl"] }, // ' '
|
|
127
|
+
{ "startIndex": 16, "endIndex": 21, "scopes": ["source.abl", "keyword.other.abl"] }, // 'throw'
|
|
128
|
+
{ "startIndex": 21, "endIndex": 22, "scopes": ["source.abl"] }, // ' '
|
|
129
|
+
{ "startIndex": 22, "endIndex": 29, "scopes": ["source.abl", "variable.other.abl"] }, // 'sockErr'
|
|
130
|
+
{ "startIndex": 29, "endIndex": 30, "scopes": ["source.abl", "punctuation.terminator.abl"] } // '.'
|
|
131
|
+
],
|
|
132
|
+
[
|
|
133
|
+
{ "startIndex": 0, "endIndex": 6, "scopes": ["source.abl"] }, // ' '
|
|
134
|
+
{ "startIndex": 6, "endIndex": 9, "scopes": ["source.abl", "keyword.other.abl"] }, // 'end'
|
|
135
|
+
{ "startIndex": 9, "endIndex": 10, "scopes": ["source.abl"] }, // ' '
|
|
136
|
+
{ "startIndex": 10, "endIndex": 15, "scopes": ["source.abl", "keyword.other.abl"] }, // 'catch'
|
|
137
|
+
{ "startIndex": 15, "endIndex": 16, "scopes": ["source.abl", "punctuation.terminator.abl"] } // '.'
|
|
138
|
+
],
|
|
139
|
+
[
|
|
140
|
+
{ "startIndex": 0, "endIndex": 2, "scopes": ["source.abl"] }, // ' '
|
|
141
|
+
{ "startIndex": 2, "endIndex": 5, "scopes": ["source.abl", "keyword.other.abl"] }, // 'end'
|
|
142
|
+
{ "startIndex": 5, "endIndex": 6, "scopes": ["source.abl", "punctuation.terminator.abl"] } // '.'
|
|
143
|
+
]
|
|
144
|
+
];
|
|
145
|
+
shared.itShouldMatchExpectedScopes(statement, expectedTokens);
|
|
146
|
+
})
|
|
147
|
+
|
|
148
|
+
describe('', () => {
|
|
149
|
+
let statement = `if string(1) = "1" then .`;
|
|
150
|
+
let expectedTokens = [
|
|
151
|
+
{ "startIndex": 0, "endIndex": 2, "scopes": ["source.abl", "keyword.other.abl"] }, // 'if'
|
|
152
|
+
{ "startIndex": 2, "endIndex": 3, "scopes": ["source.abl"] }, // ' '
|
|
153
|
+
{ "startIndex": 3, "endIndex": 9, "scopes": ["source.abl", "meta.function-call.abl", "support.function.abl"] }, // 'string'
|
|
154
|
+
{ "startIndex": 9, "endIndex": 10, "scopes": ["source.abl", "meta.function-call.abl", "meta.function.arguments.abl", "meta.brace.round.js"] }, // '('
|
|
155
|
+
{ "startIndex": 10, "endIndex": 11, "scopes": ["source.abl", "meta.function-call.abl", "meta.function.arguments.abl", "constant.numeric.source.abl"] }, // '1'
|
|
156
|
+
{ "startIndex": 11, "endIndex": 12, "scopes": ["source.abl", "meta.function-call.abl", "meta.brace.round.js"] }, // ')'
|
|
157
|
+
{ "startIndex": 12, "endIndex": 13, "scopes": ["source.abl"] }, // ' '
|
|
158
|
+
{ "startIndex": 13, "endIndex": 14, "scopes": ["source.abl", "keyword.operator.source.abl"] }, // '='
|
|
159
|
+
{ "startIndex": 14, "endIndex": 15, "scopes": ["source.abl"] }, // ' '
|
|
160
|
+
{ "startIndex": 15, "endIndex": 16, "scopes": ["source.abl", "string.double.complex.abl", "punctuation.definition.string.begin.abl"] }, // '"'
|
|
161
|
+
{ "startIndex": 16, "endIndex": 17, "scopes": ["source.abl", "string.double.complex.abl"] }, // '1'
|
|
162
|
+
{ "startIndex": 17, "endIndex": 18, "scopes": ["source.abl", "string.double.complex.abl", "punctuation.definition.string.end.abl"] }, // '"'
|
|
163
|
+
{ "startIndex": 18, "endIndex": 19, "scopes": ["source.abl"] }, // ' '
|
|
164
|
+
{ "startIndex": 19, "endIndex": 23, "scopes": ["source.abl", "keyword.other.abl"] }, // 'then'
|
|
165
|
+
{ "startIndex": 23, "endIndex": 24, "scopes": ["source.abl"] }, // ' '
|
|
166
|
+
{ "startIndex": 24, "endIndex": 25, "scopes": ["source.abl", "punctuation.terminator.abl"] } // '.'
|
|
167
|
+
];
|
|
168
|
+
shared.itShouldMatchExpectedScopes(statement, expectedTokens);
|
|
169
|
+
})
|
|
170
|
+
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
const { assert, expect } = require('chai');
|
|
2
|
+
const shared = require('../shared.js');
|
|
3
|
+
|
|
4
|
+
describe('', () => {
|
|
5
|
+
let statement = `return(true).`;
|
|
6
|
+
let expectedTokens = [
|
|
7
|
+
{ "startIndex": 0, "endIndex": 6, "scopes": ["source.abl", "keyword.other.abl"] }, // 'return'
|
|
8
|
+
{ "startIndex": 6, "endIndex": 7, "scopes": ["source.abl", "meta.function.arguments.abl", "meta.brace.round.js"] }, // '('
|
|
9
|
+
{ "startIndex": 7, "endIndex": 11, "scopes": ["source.abl", "meta.function.arguments.abl", "constant.language.abl"] }, // 'true'
|
|
10
|
+
{ "startIndex": 11, "endIndex": 12, "scopes": ["source.abl", "meta.brace.round.js"] }, // ')'
|
|
11
|
+
{ "startIndex": 12, "endIndex": 13, "scopes": ["source.abl", "punctuation.terminator.abl"] } // '.'
|
|
12
|
+
];
|
|
13
|
+
shared.itShouldMatchExpectedScopes(statement, expectedTokens);
|
|
14
|
+
})
|
|
15
|
+
|
|
16
|
+
describe('', () => {
|
|
17
|
+
let statement = `return(string(1)).`;
|
|
18
|
+
let expectedTokens = [
|
|
19
|
+
{ "startIndex": 0, "endIndex": 6, "scopes": ["source.abl", "keyword.other.abl"] }, // 'return'
|
|
20
|
+
{ "startIndex": 6, "endIndex": 7, "scopes": ["source.abl", "meta.function.arguments.abl", "meta.brace.round.js"] }, // '('
|
|
21
|
+
{ "startIndex": 7, "endIndex": 13, "scopes": ["source.abl", "meta.function.arguments.abl", "meta.function-call.abl", "support.function.abl"] }, // 'string'
|
|
22
|
+
{ "startIndex": 13, "endIndex": 14, "scopes": ["source.abl", "meta.function.arguments.abl", "meta.function-call.abl", "meta.function.arguments.abl", "meta.brace.round.js"] }, // '('
|
|
23
|
+
{ "startIndex": 14, "endIndex": 15, "scopes": ["source.abl", "meta.function.arguments.abl", "meta.function-call.abl", "meta.function.arguments.abl", "constant.numeric.source.abl"] }, // '1'
|
|
24
|
+
{ "startIndex": 15, "endIndex": 16, "scopes": ["source.abl", "meta.function.arguments.abl", "meta.function-call.abl", "meta.brace.round.js"] }, // ')'
|
|
25
|
+
{ "startIndex": 16, "endIndex": 17, "scopes": ["source.abl", "meta.brace.round.js"] }, // ')'
|
|
26
|
+
{ "startIndex": 17, "endIndex": 18, "scopes": ["source.abl", "punctuation.terminator.abl"] } // '.'
|
|
27
|
+
];
|
|
28
|
+
shared.itShouldMatchExpectedScopes(statement, expectedTokens);
|
|
29
|
+
})
|
|
30
|
+
|
|
31
|
+
describe('', () => {
|
|
32
|
+
let statement = `RETURN iValue.`;
|
|
33
|
+
let expectedTokens = [
|
|
34
|
+
{ "startIndex": 0, "endIndex": 6, "scopes": ["source.abl", "keyword.other.abl"] }, // 'RETURN'
|
|
35
|
+
{ "startIndex": 6, "endIndex": 7, "scopes": ["source.abl"] }, // ' '
|
|
36
|
+
{ "startIndex": 7, "endIndex": 13, "scopes": ["source.abl", "variable.other.abl"] }, // 'iValue'
|
|
37
|
+
{ "startIndex": 13, "endIndex": 14, "scopes": ["source.abl", "punctuation.terminator.abl"] } // '.'
|
|
38
|
+
];
|
|
39
|
+
shared.itShouldMatchExpectedScopes(statement, expectedTokens);
|
|
40
|
+
})
|
|
41
|
+
|
|
42
|
+
describe('', () => {
|
|
43
|
+
let statement = `RETURN session:exit-code.`;
|
|
44
|
+
let expectedTokens = [
|
|
45
|
+
{ "startIndex": 0, "endIndex": 6, "scopes": ["source.abl", "keyword.other.abl"] }, // 'RETURN'
|
|
46
|
+
{ "startIndex": 6, "endIndex": 7, "scopes": ["source.abl"] }, // ' '
|
|
47
|
+
{ "startIndex": 7, "endIndex": 14, "scopes": ["source.abl", "variable.language.abl"] }, // 'session'
|
|
48
|
+
{ "startIndex": 14, "endIndex": 15, "scopes": ["source.abl", "punctuation.separator.colon.abl"] }, // ':'
|
|
49
|
+
{ "startIndex": 15, "endIndex": 24, "scopes": ["source.abl", "entity.name.function.abl"] }, // 'exit-code'
|
|
50
|
+
{ "startIndex": 24, "endIndex": 25, "scopes": ["source.abl", "punctuation.terminator.abl"] } // '.'
|
|
51
|
+
];
|
|
52
|
+
shared.itShouldMatchExpectedScopes(statement, expectedTokens);
|
|
53
|
+
})
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
const { assert, expect } = require('chai');
|
|
2
|
+
const shared = require('../shared.js');
|
|
3
|
+
|
|
4
|
+
describe('', () => {
|
|
5
|
+
let statement = `dValue = 12 * 24.`;
|
|
6
|
+
let expectedTokens = [
|
|
7
|
+
{ "startIndex": 0, "endIndex": 6, "scopes": ["source.abl", "variable.other.abl"] }, // 'dValue'
|
|
8
|
+
{ "startIndex": 6, "endIndex": 7, "scopes": ["source.abl"] }, // ' '
|
|
9
|
+
{ "startIndex": 7, "endIndex": 8, "scopes": ["source.abl", "keyword.operator.source.abl"] }, // '='
|
|
10
|
+
{ "startIndex": 8, "endIndex": 9, "scopes": ["source.abl"] }, // ' '
|
|
11
|
+
{ "startIndex": 9, "endIndex": 11, "scopes": ["source.abl", "constant.numeric.source.abl"] }, // '12'
|
|
12
|
+
{ "startIndex": 11, "endIndex": 12, "scopes": ["source.abl"] }, // ' '
|
|
13
|
+
{ "startIndex": 12, "endIndex": 13, "scopes": ["source.abl", "keyword.operator.source.abl"] }, // '*'
|
|
14
|
+
{ "startIndex": 13, "endIndex": 14, "scopes": ["source.abl"] }, // ' '
|
|
15
|
+
{ "startIndex": 14, "endIndex": 16, "scopes": ["source.abl", "constant.numeric.source.abl"] }, // '24'
|
|
16
|
+
{ "startIndex": 16, "endIndex": 17, "scopes": ["source.abl", "punctuation.terminator.abl"] } // '.'
|
|
17
|
+
];
|
|
18
|
+
shared.itShouldMatchExpectedScopes(statement, expectedTokens);
|
|
19
|
+
})
|
|
20
|
+
|
|
21
|
+
describe('', () => {
|
|
22
|
+
let statement = `dValue = today * 24.`;
|
|
23
|
+
let expectedTokens = [
|
|
24
|
+
{ "startIndex": 0, "endIndex": 6, "scopes": ["source.abl", "variable.other.abl"] }, // 'dValue'
|
|
25
|
+
{ "startIndex": 6, "endIndex": 7, "scopes": ["source.abl"] }, // ' '
|
|
26
|
+
{ "startIndex": 7, "endIndex": 8, "scopes": ["source.abl", "keyword.operator.source.abl"] }, // '='
|
|
27
|
+
{ "startIndex": 8, "endIndex": 9, "scopes": ["source.abl"] }, // ' '
|
|
28
|
+
{ "startIndex": 9, "endIndex": 14, "scopes": ["source.abl", "constant.language.abl"] }, // 'today'
|
|
29
|
+
{ "startIndex": 14, "endIndex": 15, "scopes": ["source.abl"] }, // ' '
|
|
30
|
+
{ "startIndex": 15, "endIndex": 16, "scopes": ["source.abl", "keyword.operator.source.abl"] }, // '*'
|
|
31
|
+
{ "startIndex": 16, "endIndex": 17, "scopes": ["source.abl"] }, // ' '
|
|
32
|
+
{ "startIndex": 17, "endIndex": 19, "scopes": ["source.abl", "constant.numeric.source.abl"] }, // '24'
|
|
33
|
+
{ "startIndex": 19, "endIndex": 20, "scopes": ["source.abl", "punctuation.terminator.abl"] } // '.'
|
|
34
|
+
];
|
|
35
|
+
shared.itShouldMatchExpectedScopes(statement, expectedTokens);
|
|
36
|
+
})
|
|
37
|
+
|
|
38
|
+
describe('', () => {
|
|
39
|
+
let statement = `dValue *= 24.`;
|
|
40
|
+
let expectedTokens = [
|
|
41
|
+
{ "startIndex": 0, "endIndex": 6, "scopes": ["source.abl", "variable.other.abl"] }, // 'dValue'
|
|
42
|
+
{ "startIndex": 6, "endIndex": 7, "scopes": ["source.abl"] }, // ' '
|
|
43
|
+
{ "startIndex": 7, "endIndex": 9, "scopes": ["source.abl", "keyword.operator.source.abl"] }, // '*='
|
|
44
|
+
{ "startIndex": 9, "endIndex": 10, "scopes": ["source.abl"] }, // ' '
|
|
45
|
+
{ "startIndex": 10, "endIndex": 12, "scopes": ["source.abl", "constant.numeric.source.abl"] }, // '24'
|
|
46
|
+
{ "startIndex": 12, "endIndex": 13, "scopes": ["source.abl", "punctuation.terminator.abl"] } // '.'
|
|
47
|
+
];
|
|
48
|
+
shared.itShouldMatchExpectedScopes(statement, expectedTokens);
|
|
49
|
+
})
|
|
50
|
+
|
|
51
|
+
describe('', () => {
|
|
52
|
+
let statement = `dValue \\= 24.`;
|
|
53
|
+
let expectedTokens = [
|
|
54
|
+
{ "startIndex": 0, "endIndex": 6, "scopes": ["source.abl", "variable.other.abl"] }, // 'dValue'
|
|
55
|
+
{ "startIndex": 6, "endIndex": 7, "scopes": ["source.abl"] }, // ' '
|
|
56
|
+
{ "startIndex": 7, "endIndex": 9, "scopes": ["source.abl", "keyword.operator.source.abl"] }, // '\='
|
|
57
|
+
{ "startIndex": 9, "endIndex": 10, "scopes": ["source.abl"] }, // ' '
|
|
58
|
+
{ "startIndex": 10, "endIndex": 12, "scopes": ["source.abl", "constant.numeric.source.abl"] }, // '24'
|
|
59
|
+
{ "startIndex": 12, "endIndex": 13, "scopes": ["source.abl", "punctuation.terminator.abl"] } // '.'
|
|
60
|
+
];
|
|
61
|
+
shared.itShouldMatchExpectedScopes(statement, expectedTokens);
|
|
62
|
+
})
|
|
63
|
+
|
|
64
|
+
describe('', () => {
|
|
65
|
+
let statement = `dValue += "thing":u.`;
|
|
66
|
+
let expectedTokens = [
|
|
67
|
+
{ "startIndex": 0, "endIndex": 6, "scopes": ["source.abl", "variable.other.abl"] }, // 'dValue'
|
|
68
|
+
{ "startIndex": 6, "endIndex": 7, "scopes": ["source.abl"] }, // ' '
|
|
69
|
+
{ "startIndex": 7, "endIndex": 9, "scopes": ["source.abl", "keyword.operator.source.abl"] }, // '+='
|
|
70
|
+
{ "startIndex": 9, "endIndex": 10, "scopes": ["source.abl"] }, // ' '
|
|
71
|
+
{ "startIndex": 10, "endIndex": 11, "scopes": ["source.abl", "string.double.complex.abl", "punctuation.definition.string.begin.abl"] }, // '"'
|
|
72
|
+
{ "startIndex": 11, "endIndex": 16, "scopes": ["source.abl", "string.double.complex.abl"] }, // 'thing'
|
|
73
|
+
{ "startIndex": 16, "endIndex": 17, "scopes": ["source.abl", "string.double.complex.abl", "punctuation.definition.string.end.abl"] }, // '"'
|
|
74
|
+
{ "startIndex": 17, "endIndex": 19, "scopes": ["source.abl", "support.other.abl"] }, // ':u'
|
|
75
|
+
{ "startIndex": 19, "endIndex": 20, "scopes": ["source.abl", "punctuation.terminator.abl"] } // '.'
|
|
76
|
+
];
|
|
77
|
+
shared.itShouldMatchExpectedScopes(statement, expectedTokens);
|
|
78
|
+
})
|
|
@@ -2,25 +2,108 @@ const { assert, expect } = require('chai');
|
|
|
2
2
|
const shared = require('../shared.js');
|
|
3
3
|
|
|
4
4
|
describe('', () => {
|
|
5
|
-
|
|
6
|
-
`procedure procName:
|
|
5
|
+
let statement =
|
|
6
|
+
`procedure procName:
|
|
7
7
|
|
|
8
8
|
end procedure.`;
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
10
|
+
let expectedTokens = [
|
|
11
|
+
[
|
|
12
|
+
{ "startIndex": 0, "endIndex": 9, "scopes": ["source.abl", "meta.procedure.abl", "keyword.other.abl"] }, // 'procedure'
|
|
13
|
+
{ "startIndex": 9, "endIndex": 10, "scopes": ["source.abl", "meta.procedure.abl"] }, // ' '
|
|
14
|
+
{ "startIndex": 10, "endIndex": 18, "scopes": ["source.abl", "meta.procedure.abl", "entity.name.function.abl"] }, // 'procName'
|
|
15
|
+
{ "startIndex": 18, "endIndex": 19, "scopes": ["source.abl", "meta.procedure.abl"] } // ':'
|
|
16
|
+
],
|
|
17
|
+
[
|
|
18
|
+
{ "startIndex": 0, "endIndex": 1, "scopes": ["source.abl"] } // ''
|
|
19
|
+
],
|
|
20
|
+
[
|
|
21
|
+
{ "startIndex": 0, "endIndex": 3, "scopes": ["source.abl", "keyword.other.abl"] }, // 'end'
|
|
22
|
+
{ "startIndex": 3, "endIndex": 4, "scopes": ["source.abl"] }, // ' '
|
|
23
|
+
{ "startIndex": 4, "endIndex": 13, "scopes": ["source.abl", "keyword.other.abl"] }, // 'procedure'
|
|
24
|
+
{ "startIndex": 13, "endIndex": 14, "scopes": ["source.abl", "punctuation.terminator.abl"] } // '.'
|
|
25
|
+
]
|
|
26
|
+
];
|
|
27
|
+
shared.itShouldMatchExpectedScopes(statement, expectedTokens);
|
|
26
28
|
})
|
|
29
|
+
|
|
30
|
+
describe('', () => {
|
|
31
|
+
let statement =
|
|
32
|
+
`procedure initProTopServer:
|
|
33
|
+
define input parameter rvType as char no-undo.
|
|
34
|
+
end procedure.`;
|
|
35
|
+
|
|
36
|
+
let expectedTokens = [
|
|
37
|
+
[
|
|
38
|
+
{ "startIndex": 0, "endIndex": 9, "scopes": ["source.abl", "meta.procedure.abl", "keyword.other.abl"] }, // 'procedure'
|
|
39
|
+
{ "startIndex": 9, "endIndex": 10, "scopes": ["source.abl", "meta.procedure.abl"] }, // ' '
|
|
40
|
+
{ "startIndex": 10, "endIndex": 26, "scopes": ["source.abl", "meta.procedure.abl", "entity.name.function.abl"] }, // 'initProTopServer'
|
|
41
|
+
{ "startIndex": 26, "endIndex": 27, "scopes": ["source.abl", "meta.procedure.abl"] } // ':'
|
|
42
|
+
],
|
|
43
|
+
[
|
|
44
|
+
{ "startIndex": 0, "endIndex": 2, "scopes": ["source.abl", "meta.define.abl"] }, // ' '
|
|
45
|
+
{ "startIndex": 2, "endIndex": 8, "scopes": ["source.abl", "meta.define.abl", "keyword.other.abl"] }, // 'define'
|
|
46
|
+
{ "startIndex": 8, "endIndex": 9, "scopes": ["source.abl", "meta.define.abl"] }, // ' '
|
|
47
|
+
{ "startIndex": 9, "endIndex": 14, "scopes": ["source.abl", "meta.define.abl", "keyword.other.abl"] }, // 'input'
|
|
48
|
+
{ "startIndex": 14, "endIndex": 15, "scopes": ["source.abl", "meta.define.abl"] }, // ' '
|
|
49
|
+
{ "startIndex": 15, "endIndex": 24, "scopes": ["source.abl", "meta.define.abl", "keyword.other.abl"] }, // 'parameter'
|
|
50
|
+
{ "startIndex": 24, "endIndex": 25, "scopes": ["source.abl", "meta.define.abl"] }, // ' '
|
|
51
|
+
{ "startIndex": 25, "endIndex": 31, "scopes": ["source.abl", "meta.define.abl", "variable.parameter.abl"] }, // 'rvType'
|
|
52
|
+
{ "startIndex": 31, "endIndex": 32, "scopes": ["source.abl", "meta.define.abl"] }, // ' '
|
|
53
|
+
{ "startIndex": 32, "endIndex": 34, "scopes": ["source.abl", "meta.define.abl", "keyword.other.abl"] }, // 'as'
|
|
54
|
+
{ "startIndex": 34, "endIndex": 35, "scopes": ["source.abl", "meta.define.abl"] }, // ' '
|
|
55
|
+
{ "startIndex": 35, "endIndex": 39, "scopes": ["source.abl", "meta.define.abl", "storage.type.abl"] }, // 'char'
|
|
56
|
+
{ "startIndex": 39, "endIndex": 40, "scopes": ["source.abl", "meta.define.abl"] }, // ' '
|
|
57
|
+
{ "startIndex": 40, "endIndex": 47, "scopes": ["source.abl", "meta.define.abl", "keyword.other.abl"] }, // 'no-undo'
|
|
58
|
+
{ "startIndex": 47, "endIndex": 48, "scopes": ["source.abl", "meta.define.abl", "punctuation.terminator.abl"] } // '.'
|
|
59
|
+
],
|
|
60
|
+
[
|
|
61
|
+
{ "startIndex": 0, "endIndex": 3, "scopes": ["source.abl", "keyword.other.abl"] }, // 'end'
|
|
62
|
+
{ "startIndex": 3, "endIndex": 4, "scopes": ["source.abl"] }, // ' '
|
|
63
|
+
{ "startIndex": 4, "endIndex": 13, "scopes": ["source.abl", "keyword.other.abl"] }, // 'procedure'
|
|
64
|
+
{ "startIndex": 13, "endIndex": 14, "scopes": ["source.abl", "punctuation.terminator.abl"] } // '.'
|
|
65
|
+
]
|
|
66
|
+
];
|
|
67
|
+
shared.itShouldMatchExpectedScopes(statement, expectedTokens);
|
|
68
|
+
})
|
|
69
|
+
|
|
70
|
+
describe('', () => {
|
|
71
|
+
let statement =
|
|
72
|
+
`procedure pascalStyleFormatting:
|
|
73
|
+
define input parameter pcString as char no-undo.
|
|
74
|
+
end procedure.`;
|
|
75
|
+
|
|
76
|
+
let expectedTokens = [
|
|
77
|
+
[
|
|
78
|
+
{ "startIndex": 0, "endIndex": 9, "scopes": ["source.abl", "meta.procedure.abl", "keyword.other.abl"] }, // 'procedure'
|
|
79
|
+
{ "startIndex": 9, "endIndex": 10, "scopes": ["source.abl", "meta.procedure.abl"] }, // ' '
|
|
80
|
+
{ "startIndex": 10, "endIndex": 31, "scopes": ["source.abl", "meta.procedure.abl", "entity.name.function.abl"] }, // 'pascalStyleFormatting'
|
|
81
|
+
{ "startIndex": 31, "endIndex": 32, "scopes": ["source.abl", "meta.procedure.abl"] } // ':'
|
|
82
|
+
],
|
|
83
|
+
[
|
|
84
|
+
{ "startIndex": 0, "endIndex": 2, "scopes": ["source.abl", "meta.define.abl"] }, // ' '
|
|
85
|
+
{ "startIndex": 2, "endIndex": 8, "scopes": ["source.abl", "meta.define.abl", "keyword.other.abl"] }, // 'define'
|
|
86
|
+
{ "startIndex": 8, "endIndex": 9, "scopes": ["source.abl", "meta.define.abl"] }, // ' '
|
|
87
|
+
{ "startIndex": 9, "endIndex": 14, "scopes": ["source.abl", "meta.define.abl", "keyword.other.abl"] }, // 'input'
|
|
88
|
+
{ "startIndex": 14, "endIndex": 15, "scopes": ["source.abl", "meta.define.abl"] }, // ' '
|
|
89
|
+
{ "startIndex": 15, "endIndex": 24, "scopes": ["source.abl", "meta.define.abl", "keyword.other.abl"] }, // 'parameter'
|
|
90
|
+
{ "startIndex": 24, "endIndex": 25, "scopes": ["source.abl", "meta.define.abl"] }, // ' '
|
|
91
|
+
{ "startIndex": 25, "endIndex": 33, "scopes": ["source.abl", "meta.define.abl", "variable.parameter.abl"] }, // 'pcString'
|
|
92
|
+
{ "startIndex": 33, "endIndex": 34, "scopes": ["source.abl", "meta.define.abl"] }, // ' '
|
|
93
|
+
{ "startIndex": 34, "endIndex": 36, "scopes": ["source.abl", "meta.define.abl", "keyword.other.abl"] }, // 'as'
|
|
94
|
+
{ "startIndex": 36, "endIndex": 37, "scopes": ["source.abl", "meta.define.abl"] }, // ' '
|
|
95
|
+
{ "startIndex": 37, "endIndex": 41, "scopes": ["source.abl", "meta.define.abl", "storage.type.abl"] }, // 'char'
|
|
96
|
+
{ "startIndex": 41, "endIndex": 42, "scopes": ["source.abl", "meta.define.abl"] }, // ' '
|
|
97
|
+
{ "startIndex": 42, "endIndex": 49, "scopes": ["source.abl", "meta.define.abl", "keyword.other.abl"] }, // 'no-undo'
|
|
98
|
+
{ "startIndex": 49, "endIndex": 50, "scopes": ["source.abl", "meta.define.abl", "punctuation.terminator.abl"] } // '.'
|
|
99
|
+
],
|
|
100
|
+
[
|
|
101
|
+
{ "startIndex": 0, "endIndex": 3, "scopes": ["source.abl", "keyword.other.abl"] }, // 'end'
|
|
102
|
+
{ "startIndex": 3, "endIndex": 4, "scopes": ["source.abl"] }, // ' '
|
|
103
|
+
{ "startIndex": 4, "endIndex": 13, "scopes": ["source.abl", "keyword.other.abl"] }, // 'procedure'
|
|
104
|
+
{ "startIndex": 13, "endIndex": 14, "scopes": ["source.abl", "punctuation.terminator.abl"] } // '.'
|
|
105
|
+
]
|
|
106
|
+
];
|
|
107
|
+
shared.itShouldMatchExpectedScopes(statement, expectedTokens);
|
|
108
|
+
})
|
|
109
|
+
|
|
@@ -1,42 +1,46 @@
|
|
|
1
|
-
const { assert, expect } = require('chai');
|
|
2
|
-
const shared = require('../shared.js');
|
|
3
|
-
|
|
4
|
-
describe('', () => {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
DEFINE RETURN PARAMETER intProcessHandle AS LONG.
|
|
8
|
-
END PROCEDURE.`;
|
|
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
|
-
|
|
1
|
+
const { assert, expect } = require('chai');
|
|
2
|
+
const shared = require('../shared.js');
|
|
3
|
+
|
|
4
|
+
describe('', () => {
|
|
5
|
+
let statement =
|
|
6
|
+
`PROCEDURE GetCurrentProcessId EXTERNAL "KERNEL32.DLL":
|
|
7
|
+
DEFINE RETURN PARAMETER intProcessHandle AS LONG.
|
|
8
|
+
END PROCEDURE.`;
|
|
9
|
+
|
|
10
|
+
let expectedTokens = [
|
|
11
|
+
[
|
|
12
|
+
{ "startIndex": 0, "endIndex": 9, "scopes": ["source.abl", "meta.procedure.abl", "keyword.other.abl"] }, // 'PROCEDURE'
|
|
13
|
+
{ "startIndex": 9, "endIndex": 10, "scopes": ["source.abl", "meta.procedure.abl"] }, // ' '
|
|
14
|
+
{ "startIndex": 10, "endIndex": 29, "scopes": ["source.abl", "meta.procedure.abl", "entity.name.function.abl"] }, // 'GetCurrentProcessId'
|
|
15
|
+
{ "startIndex": 29, "endIndex": 30, "scopes": ["source.abl", "meta.procedure.abl"] }, // ' '
|
|
16
|
+
{ "startIndex": 30, "endIndex": 38, "scopes": ["source.abl", "meta.procedure.abl", "keyword.other.abl"] }, // 'EXTERNAL'
|
|
17
|
+
{ "startIndex": 38, "endIndex": 39, "scopes": ["source.abl", "meta.procedure.abl"] }, // ' '
|
|
18
|
+
{ "startIndex": 39, "endIndex": 40, "scopes": ["source.abl", "meta.procedure.abl", "string.double.complex.abl", "punctuation.definition.string.begin.abl"] }, // '"'
|
|
19
|
+
{ "startIndex": 40, "endIndex": 52, "scopes": ["source.abl", "meta.procedure.abl", "string.double.complex.abl"] }, // 'KERNEL32.DLL'
|
|
20
|
+
{ "startIndex": 52, "endIndex": 53, "scopes": ["source.abl", "meta.procedure.abl", "string.double.complex.abl", "punctuation.definition.string.end.abl"] }, // '"'
|
|
21
|
+
{ "startIndex": 53, "endIndex": 54, "scopes": ["source.abl", "meta.procedure.abl"] } // ':'
|
|
22
|
+
],
|
|
23
|
+
[
|
|
24
|
+
{ "startIndex": 0, "endIndex": 6, "scopes": ["source.abl", "meta.define.abl", "keyword.other.abl"] }, // 'DEFINE'
|
|
25
|
+
{ "startIndex": 6, "endIndex": 7, "scopes": ["source.abl", "meta.define.abl"] }, // ' '
|
|
26
|
+
{ "startIndex": 7, "endIndex": 13, "scopes": ["source.abl", "meta.define.abl", "keyword.other.abl"] }, // 'RETURN'
|
|
27
|
+
{ "startIndex": 13, "endIndex": 14, "scopes": ["source.abl", "meta.define.abl"] }, // ' '
|
|
28
|
+
{ "startIndex": 14, "endIndex": 23, "scopes": ["source.abl", "meta.define.abl", "keyword.other.abl"] }, // 'PARAMETER'
|
|
29
|
+
{ "startIndex": 23, "endIndex": 24, "scopes": ["source.abl", "meta.define.abl"] }, // ' '
|
|
30
|
+
{ "startIndex": 24, "endIndex": 40, "scopes": ["source.abl", "meta.define.abl", "variable.parameter.abl"] }, // 'intProcessHandle'
|
|
31
|
+
{ "startIndex": 40, "endIndex": 41, "scopes": ["source.abl", "meta.define.abl"] }, // ' '
|
|
32
|
+
{ "startIndex": 41, "endIndex": 43, "scopes": ["source.abl", "meta.define.abl", "keyword.other.abl"] }, // 'AS'
|
|
33
|
+
{ "startIndex": 43, "endIndex": 44, "scopes": ["source.abl", "meta.define.abl"] }, // ' '
|
|
34
|
+
{ "startIndex": 44, "endIndex": 48, "scopes": ["source.abl", "meta.define.abl", "storage.type.abl"] }, // 'LONG'
|
|
35
|
+
{ "startIndex": 48, "endIndex": 49, "scopes": ["source.abl", "meta.define.abl", "punctuation.terminator.abl"] } // '.'
|
|
36
|
+
],
|
|
37
|
+
[
|
|
38
|
+
{ "startIndex": 0, "endIndex": 3, "scopes": ["source.abl", "keyword.other.abl"] }, // 'END'
|
|
39
|
+
{ "startIndex": 3, "endIndex": 4, "scopes": ["source.abl"] }, // ' '
|
|
40
|
+
{ "startIndex": 4, "endIndex": 13, "scopes": ["source.abl", "keyword.other.abl"] }, // 'PROCEDURE'
|
|
41
|
+
{ "startIndex": 13, "endIndex": 14, "scopes": ["source.abl", "punctuation.terminator.abl"] } // '.'
|
|
42
|
+
]
|
|
43
|
+
];
|
|
44
|
+
|
|
45
|
+
shared.itShouldMatchExpectedScopes(statement, expectedTokens);
|
|
46
|
+
})
|