]>
luflow.net public git repositories - flow-web.git/blob - static/highlight/languages/hy.js
1 /*! `hy` grammar compiled for Highlight.js 11.11.1 */
3 var hljsGrammar
= (function () {
8 Description: Hy is a wonderful dialect of Lisp that’s embedded in Python.
9 Author: Sergey Sobko <s.sobko@profitware.ru>
10 Website: http://docs.hylang.org/en/stable/
15 const SYMBOLSTART
= 'a-zA-Z_\\-!.?+*=<>&#\'';
16 const SYMBOL_RE
= '[' + SYMBOLSTART
+ '][' + SYMBOLSTART
+ '0-9/;:]*';
21 '!= % %= & &= * ** **= *= *map '
22 + '+ += , --build-class-- --import-- -= . / // //= '
23 + '/= < << <<= <= = > >= >> >>= '
24 + '@ @= ^ ^= abs accumulate all and any ap-compose '
25 + 'ap-dotimes ap-each ap-each-while ap-filter ap-first ap-if ap-last ap-map ap-map-when ap-pipe '
26 + 'ap-reduce ap-reject apply as-> ascii assert assoc bin break butlast '
27 + 'callable calling-module-name car case cdr chain chr coll? combinations compile '
28 + 'compress cond cons cons? continue count curry cut cycle dec '
29 + 'def default-method defclass defmacro defmacro-alias defmacro/g! defmain defmethod defmulti defn '
30 + 'defn-alias defnc defnr defreader defseq del delattr delete-route dict-comp dir '
31 + 'disassemble dispatch-reader-macro distinct divmod do doto drop drop-last drop-while empty? '
32 + 'end-sequence eval eval-and-compile eval-when-compile even? every? except exec filter first '
33 + 'flatten float? fn fnc fnr for for* format fraction genexpr '
34 + 'gensym get getattr global globals group-by hasattr hash hex id '
35 + 'identity if if* if-not if-python2 import in inc input instance? '
36 + 'integer integer-char? integer? interleave interpose is is-coll is-cons is-empty is-even '
37 + 'is-every is-float is-instance is-integer is-integer-char is-iterable is-iterator is-keyword is-neg is-none '
38 + 'is-not is-numeric is-odd is-pos is-string is-symbol is-zero isinstance islice issubclass '
39 + 'iter iterable? iterate iterator? keyword keyword? lambda last len let '
40 + 'lif lif-not list* list-comp locals loop macro-error macroexpand macroexpand-1 macroexpand-all '
41 + 'map max merge-with method-decorator min multi-decorator multicombinations name neg? next '
42 + 'none? nonlocal not not-in not? nth numeric? oct odd? open '
43 + 'or ord partition permutations pos? post-route postwalk pow prewalk print '
44 + 'product profile/calls profile/cpu put-route quasiquote quote raise range read read-str '
45 + 'recursive-replace reduce remove repeat repeatedly repr require rest round route '
46 + 'route-with-methods rwm second seq set-comp setattr setv some sorted string '
47 + 'string? sum switch symbol? take take-nth take-while tee try unless '
48 + 'unquote unquote-splicing vars walk when while with with* with-decorator with-gensyms '
49 + 'xi xor yield yield-from zero? zip zip-longest | |= ~'
52 const SIMPLE_NUMBER_RE
= '[-+]?\\d+(\\.\\d+)?';
60 begin: SIMPLE_NUMBER_RE
,
63 const STRING
= hljs
.inherit(hljs
.QUOTE_STRING_MODE
, { illegal: null });
64 const COMMENT
= hljs
.COMMENT(
71 begin: /\b([Tt]rue|[Ff]alse|nil|None)\b/
80 begin: '\\^' + SYMBOL_RE
82 const HINT_COL
= hljs
.COMMENT('\\^\\{', '\\}');
85 begin: '[:]{1,2}' + SYMBOL_RE
102 const DEFAULT_CONTAINS
= [
116 hljs
.COMMENT('comment', ''),
120 BODY
.contains
= DEFAULT_CONTAINS
;
121 COLLECTION
.contains
= DEFAULT_CONTAINS
;
125 aliases: [ 'hylang' ],
146 hljs
.registerLanguage('hy', hljsGrammar
);