tree-sitter-gnuplot 2.0.1__cp310-abi3-win_arm64.whl
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.
- tree_sitter_gnuplot/__init__.py +42 -0
- tree_sitter_gnuplot/__init__.pyi +10 -0
- tree_sitter_gnuplot/_binding.pyd +0 -0
- tree_sitter_gnuplot/binding.c +35 -0
- tree_sitter_gnuplot/py.typed +0 -0
- tree_sitter_gnuplot/queries/folds.scm +8 -0
- tree_sitter_gnuplot/queries/highlights.scm +434 -0
- tree_sitter_gnuplot/queries/injections.scm +17 -0
- tree_sitter_gnuplot-2.0.1.dist-info/METADATA +39 -0
- tree_sitter_gnuplot-2.0.1.dist-info/RECORD +13 -0
- tree_sitter_gnuplot-2.0.1.dist-info/WHEEL +5 -0
- tree_sitter_gnuplot-2.0.1.dist-info/licenses/LICENSE +21 -0
- tree_sitter_gnuplot-2.0.1.dist-info/top_level.txt +2 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"""A tree-sitter grammar for gnuplot"""
|
|
2
|
+
|
|
3
|
+
from importlib.resources import files as _files
|
|
4
|
+
|
|
5
|
+
from ._binding import language
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def _get_query(name, file):
|
|
9
|
+
query = _files(f"{__package__}.queries") / file
|
|
10
|
+
globals()[name] = query.read_text()
|
|
11
|
+
return globals()[name]
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def __getattr__(name):
|
|
15
|
+
# NOTE: uncomment these to include any queries that this grammar contains:
|
|
16
|
+
|
|
17
|
+
# if name == "HIGHLIGHTS_QUERY":
|
|
18
|
+
# return _get_query("HIGHLIGHTS_QUERY", "highlights.scm")
|
|
19
|
+
# if name == "INJECTIONS_QUERY":
|
|
20
|
+
# return _get_query("INJECTIONS_QUERY", "injections.scm")
|
|
21
|
+
# if name == "LOCALS_QUERY":
|
|
22
|
+
# return _get_query("LOCALS_QUERY", "locals.scm")
|
|
23
|
+
# if name == "TAGS_QUERY":
|
|
24
|
+
# return _get_query("TAGS_QUERY", "tags.scm")
|
|
25
|
+
|
|
26
|
+
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
__all__ = [
|
|
30
|
+
"language",
|
|
31
|
+
# "HIGHLIGHTS_QUERY",
|
|
32
|
+
# "INJECTIONS_QUERY",
|
|
33
|
+
# "LOCALS_QUERY",
|
|
34
|
+
# "TAGS_QUERY",
|
|
35
|
+
]
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
def __dir__():
|
|
39
|
+
return sorted(__all__ + [
|
|
40
|
+
"__all__", "__builtins__", "__cached__", "__doc__", "__file__",
|
|
41
|
+
"__loader__", "__name__", "__package__", "__path__", "__spec__",
|
|
42
|
+
])
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
from typing import Final
|
|
2
|
+
|
|
3
|
+
# NOTE: uncomment these to include any queries that this grammar contains:
|
|
4
|
+
|
|
5
|
+
# HIGHLIGHTS_QUERY: Final[str]
|
|
6
|
+
# INJECTIONS_QUERY: Final[str]
|
|
7
|
+
# LOCALS_QUERY: Final[str]
|
|
8
|
+
# TAGS_QUERY: Final[str]
|
|
9
|
+
|
|
10
|
+
def language() -> object: ...
|
|
Binary file
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
#include <Python.h>
|
|
2
|
+
|
|
3
|
+
typedef struct TSLanguage TSLanguage;
|
|
4
|
+
|
|
5
|
+
TSLanguage *tree_sitter_gnuplot(void);
|
|
6
|
+
|
|
7
|
+
static PyObject* _binding_language(PyObject *Py_UNUSED(self), PyObject *Py_UNUSED(args)) {
|
|
8
|
+
return PyCapsule_New(tree_sitter_gnuplot(), "tree_sitter.Language", NULL);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
static struct PyModuleDef_Slot slots[] = {
|
|
12
|
+
#ifdef Py_GIL_DISABLED
|
|
13
|
+
{Py_mod_gil, Py_MOD_GIL_NOT_USED},
|
|
14
|
+
#endif
|
|
15
|
+
{0, NULL}
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
static PyMethodDef methods[] = {
|
|
19
|
+
{"language", _binding_language, METH_NOARGS,
|
|
20
|
+
"Get the tree-sitter language for this grammar."},
|
|
21
|
+
{NULL, NULL, 0, NULL}
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
static struct PyModuleDef module = {
|
|
25
|
+
.m_base = PyModuleDef_HEAD_INIT,
|
|
26
|
+
.m_name = "_binding",
|
|
27
|
+
.m_doc = NULL,
|
|
28
|
+
.m_size = 0,
|
|
29
|
+
.m_methods = methods,
|
|
30
|
+
.m_slots = slots,
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
PyMODINIT_FUNC PyInit__binding(void) {
|
|
34
|
+
return PyModuleDef_Init(&module);
|
|
35
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,434 @@
|
|
|
1
|
+
; highlights.scm
|
|
2
|
+
(comment) @comment @spell
|
|
3
|
+
|
|
4
|
+
"variable" @variable.parameter
|
|
5
|
+
|
|
6
|
+
; built-in named values (palette presets, special color names)
|
|
7
|
+
; TODO: decide and collapse (bgnd & background same)
|
|
8
|
+
; black/viridis constant?
|
|
9
|
+
[
|
|
10
|
+
"viridis"
|
|
11
|
+
"black"
|
|
12
|
+
"bgnd"
|
|
13
|
+
"background"
|
|
14
|
+
] @variable.parameter.builtin
|
|
15
|
+
|
|
16
|
+
(identifier) @variable
|
|
17
|
+
|
|
18
|
+
[
|
|
19
|
+
"["
|
|
20
|
+
"]"
|
|
21
|
+
"("
|
|
22
|
+
")"
|
|
23
|
+
"{"
|
|
24
|
+
"}"
|
|
25
|
+
] @punctuation.bracket
|
|
26
|
+
|
|
27
|
+
(operator) @operator
|
|
28
|
+
|
|
29
|
+
[
|
|
30
|
+
"="
|
|
31
|
+
","
|
|
32
|
+
":"
|
|
33
|
+
] @operator
|
|
34
|
+
|
|
35
|
+
(keyword_op) @keyword.operator
|
|
36
|
+
|
|
37
|
+
(ternary_op) @keyword.conditional.ternary
|
|
38
|
+
|
|
39
|
+
; TODO: collapse
|
|
40
|
+
[
|
|
41
|
+
"for"
|
|
42
|
+
"in"
|
|
43
|
+
"do"
|
|
44
|
+
"while"
|
|
45
|
+
] @keyword.repeat
|
|
46
|
+
|
|
47
|
+
; -----------------------------------------------------------------------
|
|
48
|
+
; Commands
|
|
49
|
+
"cmd" @keyword
|
|
50
|
+
|
|
51
|
+
; TODO: decide and collapse
|
|
52
|
+
[
|
|
53
|
+
"newhistogram"
|
|
54
|
+
"newspiderplot"
|
|
55
|
+
"keyentry"
|
|
56
|
+
] @keyword
|
|
57
|
+
|
|
58
|
+
; TODO: decide inverse, sample
|
|
59
|
+
[
|
|
60
|
+
"inverse"
|
|
61
|
+
"sample"
|
|
62
|
+
"kw_fn"
|
|
63
|
+
] @keyword.function
|
|
64
|
+
|
|
65
|
+
"kw_cond" @keyword.conditional
|
|
66
|
+
|
|
67
|
+
; TODO: decide and collapse
|
|
68
|
+
[
|
|
69
|
+
"front"
|
|
70
|
+
"back"
|
|
71
|
+
"depthorder"
|
|
72
|
+
"clip"
|
|
73
|
+
"font"
|
|
74
|
+
"filled"
|
|
75
|
+
"nofilled"
|
|
76
|
+
"parallel"
|
|
77
|
+
; coordinate systems (first/second/graph/screen/character/polar) — alias "coord"
|
|
78
|
+
"coord"
|
|
79
|
+
] @keyword.directive
|
|
80
|
+
|
|
81
|
+
; on/off toggle flags ({no}X) — alias "flag" (@keyword.modifier)
|
|
82
|
+
"flag" @keyword.directive
|
|
83
|
+
|
|
84
|
+
; enumerated VALUES / modes (alias "mod") — @constant
|
|
85
|
+
; TODO: decide, constant?
|
|
86
|
+
"mod" @constant
|
|
87
|
+
|
|
88
|
+
; plot/splot ELEMENT modifiers (alias "attr") — @property
|
|
89
|
+
; (title/notitle/with/using/index/every/axes/smooth in a plot command;
|
|
90
|
+
; distinct from set-option names which are @variable.member)
|
|
91
|
+
"attr" @property
|
|
92
|
+
|
|
93
|
+
; -----------------------------------------------------------------------
|
|
94
|
+
; TODO: decide and collapse
|
|
95
|
+
[
|
|
96
|
+
; Terminal output path
|
|
97
|
+
"name"
|
|
98
|
+
; Style attribute shorthands (K constants + datafile keywords)
|
|
99
|
+
"sa"
|
|
100
|
+
"dt"
|
|
101
|
+
"fc"
|
|
102
|
+
"fs"
|
|
103
|
+
"lc"
|
|
104
|
+
"lt"
|
|
105
|
+
"ps"
|
|
106
|
+
"pt"
|
|
107
|
+
"tc"
|
|
108
|
+
"skip"
|
|
109
|
+
"expand"
|
|
110
|
+
"title"
|
|
111
|
+
; set/show argument keywords (all key("...", n, "arg") aliases)
|
|
112
|
+
"arg"
|
|
113
|
+
] @variable.member
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
; -----------------------------------------------------------------------
|
|
117
|
+
; Option keywords
|
|
118
|
+
; TODO: decide and collapse
|
|
119
|
+
[
|
|
120
|
+
; coordinate systems / axes
|
|
121
|
+
"unit"
|
|
122
|
+
"axes_opts"
|
|
123
|
+
; time units (set xdata time / timefmt)
|
|
124
|
+
"seconds"
|
|
125
|
+
"minutes"
|
|
126
|
+
"hours"
|
|
127
|
+
"days"
|
|
128
|
+
"weeks"
|
|
129
|
+
"months"
|
|
130
|
+
"years"
|
|
131
|
+
; smooth subtypes still emitted as own token (value-modes csplines/bezier/… → "mod")
|
|
132
|
+
"kdensity"
|
|
133
|
+
"closed"
|
|
134
|
+
"between"
|
|
135
|
+
"above"
|
|
136
|
+
"below"
|
|
137
|
+
; plot / datafile misc
|
|
138
|
+
"pixels"
|
|
139
|
+
"whiskerbars"
|
|
140
|
+
"beginning"
|
|
141
|
+
"long"
|
|
142
|
+
; positioning / key
|
|
143
|
+
"base"
|
|
144
|
+
"begin"
|
|
145
|
+
"center"
|
|
146
|
+
"end"
|
|
147
|
+
; pm3d / 3d options
|
|
148
|
+
"clip1in"
|
|
149
|
+
"clip4in"
|
|
150
|
+
"c2c"
|
|
151
|
+
"retrace"
|
|
152
|
+
; data separators
|
|
153
|
+
"whitespace"
|
|
154
|
+
"tab"
|
|
155
|
+
"comma"
|
|
156
|
+
; palette stack
|
|
157
|
+
"push"
|
|
158
|
+
"pop"
|
|
159
|
+
; flip binary axes
|
|
160
|
+
"flipx"
|
|
161
|
+
"flipy"
|
|
162
|
+
"flipz"
|
|
163
|
+
; binary datafile modifiers
|
|
164
|
+
"binary"
|
|
165
|
+
"format"
|
|
166
|
+
"filetype"
|
|
167
|
+
"record"
|
|
168
|
+
"array"
|
|
169
|
+
"origin"
|
|
170
|
+
"dx"
|
|
171
|
+
"dy"
|
|
172
|
+
"width"
|
|
173
|
+
"level"
|
|
174
|
+
"matrix"
|
|
175
|
+
"nonuniform"
|
|
176
|
+
"sparse"
|
|
177
|
+
"volatile"
|
|
178
|
+
"noautoscale"
|
|
179
|
+
"zsort"
|
|
180
|
+
"mask"
|
|
181
|
+
"transpose"
|
|
182
|
+
; endian options (binary)
|
|
183
|
+
"endian"
|
|
184
|
+
"little"
|
|
185
|
+
"big"
|
|
186
|
+
"swap"
|
|
187
|
+
"swab"
|
|
188
|
+
"middle"
|
|
189
|
+
"pdp"
|
|
190
|
+
; fit modifiers
|
|
191
|
+
"unitweights"
|
|
192
|
+
"errors"
|
|
193
|
+
; pause endconditions
|
|
194
|
+
"mouse"
|
|
195
|
+
"keypress"
|
|
196
|
+
"button1"
|
|
197
|
+
"button2"
|
|
198
|
+
"button3"
|
|
199
|
+
"close"
|
|
200
|
+
"any"
|
|
201
|
+
; history command options
|
|
202
|
+
"append"
|
|
203
|
+
"quiet"
|
|
204
|
+
"numbers"
|
|
205
|
+
"trim"
|
|
206
|
+
"full"
|
|
207
|
+
; pixmap
|
|
208
|
+
; coordinate axis-family prefix (the coord systems first/second/graph/screen/
|
|
209
|
+
; character/polar are aliased to (coord) -> @keyword.directive below)
|
|
210
|
+
"axis"
|
|
211
|
+
; position direction aliases
|
|
212
|
+
"cen"
|
|
213
|
+
"lef"
|
|
214
|
+
"rig"
|
|
215
|
+
; geometry / arrow options
|
|
216
|
+
"angle"
|
|
217
|
+
"length"
|
|
218
|
+
"head"
|
|
219
|
+
"inout"
|
|
220
|
+
; offset / scale
|
|
221
|
+
"offset"
|
|
222
|
+
"nooffset"
|
|
223
|
+
"scale"
|
|
224
|
+
; orientation
|
|
225
|
+
; angle units
|
|
226
|
+
; contour / palette / axis
|
|
227
|
+
"range"
|
|
228
|
+
"missing"
|
|
229
|
+
"interpolate"
|
|
230
|
+
"autofreq"
|
|
231
|
+
"autojustify"
|
|
232
|
+
; rotation
|
|
233
|
+
"rotate"
|
|
234
|
+
; border / extend / range modifiers
|
|
235
|
+
"restore"
|
|
236
|
+
; pm3d
|
|
237
|
+
"scanorder"
|
|
238
|
+
"position"
|
|
239
|
+
; histogram subtypes
|
|
240
|
+
; smooth additions
|
|
241
|
+
; key/label placement
|
|
242
|
+
; fill pattern
|
|
243
|
+
"pattern"
|
|
244
|
+
; 3d / surface
|
|
245
|
+
"s"
|
|
246
|
+
; data / fit extras
|
|
247
|
+
"variables"
|
|
248
|
+
"logfile"
|
|
249
|
+
"nologfile"
|
|
250
|
+
"datablocks"
|
|
251
|
+
"commentschars"
|
|
252
|
+
"functions"
|
|
253
|
+
; misc
|
|
254
|
+
; coordinate planes / walls
|
|
255
|
+
"version"
|
|
256
|
+
; colorspec
|
|
257
|
+
"rgbcolor"
|
|
258
|
+
; tics
|
|
259
|
+
; set size
|
|
260
|
+
; set fit
|
|
261
|
+
"maxiter"
|
|
262
|
+
"default"
|
|
263
|
+
; label / style
|
|
264
|
+
; set view
|
|
265
|
+
"map"
|
|
266
|
+
; set theta direction
|
|
267
|
+
; palette model / presets / cubehelix options
|
|
268
|
+
"model"
|
|
269
|
+
; pm3d / lighting
|
|
270
|
+
"corners2color"
|
|
271
|
+
"primary"
|
|
272
|
+
"specular"
|
|
273
|
+
"spec2"
|
|
274
|
+
; dgrid3d subtype (gauss/… value-modes → "mod")
|
|
275
|
+
"splines"
|
|
276
|
+
; contour / cntrparam
|
|
277
|
+
; tics axes / modifiers
|
|
278
|
+
"add"
|
|
279
|
+
; text / font / encoding
|
|
280
|
+
"fontscale"
|
|
281
|
+
"utf8"
|
|
282
|
+
; fill / size style
|
|
283
|
+
"empty"
|
|
284
|
+
; layout / spacing / multiplot
|
|
285
|
+
"layout"
|
|
286
|
+
"spacing"
|
|
287
|
+
"frac"
|
|
288
|
+
; color names in style contexts
|
|
289
|
+
"cb"
|
|
290
|
+
; filledcurves axis coordinate (x1, x2, y1, y2 etc.)
|
|
291
|
+
"coordinate"
|
|
292
|
+
; watch-label / surface options
|
|
293
|
+
"point"
|
|
294
|
+
; tics keyword (grid / paxis — covers xtics, ytics, ztics contexts)
|
|
295
|
+
"tics"
|
|
296
|
+
; histogram fill style
|
|
297
|
+
; jitter options
|
|
298
|
+
; key command options
|
|
299
|
+
; paxis label keyword (key("label",3) with default aka="label")
|
|
300
|
+
"label"
|
|
301
|
+
; polar coordinate system and grid option
|
|
302
|
+
; polar grid axis ranges
|
|
303
|
+
"theta"
|
|
304
|
+
"r"
|
|
305
|
+
; ellipses style
|
|
306
|
+
"units"
|
|
307
|
+
; stats output prefix
|
|
308
|
+
"prefix"
|
|
309
|
+
; palette formula option
|
|
310
|
+
; pm3d z-clip
|
|
311
|
+
"z"
|
|
312
|
+
; grid mode
|
|
313
|
+
; datafile option
|
|
314
|
+
; textbox / multiplot margins (anonymous "margins" string)
|
|
315
|
+
"margins"
|
|
316
|
+
; datafile lc/fc palette shorthand
|
|
317
|
+
"palette"
|
|
318
|
+
; set fit quiet / results / verbose / brief
|
|
319
|
+
"fit_out"
|
|
320
|
+
] @variable.member
|
|
321
|
+
|
|
322
|
+
; -----------------------------------------------------------------------
|
|
323
|
+
; Presentation / style attributes
|
|
324
|
+
; TODO: decide and collapse
|
|
325
|
+
[
|
|
326
|
+
"size"
|
|
327
|
+
"monochrome"
|
|
328
|
+
"color"
|
|
329
|
+
"transparent"
|
|
330
|
+
; palette colour models (set palette model)
|
|
331
|
+
"RGB"
|
|
332
|
+
"CMY"
|
|
333
|
+
"HSV"
|
|
334
|
+
"nobackground"
|
|
335
|
+
"separator"
|
|
336
|
+
(hull)
|
|
337
|
+
"units_opt"
|
|
338
|
+
; fill / line style modes
|
|
339
|
+
"solid"
|
|
340
|
+
"dashed"
|
|
341
|
+
; page orientation
|
|
342
|
+
"landscape"
|
|
343
|
+
"portrait"
|
|
344
|
+
; terminal options
|
|
345
|
+
"animate"
|
|
346
|
+
"input"
|
|
347
|
+
"colortext"
|
|
348
|
+
"blacktext"
|
|
349
|
+
; point type names (ps/tikz terminals)
|
|
350
|
+
"texpoints"
|
|
351
|
+
"normalpoints"
|
|
352
|
+
"mpoints"
|
|
353
|
+
"smallpoints"
|
|
354
|
+
"tinypoints"
|
|
355
|
+
"pspoints"
|
|
356
|
+
"nopspoints"
|
|
357
|
+
; key alignment (capitalised)
|
|
358
|
+
; layer / style misc
|
|
359
|
+
|
|
360
|
+
"st_opt"
|
|
361
|
+
"plt_st"
|
|
362
|
+
] @attribute
|
|
363
|
+
|
|
364
|
+
|
|
365
|
+
; binary filetype= value (png/jpg/gif/bin parsed as identifier in field)
|
|
366
|
+
(binary_options
|
|
367
|
+
filetype: (identifier) @attribute)
|
|
368
|
+
|
|
369
|
+
; -----------------------------------------------------------------------
|
|
370
|
+
; Macro / datablock identifiers
|
|
371
|
+
(macro) @function.macro
|
|
372
|
+
|
|
373
|
+
(datablock) @module
|
|
374
|
+
|
|
375
|
+
[
|
|
376
|
+
(datablock_start)
|
|
377
|
+
(datablock_end)
|
|
378
|
+
] @label
|
|
379
|
+
|
|
380
|
+
; -----------------------------------------------------------------------
|
|
381
|
+
; Functions
|
|
382
|
+
(function
|
|
383
|
+
name: (identifier) @function)
|
|
384
|
+
|
|
385
|
+
((function
|
|
386
|
+
name: (identifier) @function.builtin)
|
|
387
|
+
(#any-of? @function.builtin
|
|
388
|
+
"abs" "acos" "acosh" "airy" "arg" "asin" "asinh" "atan" "atan2" "atanh" "besj0" "besj1" "besjn"
|
|
389
|
+
"besy0" "besy1" "besyn" "besi0" "besi1" "besin" "cbrt" "ceil" "conj" "cos" "cosh" "EllipticK"
|
|
390
|
+
"EllipticE" "EllipticPi" "erf" "erfc" "exp" "expint" "floor" "gamma" "ibeta" "inverf" "igamma"
|
|
391
|
+
"imag" "int" "invnorm" "invibeta" "invigamma" "LambertW" "lambertw" "lgamma" "lnGamma" "log"
|
|
392
|
+
"log10" "norm" "rand" "real" "round" "sgn" "sin" "sinh" "sqrt" "SynchrotronF" "tan" "tanh"
|
|
393
|
+
"uigamma" "voigt" "zeta" "cerf" "cdawson" "faddeva" "erfi" "FresnelC" "FresnelS" "VP" "VP_fwhm"
|
|
394
|
+
"Ai" "Bi" "BesselH1" "BesselH2" "BesselJ" "BesselY" "BesselI" "BesselK" "gprintf" "sprintf"
|
|
395
|
+
"strlen" "strstrt" "substr" "strptime" "srtftime" "system" "trim" "word" "words" "time"
|
|
396
|
+
"timecolumn" "tm_hour" "tm_mday" "tm_min" "tm_mon" "tm_sec" "tm_wday" "tm_week" "tm_yday"
|
|
397
|
+
"tm_year" "weekday_iso" "weekday_cdc" "column" "columnhead" "exists" "hsv2rgb" "index" "palette"
|
|
398
|
+
"rgbcolor" "stringcolumn" "valid" "value" "voxel"))
|
|
399
|
+
|
|
400
|
+
; -----------------------------------------------------------------------
|
|
401
|
+
; Built-in variables (stats output, GPVAL_*, etc.)
|
|
402
|
+
((identifier) @variable.builtin
|
|
403
|
+
(#match? @variable.builtin
|
|
404
|
+
"^\\w+_(records|headers|outofrange|invalid|blank|blocks|columns|column_header|index_(min|max)(_x|_y)?|(min|max)(_x|_y)?|mean(_err)?(_x|_y)?|stddev(_err)?(_x|_y)?)$"))
|
|
405
|
+
|
|
406
|
+
((identifier) @variable.builtin
|
|
407
|
+
(#match? @variable.builtin
|
|
408
|
+
"^\\w+_(sdd(_x|_y)?|(lo|up)_quartile(_x|_y)?|median(_x|_y)?|sum(sq)?(_x|_y)?|skewness(_err)?(_x|_y)?)$"))
|
|
409
|
+
|
|
410
|
+
((identifier) @variable.builtin
|
|
411
|
+
(#match? @variable.builtin
|
|
412
|
+
"^\\w+_(kurtosis(_err)?(_x|_y)?|adev(_x|_y)?|correlation|slope(_err)?|intercept(_err)?|sumxy|pos_(min|max)_y|size(_x|_y))$"))
|
|
413
|
+
|
|
414
|
+
((identifier) @variable.builtin
|
|
415
|
+
(#match? @variable.builtin
|
|
416
|
+
"^((GPVAL|MOUSE|FIT)_\\w+|GNUTERM|NaN|Inf|VoxelDistance|GridDistance|pi|ARG\\w+)$"))
|
|
417
|
+
|
|
418
|
+
; -----------------------------------------------------------------------
|
|
419
|
+
; Array definitions
|
|
420
|
+
(def_array
|
|
421
|
+
"array" @keyword.function)
|
|
422
|
+
|
|
423
|
+
(array
|
|
424
|
+
(identifier) @function)
|
|
425
|
+
|
|
426
|
+
; -----------------------------------------------------------------------
|
|
427
|
+
; Literals
|
|
428
|
+
(number) @number
|
|
429
|
+
|
|
430
|
+
(string_literal) @string
|
|
431
|
+
|
|
432
|
+
(escape_sequence) @string.escape
|
|
433
|
+
|
|
434
|
+
(format_specifier) @string.special
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
((comment_content) @injection.content
|
|
2
|
+
(#set! injection.language "comment"))
|
|
3
|
+
|
|
4
|
+
; system "command" / ! "command" → bash
|
|
5
|
+
(cmd_system (string_literal) @injection.content
|
|
6
|
+
(#set! injection.language "bash"))
|
|
7
|
+
|
|
8
|
+
; ! ls / system ls → bash (single identifier)
|
|
9
|
+
(cmd_system (identifier) @injection.content
|
|
10
|
+
(#set! injection.language "bash"))
|
|
11
|
+
|
|
12
|
+
; system("command") → bash
|
|
13
|
+
((function
|
|
14
|
+
name: (identifier) @_name
|
|
15
|
+
parameters: (parameter_list (string_literal) @injection.content))
|
|
16
|
+
(#eq? @_name "system")
|
|
17
|
+
(#set! injection.language "bash"))
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: tree-sitter-gnuplot
|
|
3
|
+
Version: 2.0.1
|
|
4
|
+
Summary: A tree-sitter grammar for gnuplot
|
|
5
|
+
Author-email: Dai López Jacinto <dpezto@gmail.com>
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/dpezto/tree-sitter-gnuplot
|
|
8
|
+
Project-URL: Funding, https://github.com/dpezto/tree-sitter-gnuplot
|
|
9
|
+
Keywords: incremental,parsing,tree-sitter,gnuplot
|
|
10
|
+
Classifier: Intended Audience :: Developers
|
|
11
|
+
Classifier: Topic :: Software Development :: Compilers
|
|
12
|
+
Classifier: Topic :: Text Processing :: Linguistic
|
|
13
|
+
Classifier: Typing :: Typed
|
|
14
|
+
Requires-Python: >=3.10
|
|
15
|
+
Description-Content-Type: text/markdown
|
|
16
|
+
License-File: LICENSE
|
|
17
|
+
Provides-Extra: core
|
|
18
|
+
Requires-Dist: tree-sitter~=0.24; extra == "core"
|
|
19
|
+
Dynamic: license-file
|
|
20
|
+
|
|
21
|
+
# tree-sitter-gnuplot
|
|
22
|
+
[](https://github.com/dpezto/tree-sitter-gnuplot/actions/workflows/ci.yml)
|
|
23
|
+
[](https://codecov.io/gh/dpezto/tree-sitter-gnuplot)
|
|
24
|
+
[](https://www.npmjs.com/package/tree-sitter-gnuplot)
|
|
25
|
+
[](https://crates.io/crates/tree-sitter-gnuplot)
|
|
26
|
+
[](https://pypi.org/project/tree-sitter-gnuplot/)
|
|
27
|
+
[](LICENSE)
|
|
28
|
+
[![PRs Welcome][prs-badge]](https://makeapullrequest.com)
|
|
29
|
+
|
|
30
|
+
A tree-sitter grammar for [gnuplot 6.x](http://gnuplot.info).
|
|
31
|
+
|
|
32
|
+
Supports `.gnuplot`, `.gp`, `.plt`, `.plot`, `.gnu` files. Built with an external
|
|
33
|
+
scanner for command disambiguation, comprehensive syntax highlighting queries, and
|
|
34
|
+
92 corpus tests.
|
|
35
|
+
|
|
36
|
+
This project is the next evolution of [gnuplot.vim](https://github.com/dpezto/gnuplot.vim),
|
|
37
|
+
designed for accuracy to gnuplot 6 syntax and long-term maintainability.
|
|
38
|
+
|
|
39
|
+
[prs-badge]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat&logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48c3ZnIGlkPSJzdmcyIiB3aWR0aD0iNjQ1IiBoZWlnaHQ9IjU4NSIgdmVyc2lvbj0iMS4wIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPiA8ZyBpZD0ibGF5ZXIxIj4gIDxwYXRoIGlkPSJwYXRoMjQxNyIgZD0ibTI5Ny4zIDU1MC44N2MtMTMuNzc1LTE1LjQzNi00OC4xNzEtNDUuNTMtNzYuNDM1LTY2Ljg3NC04My43NDQtNjMuMjQyLTk1LjE0Mi03Mi4zOTQtMTI5LjE0LTEwMy43LTYyLjY4NS01Ny43Mi04OS4zMDYtMTE1LjcxLTg5LjIxNC0xOTQuMzQgMC4wNDQ1MTItMzguMzg0IDIuNjYwOC01My4xNzIgMTMuNDEtNzUuNzk3IDE4LjIzNy0zOC4zODYgNDUuMS02Ni45MDkgNzkuNDQ1LTg0LjM1NSAyNC4zMjUtMTIuMzU2IDM2LjMyMy0xNy44NDUgNzYuOTQ0LTE4LjA3IDQyLjQ5My0wLjIzNDgzIDUxLjQzOSA0LjcxOTcgNzYuNDM1IDE4LjQ1MiAzMC40MjUgMTYuNzE0IDYxLjc0IDUyLjQzNiA2OC4yMTMgNzcuODExbDMuOTk4MSAxNS42NzIgOS44NTk2LTIxLjU4NWM1NS43MTYtMTIxLjk3IDIzMy42LTEyMC4xNSAyOTUuNSAzLjAzMTYgMTkuNjM4IDM5LjA3NiAyMS43OTQgMTIyLjUxIDQuMzgwMSAxNjkuNTEtMjIuNzE1IDYxLjMwOS02NS4zOCAxMDguMDUtMTY0LjAxIDE3OS42OC02NC42ODEgNDYuOTc0LTEzNy44OCAxMTguMDUtMTQyLjk4IDEyOC4wMy01LjkxNTUgMTEuNTg4LTAuMjgyMTYgMS44MTU5LTI2LjQwOC0yNy40NjF6IiBmaWxsPSIjZGQ1MDRmIi8%2BIDwvZz48L3N2Zz4%3D
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
tree_sitter_gnuplot/__init__.py,sha256=CAJjsYyj5nGeAwbqq4N5OLvuoz7Z_dJKmrC5E4XFMXc,1158
|
|
2
|
+
tree_sitter_gnuplot/__init__.pyi,sha256=oixFm8lXsZZWYa5cRwj6brbqh37_fzN2rLE-dmX9_rA,247
|
|
3
|
+
tree_sitter_gnuplot/_binding.pyd,sha256=2zfceZNWLrzD28YDAkyI4hskiYxdm7kk2LLkbSRIOvQ,9722368
|
|
4
|
+
tree_sitter_gnuplot/binding.c,sha256=Oaun8hGMrnTMxNv2kaVsgsnLAAHYmyBrxoAUW5nBXjI,838
|
|
5
|
+
tree_sitter_gnuplot/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
|
+
tree_sitter_gnuplot/queries/folds.scm,sha256=UzbJxDZv27jSTG1dFVdX6x6dLt6iDyAv0lm-ti3hA9o,206
|
|
7
|
+
tree_sitter_gnuplot/queries/highlights.scm,sha256=oPtV43QJYVune6tS1qbtFbb98eyS0cJJlM5I7b3snT8,9007
|
|
8
|
+
tree_sitter_gnuplot/queries/injections.scm,sha256=5tMAWf6xu4UKtA8UHmQr-iEgbFLv83cNqUztid1Il9E,539
|
|
9
|
+
tree_sitter_gnuplot-2.0.1.dist-info/licenses/LICENSE,sha256=JicS0klC2zmi4MYqZ2l2O-RtiaDNmGZbB1b1R7SW3j8,1067
|
|
10
|
+
tree_sitter_gnuplot-2.0.1.dist-info/METADATA,sha256=X5eenm6dFCh7-jkBj6rsbBLDsmAcvUVeiF-rcGPNG_0,3157
|
|
11
|
+
tree_sitter_gnuplot-2.0.1.dist-info/WHEEL,sha256=XlJt-paDlwt9Vblfolqc_jr5kwZKZYFtPoH2cpntmEQ,100
|
|
12
|
+
tree_sitter_gnuplot-2.0.1.dist-info/top_level.txt,sha256=_f58jJDLXI9UyucwwXKyMA0vHZ2aTtoLG5yg_LP2vHs,29
|
|
13
|
+
tree_sitter_gnuplot-2.0.1.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023 Dai López
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|