1
+ %YAML 1.2
2
+ # See https://www.sublimetext.com/docs/syntax.htm
3
+ ---
4
+ name : ion
5
+ version : " 2"
6
+ file_extensions :
7
+ - ion
8
+ scope : source.ion
9
+ contexts :
10
+ keywords :
11
+ - match : " \\ b(?i:true|false)\\ b"
12
+ scope : constant.language.bool.ion
13
+ - match : " \\ b(?i:null.null|null.bool|null.int|null.float|null.decimal|null.timestamp|null.string|null.symbol|null.blob|null.clob|null.struct|null.list|null.sexp|null)\\ b"
14
+ scope : constant.language.null.ion
15
+ main :
16
+ - include : value
17
+ value :
18
+ - include : whitespace
19
+ - include : comment
20
+ - include : annotation
21
+ - include : string
22
+ - include : number
23
+ - include : keywords
24
+ - include : symbol
25
+ - include : clob
26
+ - include : blob
27
+ - include : struct
28
+ - include : list
29
+ - include : sexp
30
+ sexp :
31
+ - match : " \\ ("
32
+ scope : punctuation.definition.sexp.begin.ion
33
+ push : sexp__0
34
+ sexp__0 :
35
+ - match : " \\ )"
36
+ scope : punctuation.definition.sexp.end.ion
37
+ pop : true
38
+ - include : comment
39
+ - include : value
40
+ - match : " [\\ !\\ #\\ %\\ &\\ *\\ +\\ -\\ .\\ /\\ ;\\ <\\ =\\ >\\ ?\\ @\\ ^\\ `\\ |\\ ~]+"
41
+ scope : storage.type.symbol.operator.ion
42
+ comment :
43
+ - match : " \\ /\\ /[^\\ n]*"
44
+ scope : comment.line.ion
45
+ - match : " \\ /\\ *"
46
+ scope : comment.block.ion
47
+ push : comment__1
48
+ comment__1 :
49
+ - match : " [*]\\ /"
50
+ scope : comment.block.ion
51
+ pop : true
52
+ - match : " [^*\\ /]+"
53
+ scope : comment.block.ion
54
+ - match : " [*\\ /]+"
55
+ scope : comment.block.ion
56
+ list :
57
+ - match : " \\ ["
58
+ scope : punctuation.definition.list.begin.ion
59
+ push : list__0
60
+ list__0 :
61
+ - match : " \\ ]"
62
+ scope : punctuation.definition.list.end.ion
63
+ pop : true
64
+ - include : comment
65
+ - include : value
66
+ - match : " ,"
67
+ scope : punctuation.definition.list.separator.ion
68
+ struct :
69
+ - match : " \\ {"
70
+ scope : punctuation.definition.struct.begin.ion
71
+ push : struct__0
72
+ struct__0 :
73
+ - match : " \\ }"
74
+ scope : punctuation.definition.struct.end.ion
75
+ pop : true
76
+ - include : comment
77
+ - include : value
78
+ - match : " ,|:"
79
+ scope : punctuation.definition.struct.separator.ion
80
+ blob :
81
+ - match : " (\\ {\\ {)([^\" ]*)(\\ }\\ })"
82
+ captures :
83
+ 1 : punctuation.definition.blob.begin.ion
84
+ 2 : string.other.blob.ion
85
+ 3 : punctuation.definition.blob.end.ion
86
+ clob :
87
+ - match : " (\\ {\\ {)(\" [^\" ]*\" )(\\ }\\ })"
88
+ captures :
89
+ 1 : punctuation.definition.clob.begin.ion
90
+ 2 : string.other.clob.ion
91
+ 3 : punctuation.definition.clob.end.ion
92
+ symbol :
93
+ - match : " (['])((?:(?:\\\\ ')|(?:[^']))*?)(['])"
94
+ scope : storage.type.symbol.quoted.ion
95
+ - match : " [\\ $_a-zA-Z][\\ $_a-zA-Z0-9]*"
96
+ scope : storage.type.symbol.identifier.ion
97
+ number :
98
+ - match : " \\ d{4}(?:-\\ d{2})?(?:-\\ d{2})?T(?:\\ d{2}:\\ d{2})(?::\\ d{2})?(?:\\ .\\ d+)?(?:Z|[-+]\\ d{2}:\\ d{2})?"
99
+ scope : constant.numeric.timestamp.ion
100
+ - match : " \\ d{4}-\\ d{2}-\\ d{2}T?"
101
+ scope : constant.numeric.timestamp.ion
102
+ - match : " -?0[bB][01](?:_?[01])*"
103
+ scope : constant.numeric.integer.binary.ion
104
+ - match : " -?0[xX][0-9a-fA-F](?:_?[0-9a-fA-F])*"
105
+ scope : constant.numeric.integer.hex.ion
106
+ - match : " -?(?:0|[1-9](?:_?\\ d)*)(?:\\ .(?:\\ d(?:_?\\ d)*)?)?(?:[eE][+-]?\\ d+)"
107
+ scope : constant.numeric.float.ion
108
+ - match : " (?:[-+]inf)|(?:nan)"
109
+ scope : constant.numeric.float.ion
110
+ - match : " -?(?:0|[1-9](?:_?\\ d)*)(?:(?:(?:\\ .(?:\\ d(?:_?\\ d)*)?)(?:[dD][+-]?\\ d+)|\\ .(?:\\ d(?:_?\\ d)*)?)|(?:[dD][+-]?\\ d+))"
111
+ scope : constant.numeric.decimal.ion
112
+ - match : " -?(?:0|[1-9](?:_?\\ d)*)"
113
+ scope : constant.numeric.integer.ion
114
+ string :
115
+ - match : " ([\" ])((?:(?:\\\\\" )|(?:[^\" ]))*?)([\" ])"
116
+ captures :
117
+ 1 : punctuation.definition.string.begin.ion
118
+ 2 : string.quoted.double.ion
119
+ 3 : punctuation.definition.string.end.ion
120
+ - match : " '{3}"
121
+ scope : punctuation.definition.string.begin.ion
122
+ push : string__1
123
+ string__1 :
124
+ - match : " '{3}"
125
+ scope : punctuation.definition.string.end.ion
126
+ pop : true
127
+ - match : " (?:\\\\ '|[^'])+"
128
+ scope : string.quoted.triple.ion
129
+ - match : " '"
130
+ scope : string.quoted.triple.ion
131
+ annotation :
132
+ - match : " ('(?:[^']|\\\\\\\\ |\\\\ ')*')\\ s*(::)"
133
+ captures :
134
+ 1 : variable.language.annotation.ion
135
+ 2 : punctuation.definition.annotation.ion
136
+ - match : " ([\\ $_a-zA-Z][\\ $_a-zA-Z0-9]*)\\ s*(::)"
137
+ captures :
138
+ 1 : variable.language.annotation.ion
139
+ 2 : punctuation.definition.annotation.ion
140
+ whitespace :
141
+ - match : " \\ s+"
142
+ scope : text.ion
0 commit comments