-
Notifications
You must be signed in to change notification settings - Fork 0
/
active4d.syntax
276 lines (275 loc) · 17.1 KB
/
active4d.syntax
1
2
3
4
5
6
7
8
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
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
---
name: Active4D
fileTypes: []
scopeName: source.active4d
repository:
escaped_char:
name: constant.character.escape.active4d
match: \\.
interpolated_variable:
name: variable.other.interpolated.local.active4d
captures:
"1":
name: punctuation.definition.variable.active4d
match: (\$)[\w_]+({(".+?"|\d+|\$[\w_]+)})*(\[\[\d+\]\])*
interpolated_table_field:
name: variable.other.interpolated.table-field.active4d
match: \[\w[\w_ ]*\][\w_]+(\[\[\d+\]\])*
interpolated_string:
patterns:
- include: "#escaped_char"
- include: "#interpolated_code"
- include: "#interpolated_table_field"
- include: "#interpolated_variable"
- include: "#interpolated_collection_ref"
interpolated_code:
name: source.interpolated.active4d
endCaptures:
"0":
name: punctuation.definition.string.end.active4d
begin: `
beginCaptures:
"0":
name: punctuation.definition.string.begin.active4d
end: `
patterns:
- include: $self
interpolated_collection_ref:
name: variable.other.interpolated.collection-ref.active4d
match: (_form|_query|_request|globals|session)({(".+?"|\d+|\$[\w_]+)})+(\[\[\d+\]\])*
fusedoc:
name: text.xml
begin: (?=^\s*<fusedoc )
end: (?<=</fusedoc>)
patterns:
- include: text.xml
uuid: 8C2BF09D-AE95-479B-B516-F8DB62C86A0C
foldingStartMarker: |-
(?x)
(^\s*(?i:if|while|for\ each|for|case\ of|repeat|method|save output)\b
)
patterns:
- name: comment.line.backtick.active4d
captures:
"1":
name: punctuation.definition.comment.active4d
match: (`).*$\n?
- name: comment.line.double-slash.active4d
captures:
"1":
name: punctuation.definition.comment.active4d
match: (//).*$\n?
- name: comment.line.double-backslash.continuation.active4d
captures:
"1":
name: punctuation.definition.comment.active4d
match: (\\\\).*$\n?
- name: comment.block.active4d
captures:
"0":
name: punctuation.definition.comment.active4d
begin: /\*
end: \*/
patterns:
- include: "#fusedoc"
- name: string.quoted.double.active4d
endCaptures:
"0":
name: punctuation.definition.string.end.active4d
begin: "\"(?!\"\")"
beginCaptures:
"0":
name: punctuation.definition.string.begin.active4d
end: "\""
patterns:
- include: "#escaped_char"
- name: string.quoted.triple.heredoc.active4d
endCaptures:
"0":
name: punctuation.definition.string.end.active4d
begin: "\"\"\""
beginCaptures:
"0":
name: punctuation.definition.string.begin.active4d
end: "\"\"\""
patterns:
- include: "#escaped_char"
- name: string.interpolated.quoted.single.active4d
endCaptures:
"0":
name: punctuation.definition.string.end.active4d
begin: "'(?!'')"
beginCaptures:
"0":
name: punctuation.definition.string.begin.active4d
end: "'"
patterns:
- include: "#interpolated_string"
- name: string.interpolated.quoted.triple.heredoc.active4d
endCaptures:
"0":
name: punctuation.definition.string.end.active4d
begin: "'''"
beginCaptures:
"0":
name: punctuation.definition.string.begin.active4d
end: "'''"
patterns:
- include: "#interpolated_string"
- name: constant.numeric.active4d
match: (?<![[:alpha:]])[\-]?(?:0x[[:xdigit:]]{1,4}|\d+(\.\d+)?)(?![[:alpha:]])
- name: constant.language.boolean.active4d
match: \b(?i)(true|false)\b
- name: variable.other.local.active4d
captures:
"1":
name: punctuation.definition.variable.active4d
match: (\$)[\w_]+
- name: variable.other.interprocess.active4d
captures:
"1":
name: punctuation.definition.variable.active4d
match: (\<\>)[\w_]+
- name: variable.other.table-field.active4d
captures:
"1":
name: punctuation.definition.variable.active4d
"2":
name: punctuation.definition.variable.active4d
match: (\[)[^\[].*?(\])([\w_ ]+)?
- name: constant.other.date.active4d
captures:
"1":
name: punctuation.definition.constant.active4d
"2":
name: punctuation.definition.constant.active4d
match: (!)\d{1,2}/\d{1,2}/\d{2,4}(!)
- name: constant.other.time.active4d
captures:
"1":
name: punctuation.definition.constant.active4d
"2":
name: punctuation.definition.constant.active4d
match: (\?)\d{1,2}:\d{1,2}:\d{1,2}(\?)
- name: meta.function.active4d
captures:
"1":
name: storage.type.function.active4d
"2":
name: entity.name.function.active4d
match: ^\s*(method)\s*("[^"]+")(?!\s*\()
comment: method definition without parameters
- name: meta.function.active4d
endCaptures:
"1":
name: punctuation.definition.parameters.active4d
begin: ^\s*(method)\s*((")[^"]+("))\s*(\()
beginCaptures:
"1":
name: storage.type.function.active4d
"2":
name: entity.name.function.active4d
"3":
name: punctuation.definition.entity.active4d
"4":
name: punctuation.definition.entity.active4d
"5":
name: punctuation.definition.parameters.active4d
end: (\))\s*(?:(?:\\\\|//|`).*)?$
patterns:
- name: variable.parameter.function.active4d
captures:
"1":
name: keyword.operator.active4d
"2":
name: punctuation.definition.variable.active4d
"3":
name: punctuation.separator.parameters.active4d
match: (&)?(\$)[\w_]+(;)?
- endCaptures:
"1":
name: punctuation.separator.parameters.active4d
begin: (=)
beginCaptures:
"1":
name: punctuation.separator.key-value.active4d
end: (;)|(?=\))
patterns:
- include: $self
comment: method definition with parameters
- name: keyword.operator.active4d
match: |-
(?x) (
:=
| \+=
| \-=
| /=
| \\=
| \*=
| \%=
| \^=
| &=
| \|=
| <<=
| >>=
| >
| <
| >=
| <=
| =
| =~
| \#
| \#~
| ~
| !~
| \+
| \+\+
| \-
| \-\-
| /
| \\
| \*
| \*\+
| \*/
| %
| &
| \|
| \^
| \^\|
| <<
| >>
| \?\+
| \?\-
| \?\?
| \}
| \{
| ;
| \:
| \]\]
| \[\[
| \->)
- name: keyword.control.active4d
match: \b(?i)(end (if|for each|for|while|case)|if|else|while|for each|for|case of|repeat|until|break|continue)\b
- name: keyword.other.active4d
match: \b(?i)(end method|method|define|return|exit|self|import|require|global|throw)\b
- name: support.constant.active4d
match: (?i)\b(Write Mode|Text without length|Text array|String array|Short|Real array|Read Mode|Read and Write|Pointer array|Picture array|No current record|New record|Month Day Year|MM DD YYYY Forced|MM DD YYYY|MAXTEXTLEN|MAXLONG|Longint array|Long|Line feed|Is Undefined|Is Time|Is Text|Is String Var|Is Real|Is Pointer|Is Picture|Is Longint|Is Integer|Is Date|Is Boolean|Is BLOB|Is Alpha Field|Into variable|Into set|Into named selection|Into current selection|Integer array|Hour Min Sec|Hour Min|HH MM SS|HH MM AM PM|HH MM|Get Pathname|Date array|Carriage return|Boolean array|Array 2D|Abbreviated|Abbr Month Day|A4D Parameter Mode Separate|A4D Parameter Mode Query|A4D Parameter Mode Form|A4D License Type Deployment|A4D Encoding Tags|A4D Encoding Quotes|A4D Encoding None|A4D Encoding HTML|A4D Encoding Extended|A4D Encoding Ampersand|A4D Encoding All|A4D Charset Win|A4D Charset Shift_JIS|A4D Charset Mac|A4D Charset ISO Latin1|A4D Charset GB2312)\b
- name: support.function.active4d
match: (?i)\b(_request|_query|_form|Year of|writep|writeln|writebr|write to console|write raw|write png|WRITE PICTURE FILE|write jpg|write jpeg|write gif|write blob|write|Win to Mac|week of year|variable name|VALIDATE TRANSACTION|utc to local time|utc to local datetime|USE SET|USE NAMED SELECTION|url to native path|url encode query|url encode path|url encode|url decode query|url decode path|url decode|Uppercase|unlock globals|UNLOAD RECORD|UNION|Undefined|type descriptor|Type|Trunc|True|trim|timestamp year|timestamp time|timestamp string|timestamp second|timestamp month|timestamp minute|timestamp millisecond|timestamp hour|timestamp difference|timestamp day|timestamp date|timestamp|time to longint|Time string|Time|Tickcount|throw|TEXT TO BLOB|Test semaphore|Test path name|Table name|Table|Substring|Structure file|STRING LIST TO ARRAY|String|START TRANSACTION|split string|SORT ARRAY|slice string|Size of array|set session timeout|set session array|set session|set script timeout|set response status|set response header|set response cookie path|set response cookie expires|set response cookie domain|set response cookie|set response buffer|SET QUERY LIMIT|SET QUERY DESTINATION|set platform charset|set output encoding|set output charset|set log level|set local|set global array|set global|set expires date|set expires|set error page|SET DOCUMENT POSITION|SET DEFAULT CENTURY|set current script timeout|set content type|set content charset|set collection array|set collection|set cache control|SET AUTOMATIC RELATIONS|set array|session to blob|session query|session local|session internal id|session id|session has|session|Sequence number|SEND PACKET|Semaphore|SELECTION TO ARRAY|SELECTION RANGE TO ARRAY|Selected record number|SCAN INDEX|save upload to field|SAVE RECORD|save output|save collection|Round|right trim|response headers|response cookies|response buffer size|RESOLVE POINTER|resize array|require|requested url|request query|request info|request cookies|Replace string|REMOVE FROM SET|RELATE ONE SELECTION|RELATE ONE|RELATE MANY SELECTION|RELATE MANY|regex split|regex replace|regex quote pattern|regex match all|regex match|regex find in array|regex find all in array|regex callback replace|REDUCE SELECTION|redirect|Records in table|Records in set|Records in selection|Record number|RECEIVE PACKET|READ WRITE|READ PICTURE FILE|Read only state|READ ONLY|random between|Random|QUERY WITH ARRAY|QUERY SELECTION BY FORMULA|QUERY SELECTION|query params has|query params|QUERY BY FORMULA|QUERY|PREVIOUS RECORD|Position|Picture size|PICTURE PROPERTIES|parameter mode|param text|ORDER BY FORMULA|ORDER BY|Open document|ONE RECORD SELECT|Num|Not|nil pointer|Nil|NEXT RECORD|next item|new local collection|new global collection|new collection|native to url path|multisort named arrays|multisort arrays|MOVE DOCUMENT|more items|Month of|min of|Milliseconds|method exists|merge collections|md5 sum|max of|Mac to Win|Mac to ISO|mac to html|Lowercase|longint to time|log message|Locked|lock globals|local variables|local time to utc|local datetime to utc|LOAD RECORD|load collection|LIST TO ARRAY|library list|Length|left trim|LAST RECORD|last of|last not of|join paths|join array|ISO to Mac|Is in set|is array|is an iterator|is a collection|INTERSECTION|interpolate string|Int|insert into array|INSERT ELEMENT|include into|include|in error|import|identical strings|hide session field|GOTO SELECTED RECORD|GOTO RECORD|globals has|globals|global|get version|get utc delta|get upload size|get upload remote filename|get upload extension|get upload encoding|get upload content type|get timestamp datetime|get time remaining|get session timeout|get session stats|get session names|get session item|get session array size|get session array|get session|get script timeout|get root|get response headers|get response header|get response cookies|get response cookie path|get response cookie expires|get response cookie domain|get response cookie|get response buffer|get request value|get request infos|get request info|get request cookies|get request cookie|get query params|get query param count|get query param choices|get query param|Get pointer|get platform charset|GET PICTURE FROM LIBRARY|get output encoding|get output charset|get log level|get local|get license info|get library list|get item value|get item type|get item key|get item array|Get indexed string|get global keys|get global item|get global array size|get global array|get global|get form variables|get form variable count|get form variable choices|get form variable|GET FIELD PROPERTIES|get field pointer|get field numbers|get expires date|get expires|get error page|Get document position|get current script timeout|get content type|get content charset|get collection keys|get collection item count|get collection item|get collection array size|get collection array|get collection|get call chain|get cache control|get auto relations|full requested url|form variables has|form variables|FOLDER LIST|FIRST RECORD|first of|first not of|Find index key|Find in array|fill array|filename of|file exists|Field name|Field|False|extension of|execute in 4d|EXECUTE|End selection|end save output|enclose|DOCUMENT TO BLOB|DOCUMENT LIST|DISTINCT VALUES|directory separator|directory of|directory exists|DIFFERENCE|Delete string|delete session item|DELETE SELECTION|delete response header|delete response cookie|DELETE RECORD|delete global|DELETE FOLDER|DELETE ELEMENT|DELETE DOCUMENT|delete collection item|DELAY PROCESS|defined|define|default directory|deep copy collection|deep clear collection|Dec|day of year|Day of|Day number|Date|C_TIME|C_TEXT|C_STRING|C_REAL|C_POINTER|C_PICTURE|C_LONGINT|C_DATE|C_BOOLEAN|C_BLOB|CUT NAMED SELECTION|Current time|current realm|Current process|current platform|current path|Current method name|current line number|current library name|current file|Current date|CREATE SET FROM ARRAY|CREATE SET|CREATE SELECTION FROM ARRAY|CREATE RECORD|CREATE FOLDER|CREATE EMPTY SET|Create document|count uploads|Count tables|count session items|count response headers|count response cookies|count request infos|count request cookies|count query params|Count in array|count globals|count form variables|Count fields|count collection items|copy upload|COPY SET|COPY NAMED SELECTION|COPY DOCUMENT|copy collection|COPY ARRAY|concat|compare strings|collection to blob|collection has|collection|CLOSE DOCUMENT|CLEAR VARIABLE|CLEAR SET|CLEAR SEMAPHORE|clear response buffer|CLEAR NAMED SELECTION|clear collection|clear buffer (deprecated)|clear array|choose|Char|cell|capitalize|CANCEL TRANSACTION|call method|call 4d method|build query string|blowfish encrypt|blowfish decrypt|BLOB to text|blob to session|BLOB TO DOCUMENT|blob to collection|BLOB size|Before selection|base64 encode|base64 decode|AUTOMATIC RELATIONS|auto relate|authenticate|auth user|auth type|auth password|Ascii|ARRAY TEXT|ARRAY STRING|ARRAY REAL|ARRAY POINTER|ARRAY PICTURE|ARRAY LONGINT|ARRAY INTEGER|ARRAY DATE|ARRAY BOOLEAN|append to array|Append document|ALL RECORDS|add to timestamp|ADD TO SET|Add to date|add element|Abs|abandon session|abandon response cookie)\b
comment: 4D and Active4D commands
- name: support.function.active4d
match: (?i)\b((yearMonthDay|writeDumpStyles|writeBold|write|warnInvalidField|valueList|valueCountNoCase|valueCount|validPrice|validEmailAddress|validateTextFields|unlockAndLoad|truncateText|timedOut|sourceRowCount|sort|setTitle|setTimeout|setSMTPHost|setSMTPAuthorization|setSeparator|setRelateOne|setMailMethod|setDivId|setDefaults|setColumnData|setColumnArray|setAt|sendMail|sendFuseaction|saveFormToSession|rowCount|reverseArray|rest|qualify|previous|prepend|postHandleError|persistent|ordinalOf|nextID|next|newFromSelection|newFromRowSet|newFromFile|newFromData|newFromCachedSelection|newFromArrays|newFromArray|new|move|maxRows|makeURL|makeSafeMailto|makeLinks|makeFuseboxLinks|listToArray|len|last|isLast|isFuseboxRequest|isFirst|isBeforeFirst|isAfterLast|insertAt|hideUniqueField|hideField|handleError|gotoRow|getVariablesIterator|getUniqueID|getTitle|getTimeout|getStarts|getStart|getSMTPHost|getSMTPAuthUser|getSMTPAuthPassword|getSMTPAuthorization|getRow|getPointerReferent|getPictureDescriptor|getPersistentList|getMailMethod|getEnd|getEmptyFields|getDefaults|getData|getColumn|getAt|fuseboxNew|formVariableListToQuery|formatUSPhone|first|findRow|findNoCase|findColumn|find|filterCollection|embedVariables|embedQueryParams|embedFormVariables|embedFormVariableList|embedCollectionItems|embedCollection|dumpPersistent|dumpLib|dumpDefaults|dump session stats|dump session|dump selection|dump RowSet|dump request info|dump request|dump query params|dump locals|dump license info|dump form variables|dump collection|dump array|dump|deleteSelection|deleteAt|currentRow|core|containsNoCase|contains|columnCount|collectionToQuery|collectionItemsToQuery|clearPersistent|chopText|checkSession|checkboxState|changeDelims|camelCaseText|buildSelectValueMenu|buildSelectMenu|buildRecordList|buildOptionsFromSelection|buildOptionsFromRowSet|buildOptionsFromOptionList|buildOptionsFromOptionArray|buildOptionsFromLists|buildOptionsFromArrays|buildArrayValueList|buildArrayList|beforeFirst|articleFor|arrayToList|append|afterLast|addMetaTag|addJS|addJavascript|addDumpStyles|addCSS|add))\b
comment: library methods
- name: support.variable.active4d
match: (?i)\b(OK|Document|fusebox\.conf\.fuseaction)\b
- captures:
"1":
name: support.class.active4d
"2":
name: support.function.active4d
match: (?<!\$)\b((?:a4d\.(?:console|debug|lists|utils|web)|Batch|Breadcrumbs|fusebox\.conf|fusebox\.head|fusebox|RowSet))\.([[:alpha:]][[[:alnum:]]_ ]+[[:alnum:]])
foldingStopMarker: |-
(?x)
(^\s*(?i:end\ (if|while|for\ each|for|case|method|save output)|until)\b
)
keyEquivalent: ^~A