-
Notifications
You must be signed in to change notification settings - Fork 0
/
parsimonious.lang
72 lines (60 loc) · 2.01 KB
/
parsimonious.lang
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
<?xml version="1.0" encoding="UTF-8"?>
<!--
This file is part of GtkSourceView.
This is the syntax highlighting for Parsimonious <https://github.com/erikrose/parsimonious>.
Licence: WTFPL 2.0
-->
<language id="parsimonious" name="Parsimonious" version="2.0" _section="Other">
<metadata>
<property name="line-comment-start">#</property>
</metadata>
<styles>
<style id="escape" name="Escaped Character" map-to="def:special-char"/>
<style id="string" name="String" map-to="def:string"/>
<style id="regex" name="Regular Expression" map-to="def:string"/>
</styles>
<definitions>
<!--contexts NOT used in the main context-->
<context id="escape" style-ref="escape">
<match>\\(['"\\abfnrtv]|x[0-9A-Fa-f]{2}|[0-7]{1,3}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8}|N\{[A-Za-z ]+\}|.)</match>
</context>
<!--contexts used in the main context-->
<context id="class" style-ref="regex">
<start extended="true">
~u?r?"
(?=
[^"\\]*(?:\\.[^"\\]*)*
"
[ilmsux]*
)</start>
<end>"[ilmsux]*</end>
<include>
<context ref="escape"/>
</include>
</context>
<context id="string" style-ref="string" end-at-line-end="true" class="string" class-disabled="no-spell-check">
<start>"</start>
<end>"</end>
<include>
<context ref="escape"/>
</include>
</context>
<context id="single-quoted-string" style-ref="string" end-at-line-end="true" class="string" class-disabled="no-spell-check">
<start>"</start>
<end>"</end>
<include>
<context ref="escape"/>
</include>
</context>
<!--main context-->
<context id="parsimonious" class="no-spell-check">
<include>
<context ref="def:shell-like-comment"/>
<context ref="string"/>
<context ref="single-quoted-string"/>
<context ref="class"/>
</include>
</context>
<!--main context-->
</definitions>
</language>