@@ -14,14 +14,25 @@ endif
14
14
let b: current_syntax = " hy"
15
15
16
16
syntax keyword hyAnaphoric ap- if ap- each ap- each- while ap- map ap- map- when
17
- \ ap - filter ap - reject ap - dotimes ap - first ap - last ap - reduce ap - pipe
18
- \ ap - compose
17
+ \ ap - filter ap - reject ap - dotimes ap - first ap - last ap - reduce
18
+ \ ap - when ap - with
19
19
20
+ " as of hy 1.0.0
20
21
syntax keyword hyBuiltin
21
- \ and assoc block block- ret butlast chain chainc coll? constantly
22
- \ count cut dec del doc distinct doto drop - last filter flatten get
23
- \ is is- not is_not islice let list - n map of or quasiquote quote
24
- \ range reduce rest setv setx slice tee unquote unquote-splice xor zip
22
+ \ annotate as - model chainc del dfor gensym get - macro gfor let lfor
23
+ \ local- macros macroexpand macroexpand- 1 mangle py pys quasiquote
24
+ \ quote read read - many repr repr- register setv setx sfor unmangle
25
+ \ unpack- iterable unpack- mapping unquote unquote- splice
26
+
27
+ " as of hyrule 0.6.0
28
+ syntax keyword hyHyruleBuiltin
29
+ \ ameth assoc block butlast cfor coll? comment constantly dec
30
+ \ defmacro! defmacro- kwargs defmain defn+ defn/a + defseq dict = :
31
+ \ distinct do - n doto drop - last end - sequence flatten fn+ fn/a +
32
+ \ import - path inc let + list - n macroexpand- all map -model
33
+ \ match-fn-params meth ncut parse-args pformat postwalk pp pprint
34
+ \ prewalk profile/calls profile/cpu readable? recursive? rest
35
+ \ saferepr seq setv+ sign smacrolet thru walk with-gensyms xor
25
36
26
37
" Derived from vim's python syntax file
27
38
syntax keyword hyPythonBuiltin
@@ -35,6 +46,8 @@ syntax keyword hyPythonBuiltin
35
46
\ --import-- __import__ --all-- __all__ --doc-- __doc__ --name--
36
47
\ __name__
37
48
49
+ syntax keyword hyAsync await
50
+
38
51
syntax keyword hyBoolean True False
39
52
40
53
syntax keyword hyConstant None Ellipsis NotImplemented Inf NaN
@@ -54,39 +67,20 @@ syntax keyword hyException ArithmeticError AssertionError AttributeError
54
67
\ BytesWarning IndentationError ResourceWarning TabError
55
68
56
69
syntax keyword hyStatement
57
- \ return
58
- \ break continue
59
- \ do progn
60
- \ print
61
- \ yield yield- from
62
- \ with with* with/a
63
- \ with- gensyms
64
- \ global nonlocal
65
- \ not
66
- \ in not- in
67
- \ lambda fn
68
-
69
- syntax keyword hyRepeat
70
- \ loop recur for for *
71
- \ while
70
+ \ break continue do fn global nonlocal return with yield
71
+
72
+ syntax keyword hyRepeat loop for while
72
73
73
74
syntax keyword hyConditional
74
- \ if lif else
75
- \ unless when
76
- \ cond branch ebranch case ecase
77
- \ match
75
+ \ branch case cond ebranch ecase else if lif match unless when
78
76
79
- syntax keyword hySpecial
80
- \ self
77
+ syntax keyword hySpecial self
81
78
82
- syntax keyword hyMisc
83
- \ eval
84
- \ eval - and - compile eval - when- compile do - mac
85
- \ apply kwapply
79
+ syntax keyword hyMisc do- mac eval eval- and- compile eval- when- compile pragma
86
80
87
- syntax keyword hyErrorHandling except try throw raise catch finally assert
81
+ syntax keyword hyErrorHandling assert except except * finally raise try
88
82
89
- syntax keyword hyInclude import require export
83
+ syntax keyword hyInclude export import require
90
84
91
85
" Not used at this moment
92
86
" syntax keyword hyVariable
@@ -120,8 +114,8 @@ syntax match hySymbol "\v%([a-zA-Z!$&*_+=|<.>?-]|[^\x00-\x7F])+%(:?%([a-zA-Z0-9!
120
114
" for any custom def-* macros
121
115
syntax match hyDefine / \v [(]@<=def(ault)@!\S +/
122
116
123
- syntax match hyOpNoInplace " \M\<\( =\| !=\| .\| ,\| ->\| ->>\| as->\)\> "
124
- syntax match hyOpInplace " \M\<\( !\| %\| &\| *\| **\| +\| -\| /\| //\| <\| <<\| >\| >>\| ^\| |\) =\?\> "
117
+ syntax match hyOpNoInplace " \M\<\( =\| !=\| .\| ,\| ->\| ->>\| as->\| some-> \ )\>"
118
+ syntax match hyOpInplace " \M\<\( !\| %\| &\| *\| **\| +\| -\| /\| //\| <\| <<\| >\| >>\| ^\| |\| and \| bnot \| cut \| get \| in \| is \| is-not \| not \| not-in \| or \| of \ ) =\?\> "
125
119
126
120
" Number highlighting taken from vim's syntax/python.vim,
127
121
" but modified to allow leading 0
@@ -140,7 +134,7 @@ syntax match hyQuote "'"
140
134
syntax match hyQuote " `"
141
135
syntax match hyUnquote " \~ "
142
136
syntax match hyUnquote " \~ @"
143
- syntax match hyTagMacro " \v #[^:[][[:keyword:].]*"
137
+ syntax match hyReaderMacro " \v #[^:[][[:keyword:].]*"
144
138
syntax match hyDispatch " \v #[\^ /]"
145
139
syntax match hyDispatch " \v #_>"
146
140
syntax match hyUnpack " \v #\* {1,2}"
@@ -230,9 +224,10 @@ highlight default link hyAsync Define
230
224
highlight default link hyErrorHandling Exception
231
225
highlight default link hyException Type
232
226
highlight default link hyBuiltin Function
227
+ highlight default link hyHyruleBuiltin Function
233
228
highlight default link hyPythonBuiltin Function
234
229
highlight default link hyAnaphoric Macro
235
- highlight default link hyTagMacro Macro
230
+ highlight default link hyReaderMacro Macro
236
231
highlight default link hyKeywordMacro Macro
237
232
highlight default link hyKeywordMacroKeyword Identifier
238
233
highlight default link hyRepeat Repeat
@@ -327,12 +322,12 @@ endfor
327
322
if get (g: , " hy_conceal_fancy" , 0 ) == 1
328
323
syntax match hyAnonVar " \< x[0-9]\+\> " contains =hyAnonVarName,hyAnonVarIndex
329
324
syntax keyword hyAnonVar xi conceal cchar =ξ
330
- syntax match hyTagMacro " #%" conceal cchar =ξ
325
+ syntax match hyReaderMacro " #%" conceal cchar =ξ
331
326
else
332
327
syntax match hyAnonVarIndex " i" conceal cchar =¡ contained
333
- syntax match hyTagMacro contained " #" conceal cchar =x
328
+ syntax match hyReaderMacro contained " #" conceal cchar =x
334
329
syntax match hyAnonArg contained " %" conceal cchar =¡
335
- syntax match hyTagMacro " #%" contains =hyTagMacro ,hyAnonArg
330
+ syntax match hyReaderMacro " #%" contains =hyReaderMacro ,hyAnonArg
336
331
syntax match hyAnonVar " \< x[0-9i]\+\> " contains =hyAnonVarName,hyAnonVarIndex
337
332
endif
338
333
0 commit comments