-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path4GL.JSON-tmLanguage
94 lines (94 loc) · 3.95 KB
/
4GL.JSON-tmLanguage
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
{ "name": "4GL",
"scopeName": "source.4GL",
"fileTypes": ["4gl"],
"patterns": [
{
"name": "comment.block.source.4GL",
"begin": "\\{",
"patterns": [
{"match": "."}
],
"end": "\\}"
},
{
"name": "comment.number-sign.source.4GL",
"match": "#.*$",
"comment": "A comment starting with '#'"
},
{
"name": "string.single.source.4GL",
"match": "('(?:\\\\'|.)*?')",
"comment": "Single quoted string"
},
{
"name": "string.double.source.4GL",
"match": "(\\\"(?:\\\\\"|.)*?\\\")",
"comment": "Double quoted string"
},
{
"name": "keyword.operator.source.4GL",
"match": "(?i)(=|!=|\\+|-|/|<|>|,|(\\s(or|and|is|mod|not|initialize)(?=(\\s|$)))|((\\s|^)set(?=\\s)))",
"comment": "Operators"
},
{
"name": "constant.language.source.4GL",
"match": "(?i)(dirty read|null|true|false|notfound)",
"comment": "Constants provided by de language"
},
{
"name": "variable.language.source.4GL",
"match": "(?i)(isolation|today|\\sstatus|pageno)",
"comment": "Variables provided by de language"
},
{
"name": "keyword.control.source.4GL",
"match": "(?i)((\\s|^)case(\\s*|$)|continue (.*)|when |otherwise|end case|while |end while|(\\s|^)for(\\s|$)|foreach | into |end for(each)?|(\\s|^)if(?=\\s+|$)|(\\s+|^)then(\\s+|$)|(\\s+|^)else(\\s+|$)|end if|return(\\s+|$)|exit (.*))",
"comment": "Control"
},
{
"name": "keyword.other.source.4GL",
"match": "(?i)( between |call(?=\\s+|$)| clipped|(\\s|^)close\\s+(form|window)*|(\\s|^)create\\s+(temp\\s+)?(table|index)(?=\\s+|$)|database |\\sreturning |declare |delete(?=\\s|$)|display\\s+|((\\s|^)drop\\s+(table|index)(\\s|$))|((\\s|^)fetch((\\s+|$)|(\\s+(first|last)\\s+)))|(\\s|^)from(\\s+|$)|(\\s+|^)free\\s+|group by\\s|(\\s+|^)(desc|asc)(\\s+|$)|(\\s|^)insert\\s+into(\\s+|$)|((scroll)* cursor(?=\\s)(\\swith hold)*)|((top|right|bottom|left)\\s+margin)|page length|(\\s|^)open\\s+(form|window)*|(\\s|^)prepare |(^|\\s)prompt\\s|(^|\\s)input by name(\\s|$)|((start|finish)\\s+report)|(\\s|^)select(\\s+|$)| spaces|(\\s|^)update(\\s+|$)|(\\s|^)where(\\s+|$)|(\\s|^)output(?=\\s|$)|(?<=\\s)to(?=\\s|$)|order by|format( |$)|(first\\s+)*page header|before group of|on (every|last) row|after group of| using |begin\\s+work|commit\\s+work|rollback\\s+work|(\\s+|^)values(\\s+|$)|((\\s|^)whenever\\s+(any\\s+)?error\\s+(continue|stop)(\\s|$))|(\\s|^)run\\s+|end input)",
"comment": "Keywords"
},
{
"name": "constant.numeric.source.4GL",
"match": "(?<!\\w)((0(x|X)[0-9a-fA-F]+)|([0-9]+(\\.[0-9]+)?))",
"comment": "Constant numeric"
},
{
"name": "meta.function.source.4GL",
"match": "(?i)(?<!\\w\\s)(function|report)\\s+(.*)\\s*\\((.*)\\)",
"captures": {
"1": { "name": "storage.type.function.source.4GL"},
"2": { "name": "entity.name.function.source.4GL"},
"3": { "name": "variable.parameter.function.source.4GL"}
},
"comment": "Functions definitions"
},
{
"name": "meta.function.source.4GL",
"match": "(?i)(main)(\\s*|$)",
"captures": {
"1": { "name": "entity.name.function.source.4GL"},
"1": { "name": "storage.type.function.source.4GL"}
},
"comment": "Main function definition"
},
{
"name": "storage.type.function.source.4GL",
"match": "(?i)(end function|end main|end report)(\\s*|$)",
"comment": "Functions definitions"
},
{
"name": "storage.type.source.4GL",
"match": "(?i)(\\schar(?=[\\s\\(,$]))|(\\sdate(\\s+|$)|decimal|define | smallint| integer| float|let | like |(end)* record|(((^|\\s+)|(end\\s+))globals))",
"comment": "Storage types"
},
{
"name": "support.function.source.4GL",
"match": "(?i)((?<=\\s)(length|day|month|year|p_open|p_close)(?=\\s*\\(.*?\\)))",
"comment": "Some functions"
}
],
"uuid": "92ff564a-23b6-471d-8a26-831d4dec08c9"
}