-
Notifications
You must be signed in to change notification settings - Fork 0
/
gle.sublime-syntax
185 lines (171 loc) · 9.76 KB
/
gle.sublime-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
%YAML 1.2
---
# See http://www.sublimetext.com/docs/3/syntax.html
name: GLE
file_extensions: [gle, gli]
scope: source.gle
version: 2
contexts:
# The prototype context is prepended to all contexts but those setting
# meta_include_prototype: false.
prototype:
- include: comments
main:
# The main context is the initial starting point of our syntax.
# Include other contexts from here (or specify them directly).
- include: keywords
- include: numbers
- include: strings
keywords:
# Keywords are if, else for and while.
# Note that blackslashes don't need to be escaped within single quoted
# strings in YAML. When using single quoted strings, only single quotes
# need to be escaped: this is done by using two single quotes next to each
# other.
# commands
- match: '(?i)\b(add|aline|amove|arc|arcto|arrow|auto|bar|begin|bevel|bezier|bigfile|bitmap|bitmap_info|both|box|butt|cap|center|circle|clip|closepath|col|color|
|comment_char|comment|command|compact|curve|dashlen|data|define|default|dist|dpoints|draw|dsubticks|dticks|ellipse|elliptical_arc|elliptical_narc|else|end|err|
|errdown|errright|errup|errwidth|fill|font|for|from|fullsize|graph|grestore|grid|gsave|herr|herrleft|herrwidth|hscale|if|include|join|just|justify|key|
|left|let|line|local|lwidth|marker|max|mdata|min|mitre|msize|name|narc|next|nobox|nofirst|nolast|nomiss|nsteps|nticks|off|offset|origin|path|pos|position|
|postscript|psbbtweak|pscomment|rad|radius|rbezier|return|reverse|right|rline|rmove|rotate|rotate|round|save|scale|sep|set|shift|size|smooth|smoothm|square|
|start|step|step|stroke|sub|svg_smooth|table|text|to|then|title|translate|vscale|while|width|write|xg|xgmax|xgmin|xpos|yg|ygmax|ygmin|ypos|fclose|fopen|fread|ftokenizer|until)\b'
scope: entity.name.function.gle
# new colors
- match: '(?i)\b(aliceblue|antiquewhite|aqua|aquamarine|azure|beige|bisque|black|blanchedalmond|blue|blueviolet|brown|burlywood|cadetblue|
|chartreuse|chocolate|coral|cornflowerblue|cornsilk|crimson|cyan|darkblue|darkcyan|darkgoldenrod|darkgray|darkgreen|darkkhaki|
|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkturquoise|
|darkviolet|deeppink|deepskyblue|dimgray|dodgerblue|firebrick|floralwhite|forestgreen|fuchsia|gainsboro|ghostwhite|gold|
|goldenrod|gray|green|greenyellow|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|
|lightblue|lightcoral|lightcyan|lightgoldenrodyelow|lightgray|lightgreen|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|
|lightsteelblue|lightyellow|lime|limegreen|linen|magenta|maroon|mediumaquamarine|mediumblue|mediumorchid|mediumpurple|mediumseagreen|
|mediumslateblue|mediumspringgreen|mediumturquoise|mediumvioletred|midnightblue|mintcream|mistyrose|moccasin|navajowhite|navy|oldlace|
|olive|olivedrab|orange|orangered|orchid|palegoldenrod|palegreen|paleturquoise|palevioletred|papayawhip|peachpuff|peru|pink|plum|
|powderblue|purple|red|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|silver|skyblue|slateblue|slategray|
|snow|springgreen|steelblue|tan|teal|thistle|tomato|turquoise|violet|wheat|white|whitesmoke|yellow|yellowgreen)\b'
scope: keyword.other.gle
#old colors
- match: '(?i)\b(bakers_chocolate|blue_violet|brass|bright_gold|bronze|bronze_ii|brown_web|cadet_blue|cool_copper|copper|
|corn_flower_blue|dark_brown|dark_green|dark_green_copper|dark_olive_green|dark_orchid|dark_purple|dark_slate_blue|
|dark_slate_gray|dark_slate_grey|dark_tan|dark_turquoise|dark_wood|dim_gray|dim_grey|dusty_rose|feldspar|forest_green|
|forest_green_web|gray_web|green_copper|green_yellow|grey|grey1|grey10|grey20|grey30|grey40|grey5|grey60|
|grey70|grey80|grey90|grey50|grey_web|hunter_green|indian_red|lawn_green|light_blue|light_gray|light_grey|
|light_steel_blue|light_wood|lime_green|mandarian_orange|maroon_web|medium_aquamarine|medium_blue|medium_forest_green|
|medium_goldenrod|medium_orchid 0|medium_sea_green|medium_slate_blue|medium_spring_greeen|medium_turquoise|medium_violet_red|
|medium_wood|midnight_blue|navy_blue|neon_blue|neon_pink|new_midnight_blue|new_tan|old_gold|orange_red|orange_web|
|pale_green|pink_web|quartz|rich_blue|scarlet|sea_green|semi_sweet_chocolate|silver_web|sky_blue|slate_blue|spicy_pink|
|spring_green|steel_blue|summer_sky|tan_color|very_dark_brown|very_light_gray|very_light_grey|violet_red|violet_web|yellow_green)\b'
scope: keyword.other.gle
# math functions
- match: '(?i)\b(abs|acos|acosh|acot|acoth|acsc|asec|asech|asin|asinh|atan|atanh|
|cos|cosh|cot|coth|csc|csch|erf|exp|fix|int|log|log10|rnd|sdiv|sec|sech|sgn|sin|sinh|sqr|sqrt|tan|tanh|todeg|torad|
|associated_laguerre|spherical_harmonic|factorial|double_factorial|hermite|associated_legendre|bessel_first|bessel_second|
|airy_first|airy_second|chebyshev_first|chebyshev_second)\b'
scope: support.function.gle
# axis commands
- match: '(?i)\b([xy]2*axis|[xy]2*labels|[xy]2*names|[xy]2*places|[xy]2*side|[xy]2*subticks|[xy]2*ticks|[xy]2*title)\b'
scope: support.type.gle
# column ids and data ranges
- match: '(?i)(\b(d[\d]+|c[\d}+])\b)|(d\[[^\]]+\])'
scope: variable.parameter.gle
# positions or justifications
- match: '(?i)\b(tl|tc|tr|lc|cc|rc|bl|bc|br)\b'
scope: keyword.operator.gle
# begin end group names
- match: '(?i)\b(layer|translate|rotate)\b'
scope: keyword.control.gle
# constants
- match: '(?i)\b(pi|two_pi|root_pi|half_pi|root_2|root_3|_e_)\b'
scope: constant.language.gle
# markers
- match: '(?i)\b(triangle|wtriangle|ftriangle|square|wsquare|fsquare|circle|wcircle|fcircle|
|diamond|wdiamond|fdiamond|cross|plus|minus|asterisk|odot|ominus|oplus|otimes|star|star2|
|star3|star4|flower|club|heart|spade|dag|ddag|snake|dot|handpen|letter|phone|plane|scircle|
|ssquare|trianglez|diamondz)\b'
scope: variable.parameter.gle
# set XXXX
- match: '(?i)\b(hei|font|justify|just|color|background|dashlen|dash|fill|pattern|
|fillmethod|ldist|lstyle|lwidth|join|cap|fontlwidth|texscale|texlabels|arrowstyle|
|arrowtip|arrowsize|arrowangle|imageformat|titlescale|atitlescale|alabelscale|ticksscale|atitledist|alabeldis)\b'
scope: variable.parameter.gle
# fonts
- match: '(?i)\b(texcmss|texcmssb|texcmr)\b'
scope: variable.parameter.gle
# logical operators
- match: '(<\=|>\=|\=|<|>|\=|<>)'
scope: keyword.operator.gle
# operators
- match: '(\+|\-|/|%|\^|\*|\+\=|\-\=|\*\=|/\=)'
scope: keyword.operator.gle
# user defined functions
- match: 'sub \b[A-Za-z0-9]*\b'
scope: markup.italic.gle
numbers:
- match: '\b((0(x|X)[0-9a-fA-F]*(\.[0-9a-fA-F]+p-?\d+)?)|(([0-9]+\.?[0-9]*)|(\.[0-9]+))((e|E)(\+|-)?[0-9]+)?)([fF]|(l{1,2}|L{1,2})[uU]?|[uU](l{0,2}|L{0,2}))?\b'
scope: constant.numeric.gle
variables:
- match: '\bg[A-Z]\w*\b'
scope: variable.gle
- match: '\bs[A-Z]\w*\b'
scope: variable.gle
strings:
# Strings begin and end with quotes, and use backslashes as an escape
# character.
- match: '"'
scope: punctuation.definition.string.begin.gle
push: inside_string
inside_string:
- meta_include_prototype: false
- meta_scope: string.quoted.double.gle
- match: '\.'
scope: constant.character.escape.gle
- match: '"'
scope: punctuation.definition.string.end.gle
pop: true
comments:
# Comments begin with a '!' and finish at the end of the line.
- match: '!'
scope: punctuation.definition.comment.gle
push:
# This is an anonymous context push for brevity.
- meta_scope: comment.line.double-slash.gle
- match: $\n?
pop: true
# function:
# - match: '(?i)(\b\([^\)]+\)\b'
# push:
# - meta_content_scope: meta.function.gle
# - include: attributes
# - include: comments
# #- match: (?i)\bfunction\b
# # scope: keyword.declaration.function.php.gle
# - match: '&'
# scope: storage.modifier.reference.php.gle
# # https://wiki.php.net/rfc/constructor_promotion
# - match: __construct\b
# scope: entity.name.function.php support.function.magic.php.gle
# push:
# - match: (?=\()
# set:
# - match: \(
# scope: punctuation.section.group.begin.php.gle
# set:
# - meta_scope: meta.function.parameters.php meta.group.php.gle
# - match: '{{visibility_modifier}}'
# scope: storage.modifier.php.gle
# - include: function-parameters
# # Exit on unexpected content
# - match: (?=\S)
# pop: 1
# - match: '(__(?:callStatic|call|construct|destruct|get|set|isset|unset|toString|clone|set_state|sleep|wakeup|autoload|invoke|debugInfo))\b'
# scope: entity.name.function.php support.function.magic.php.gle
# - match: '{{identifier}}'
# scope: entity.name.function.php.gle
# # Lookahead is used here to prevent doubling up of meta.function and meta.function.parameters
# - match: (?=\()
# set:
# - match: \(
# scope: meta.function.parameters.php meta.group.php punctuation.section.group.begin.php.gle
# set: function-parameters
# # Exit on unexpected content
# - match: (?=\S)
# pop: 1