xref: /vim-8.2.3635/runtime/syntax/julia.vim (revision 6aa57295)
1" Vim syntax file
2" Language:	julia
3" Maintainer:	Carlo Baldassi <[email protected]>
4" Homepage:	https://github.com/JuliaEditorSupport/julia-vim
5" Last Change:	2021 Aug 04
6
7if version < 600
8  syntax clear
9elseif exists("b:current_syntax")
10  finish
11endif
12
13let s:cpo_save = &cpo
14set cpo&vim
15
16if version < 704
17  " this is used to disable regex syntax like `\@3<='
18  " on older vim versions
19  function! s:d(x)
20    return ''
21  endfunction
22else
23  function! s:d(x)
24    return string(a:x)
25  endfunction
26endif
27
28scriptencoding utf-8
29
30let s:julia_spellcheck_strings = get(g:, "julia_spellcheck_strings", 0)
31let s:julia_spellcheck_docstrings = get(g:, "julia_spellcheck_docstrings", 1)
32let s:julia_spellcheck_comments = get(g:, "julia_spellcheck_comments", 1)
33
34let s:julia_highlight_operators = get(g:, "julia_highlight_operators", 1)
35
36" List of characters, up to \UFF, which cannot be used in identifiers.
37" (It includes operator characters; we don't consider them identifiers.)
38" This is used mostly in lookbehinds with `\@<=`, e.g. when we need to check
39" that that we're not in the middle of an identifier.
40" It doesn't include a few characters (spaces and all closing parentheses)
41" because those may or may not be valid in the lookbehind on a case-by-case
42" basis.
43let s:nonid_chars = '\U00-\U08' . '\U0A-\U1F'
44      \             . '\U21-\U28' . '\U2A-\U2F' . '\U3A-\U40' . '\U5B-\U5E' . '\U60' . '\U7B\U7C'
45      \             . '\U7E-\UA1' . '\UA7\UA8' . '\UAB-\UAD' . '\UAF\UB1\UB4' . '\UB6-\UB8' . '\UBB\UBF' . '\UD7\UF7'
46
47" The complete list
48let s:nonidS_chars = '[:space:])\U5D}' . s:nonid_chars
49
50
51" List of all valid operator chars up to \UFF (NOTE: they must all be included
52" in s:nonidS_chars, so that if we include that, then this is redundant)
53" It does not include '!' since it can be used in an identifier.
54" The list contains the following characters: '%&*+-/<=>\\^|~¬±×÷'
55let s:op_chars = '\U25\U26\U2A\U2B\U2D\U2F\U3C-\U3E\U5C\U5E\U7C\U7E\UAC\UB1\UD7\UF7'
56
57" List of all valid operator chars above \UFF
58" Written with ranges for performance reasons
59" The list contains the following characters: '…⁝⅋←↑→↓↔↚↛↜↝↞↠↢↣↤↦↩↪↫↬↮↶↷↺↻↼↽⇀⇁⇄⇆⇇⇉⇋⇌⇍⇎⇏⇐⇒⇔⇚⇛⇜⇝⇠⇢⇴⇵⇶⇷⇸⇹⇺⇻⇼⇽⇾⇿∈∉∊∋∌∍∓∔∗∘∙√∛∜∝∤∥∦∧∨∩∪∷∸∺∻∽∾≀≁≂≃≄≅≆≇≈≉≊≋≌≍≎≏≐≑≒≓≔≕≖≗≘≙≚≛≜≝≞≟≠≡≢≣≤≥≦≧≨≩≪≫≬≭≮≯≰≱≲≳≴≵≶≷≸≹≺≻≼≽≾≿⊀⊁⊂⊃⊄⊅⊆⊇⊈⊉⊊⊋⊍⊎⊏⊐⊑⊒⊓⊔⊕⊖⊗⊘⊙⊚⊛⊜⊞⊟⊠⊡⊢⊣⊩⊬⊮⊰⊱⊲⊳⊴⊵⊶⊷⊻⊼⊽⋄⋅⋆⋇⋉⋊⋋⋌⋍⋎⋏⋐⋑⋒⋓⋕⋖⋗⋘⋙⋚⋛⋜⋝⋞⋟⋠⋡⋢⋣⋤⋥⋦⋧⋨⋩⋪⋫⋬⋭⋮⋯⋰⋱⋲⋳⋴⋵⋶⋷⋸⋹⋺⋻⋼⋽⋾⋿⌿▷⟂⟈⟉⟑⟒⟕⟖⟗⟰⟱⟵⟶⟷⟹⟺⟻⟼⟽⟾⟿⤀⤁⤂⤃⤄⤅⤆⤇⤈⤉⤊⤋⤌⤍⤎⤏⤐⤑⤒⤓⤔⤕⤖⤗⤘⤝⤞⤟⤠⥄⥅⥆⥇⥈⥉⥊⥋⥌⥍⥎⥏⥐⥑⥒⥓⥔⥕⥖⥗⥘⥙⥚⥛⥜⥝⥞⥟⥠⥡⥢⥣⥤⥥⥦⥧⥨⥩⥪⥫⥬⥭⥮⥯⥰⦷⦸⦼⦾⦿⧀⧁⧡⧣⧤⧥⧴⧶⧷⧺⧻⨇⨈⨝⨟⨢⨣⨤⨥⨦⨧⨨⨩⨪⨫⨬⨭⨮⨰⨱⨲⨳⨴⨵⨶⨷⨸⨹⨺⨻⨼⨽⩀⩁⩂⩃⩄⩅⩊⩋⩌⩍⩎⩏⩐⩑⩒⩓⩔⩕⩖⩗⩘⩚⩛⩜⩝⩞⩟⩠⩡⩢⩣⩦⩧⩪⩫⩬⩭⩮⩯⩰⩱⩲⩳⩴⩵⩶⩷⩸⩹⩺⩻⩼⩽⩾⩿⪀⪁⪂⪃⪄⪅⪆⪇⪈⪉⪊⪋⪌⪍⪎⪏⪐⪑⪒⪓⪔⪕⪖⪗⪘⪙⪚⪛⪜⪝⪞⪟⪠⪡⪢⪣⪤⪥⪦⪧⪨⪩⪪⪫⪬⪭⪮⪯⪰⪱⪲⪳⪴⪵⪶⪷⪸⪹⪺⪻⪼⪽⪾⪿⫀⫁⫂⫃⫄⫅⫆⫇⫈⫉⫊⫋⫌⫍⫎⫏⫐⫑⫒⫓⫔⫕⫖⫗⫘⫙⫛⫷⫸⫹⫺⬰⬱⬲⬳⬴⬵⬶⬷⬸⬹⬺⬻⬼⬽⬾⬿⭀⭁⭂⭃⭄⭇⭈⭉⭊⭋⭌←↑→↓'
60let s:op_chars_wc = '\U2026\U205D\U214B\U2190-\U2194\U219A-\U219E\U21A0\U21A2-\U21A4\U21A6\U21A9-\U21AC\U21AE\U21B6\U21B7\U21BA-\U21BD\U21C0\U21C1\U21C4\U21C6\U21C7\U21C9\U21CB-\U21D0\U21D2\U21D4\U21DA-\U21DD\U21E0\U21E2\U21F4-\U21FF\U2208-\U220D\U2213\U2214\U2217-\U221D\U2224-\U222A\U2237\U2238\U223A\U223B\U223D\U223E\U2240-\U228B\U228D-\U229C\U229E-\U22A3\U22A9\U22AC\U22AE\U22B0-\U22B7\U22BB-\U22BD\U22C4-\U22C7\U22C9-\U22D3\U22D5-\U22FF\U233F\U25B7\U27C2\U27C8\U27C9\U27D1\U27D2\U27D5-\U27D7\U27F0\U27F1\U27F5-\U27F7\U27F9-\U27FF\U2900-\U2918\U291D-\U2920\U2944-\U2970\U29B7\U29B8\U29BC\U29BE-\U29C1\U29E1\U29E3-\U29E5\U29F4\U29F6\U29F7\U29FA\U29FB\U2A07\U2A08\U2A1D\U2A1F\U2A22-\U2A2E\U2A30-\U2A3D\U2A40-\U2A45\U2A4A-\U2A58\U2A5A-\U2A63\U2A66\U2A67\U2A6A-\U2AD9\U2ADB\U2AF7-\U2AFA\U2B30-\U2B44\U2B47-\U2B4C\UFFE9-\UFFEC'
61
62" Full operators regex
63let s:operators = '\%(' . '\.\%([-+*/^÷%|&⊻]\|//\|\\\|>>\|>>>\?\)\?=' .
64      \           '\|'  . '[:<>]=\|||\|&&\||>\|<|\|[<>:]:\|<<\|>>>\?\|//\|[-=]>\|\.\.\.\?' .
65      \           '\|'  . '\.\?[!' . s:op_chars . s:op_chars_wc . ']' .
66      \           '\)'
67
68
69" Characters that can be used to start an identifier. Above \UBF we don't
70" bother checking. (If a UTF8 operator is used, it will take precedence anyway.)
71let s:id_charsH = '\%([A-Za-z_\UA2-\UA6\UA9\UAA\UAE\UB0\UB5\UBA]\|[^\U00-\UBF]\)'
72" Characters that can appear in an identifier, starting in 2nd position. Above
73" \UBF we check for operators since we need to stop the identifier if one
74" appears. We don't check for invalid characters though.
75let s:id_charsW = '\%([0-9A-Za-z_!\UA2-\UA6\UA9\UAA\UAE-\UB0\UB2-\UB5\UB8-\UBA\UBC-\UBE]\|[^\U00-\UBF]\@=[^' . s:op_chars_wc . ']\)'
76
77" A valid julia identifier, more or less
78let s:idregex = '\%(' . s:id_charsH . s:id_charsW . '*\)'
79
80
81
82syn case match
83
84syntax cluster juliaExpressions		contains=@juliaParItems,@juliaStringItems,@juliaKeywordItems,@juliaBlocksItems,@juliaTypesItems,@juliaConstItems,@juliaMacroItems,@juliaSymbolItems,@juliaOperatorItems,@juliaNumberItems,@juliaCommentItems,@juliaErrorItems,@juliaSyntaxRegions
85syntax cluster juliaExprsPrintf		contains=@juliaExpressions,@juliaPrintfItems
86syntax cluster juliaExprsNodot		contains=@juliaParItems,@juliaStringItems,@juliaMacroItems,@juliaSymbolItems,@juliaOperatorItems,@juliaCommentItems,juliaIdSymbol
87
88syntax cluster juliaParItems		contains=juliaParBlock,juliaSqBraIdxBlock,juliaSqBraBlock,juliaCurBraBlock,juliaQuotedParBlock,juliaQuotedQMarkPar
89syntax cluster juliaKeywordItems	contains=juliaKeyword,juliaWhereKeyword,juliaImportLine,juliaInfixKeyword,juliaRepKeyword
90syntax cluster juliaBlocksItems		contains=juliaConditionalBlock,juliaWhileBlock,juliaForBlock,juliaBeginBlock,juliaFunctionBlock,juliaMacroBlock,juliaQuoteBlock,juliaTypeBlock,juliaImmutableBlock,juliaExceptionBlock,juliaLetBlock,juliaDoBlock,juliaModuleBlock,juliaStructBlock,juliaMutableStructBlock,juliaAbstractBlock,juliaPrimitiveBlock
91syntax cluster juliaTypesItems		contains=juliaBaseTypeBasic,juliaBaseTypeNum,juliaBaseTypeC,juliaBaseTypeError,juliaBaseTypeIter,juliaBaseTypeString,juliaBaseTypeArray,juliaBaseTypeDict,juliaBaseTypeSet,juliaBaseTypeIO,juliaBaseTypeProcess,juliaBaseTypeRange,juliaBaseTypeRegex,juliaBaseTypeFact,juliaBaseTypeFact,juliaBaseTypeSort,juliaBaseTypeRound,juliaBaseTypeSpecial,juliaBaseTypeRandom,juliaBaseTypeDisplay,juliaBaseTypeTime,juliaBaseTypeOther
92
93syntax cluster juliaConstItems  	contains=juliaConstNum,juliaConstBool,juliaConstEnv,juliaConstMMap,juliaConstC,juliaConstGeneric,juliaConstIO,juliaPossibleEuler
94
95syntax cluster juliaMacroItems		contains=juliaPossibleMacro,juliaDollarVar,juliaDollarPar,juliaDollarSqBra
96syntax cluster juliaSymbolItems		contains=juliaPossibleSymbol
97syntax cluster juliaNumberItems		contains=juliaNumbers
98syntax cluster juliaStringItems		contains=juliaChar,juliaString,juliabString,juliasString,juliaShellString,juliaDocString,juliaRegEx
99syntax cluster juliaPrintfItems		contains=juliaPrintfParBlock,juliaPrintfString
100syntax cluster juliaOperatorItems	contains=juliaOperator,juliaRangeOperator,juliaCTransOperator,juliaTernaryRegion,juliaColon,juliaSemicolon,juliaComma
101syntax cluster juliaCommentItems	contains=juliaCommentL,juliaCommentM
102syntax cluster juliaErrorItems		contains=juliaErrorPar,juliaErrorEnd,juliaErrorElse,juliaErrorCatch,juliaErrorFinally
103
104syntax cluster juliaSyntaxRegions	contains=juliaIdSymbol,juliaTypeOperatorR2,juliaTypeOperatorR3,juliaWhereR,juliaDotted
105
106syntax cluster juliaSpellcheckStrings		contains=@spell
107syntax cluster juliaSpellcheckDocStrings	contains=@spell
108syntax cluster juliaSpellcheckComments		contains=@spell
109
110if !s:julia_spellcheck_docstrings
111  syntax cluster juliaSpellcheckDocStrings	remove=@spell
112endif
113if !s:julia_spellcheck_strings
114  syntax cluster juliaSpellcheckStrings		remove=@spell
115endif
116if !s:julia_spellcheck_comments
117  syntax cluster juliaSpellcheckComments	remove=@spell
118endif
119
120syntax match   juliaSemicolon		display ";"
121syntax match   juliaComma		display ","
122syntax match   juliaColon		display ":"
123
124" A dot can introduce a sort of 'environment' such that words after it are not
125" recognized as keywords. This has low precedence so that it can be overridden
126" by operators
127syntax match   juliaDotted		transparent "\.\s*[^])}.]" contains=@juliaExprsNodot
128syntax match   juliaDottedT		contained transparent "\.\s*[^])}.]" contains=@juliaExprsNodot,juliaType
129
130syntax match   juliaErrorPar		display "[])}]"
131syntax match   juliaErrorEnd		display "\<end\>"
132syntax match   juliaErrorElse		display "\<\%(else\|elseif\)\>"
133syntax match   juliaErrorCatch		display "\<catch\>"
134syntax match   juliaErrorFinally	display "\<finally\>"
135syntax match   juliaErrorSemicol	display contained ";"
136
137syntax region  juliaParBlock		matchgroup=juliaParDelim start="(" end=")" contains=@juliaExpressions,juliaComprehensionFor
138syntax region  juliaParBlockInRange	matchgroup=juliaParDelim contained start="(" end=")" contains=@juliaExpressions,juliaParBlockInRange,juliaRangeKeyword,juliaComprehensionFor
139syntax region  juliaSqBraIdxBlock	matchgroup=juliaParDelim start="\[" end="\]" contains=@juliaExpressions,juliaParBlockInRange,juliaRangeKeyword,juliaComprehensionFor,juliaSymbolS,juliaQuotedParBlockS,juliaQuotedQMarkParS
140exec 'syntax region  juliaSqBraBlock	matchgroup=juliaParDelim start="\%(^\|\s\|' . s:operators . '\)\@'.s:d(3).'<=\[" end="\]" contains=@juliaExpressions,juliaComprehensionFor,juliaSymbolS,juliaQuotedParBlockS,juliaQuotedQMarkParS'
141syntax region  juliaCurBraBlock		matchgroup=juliaParDelim start="{" end="}" contains=juliaType,juliaDottedT,@juliaExpressions
142
143exec 'syntax match   juliaType		contained "\%(' . s:idregex . '\.\)*\zs' . s:idregex . '"'
144
145" This is a generic identifier followed by some symbol, either a type
146" operator (<: or >:), or an open parenthesis, or an open curly bracket.
147" It's used to recognize one of the contained regions looking for identifiers
148" only once. Once recognized, those regions no longer need to use the
149" expensive s:idregex.
150exec 'syntax match   juliaIdSymbol	transparent "' . s:idregex . '\%(\s*[<>]:\|\.\?(\|{\|\"\)\@=" contains=juliaFunctionCall,juliaParamType,juliaStringPrefixed,juliaTypeOperatorR1'
151
152syntax match  juliaFunctionCall		contained "[^{([:space:]<>\"]\+(\@=" nextgroup=juliaParBlock
153
154exec 'syntax match   juliaFunctionDef	contained transparent "\%(\<\%(function\|macro\)\)\@'.s:d(8).'<=\s\+\zs' . s:idregex . '\%(\.' . s:idregex . '\)*\ze\s*\%((\|\send\>\|$\)" contains=juliaFunctionName'
155exec 'syntax match   juliaFunctionName	contained "\%(\<\%(function\|macro\)\s\+\)\@'.s:d(20).'<=\%(' . s:idregex . '\.\)*\zs' . s:idregex . '"'
156
157exec 'syntax match   juliaStructR	contained transparent "\%(\<\%(\%(mutable\s\+\)\?struct\|\%(abstract\|primitive\)\s\+type\)\s\+\)\@'.s:d(20).'<=\%(' . s:idregex . '\.\)*' . s:idregex . '\>\(\s*(\)\@!" contains=juliaType'
158
159syntax match   juliaKeyword		display "\<\%(return\|local\|global\|const\)\>"
160syntax match   juliaInfixKeyword	display "\%(=\s*\)\@<!\<\%(in\|isa\)\>\S\@!\%(\s*=\)\@!"
161
162" The import/export/using keywords introduce a sort of special parsing
163" environment with its own rules
164exec 'syntax region  juliaImportLine		matchgroup=juliaKeyword excludenl start="\<\%(import\|using\|export\)\>" skip="\%(\%(\<\%(import\|using\|export\)\>\)\|^\)\@'.s:d(6).'<=$" end="$" end="\%([])}]\)\@=" contains=@juliaExpressions,juliaAsKeyword,@juliaContinuationItems,juliaMacroName'
165syntax match   juliaAsKeyword		display contained "\<as\>"
166
167syntax match   juliaRepKeyword		display "\<\%(break\|continue\)\>"
168syntax region  juliaConditionalBlock	matchgroup=juliaConditional start="\<if\>" end="\<end\>" contains=@juliaExpressions,juliaConditionalEIBlock,juliaConditionalEBlock fold
169syntax region  juliaConditionalEIBlock	matchgroup=juliaConditional transparent contained start="\<elseif\>" end="\<\%(end\|else\|elseif\)\>"me=s-1 contains=@juliaExpressions,juliaConditionalEIBlock,juliaConditionalEBlock
170syntax region  juliaConditionalEBlock	matchgroup=juliaConditional transparent contained start="\<else\>" end="\<end\>"me=s-1 contains=@juliaExpressions
171syntax region  juliaWhileBlock		matchgroup=juliaRepeat start="\<while\>" end="\<end\>" contains=@juliaExpressions fold
172syntax region  juliaForBlock		matchgroup=juliaRepeat start="\<for\>" end="\<end\>" contains=@juliaExpressions,juliaOuter fold
173syntax region  juliaBeginBlock		matchgroup=juliaBlKeyword start="\<begin\>" end="\<end\>" contains=@juliaExpressions fold
174syntax region  juliaFunctionBlock	matchgroup=juliaBlKeyword start="\<function\>" end="\<end\>" contains=@juliaExpressions,juliaFunctionDef fold
175syntax region  juliaMacroBlock		matchgroup=juliaBlKeyword start="\<macro\>" end="\<end\>" contains=@juliaExpressions,juliaFunctionDef fold
176syntax region  juliaQuoteBlock		matchgroup=juliaBlKeyword start="\<quote\>" end="\<end\>" contains=@juliaExpressions fold
177syntax region  juliaStructBlock		matchgroup=juliaBlKeyword start="\<struct\>" end="\<end\>" contains=@juliaExpressions,juliaStructR fold
178syntax region  juliaMutableStructBlock	matchgroup=juliaBlKeyword start="\<mutable\s\+struct\>" end="\<end\>" contains=@juliaExpressions,juliaStructR fold
179syntax region  juliaLetBlock		matchgroup=juliaBlKeyword start="\<let\>" end="\<end\>" contains=@juliaExpressions fold
180syntax region  juliaDoBlock		matchgroup=juliaBlKeyword start="\<do\>" end="\<end\>" contains=@juliaExpressions fold
181syntax region  juliaModuleBlock		matchgroup=juliaBlKeyword start="\<\%(bare\)\?module\>" end="\<end\>" contains=@juliaExpressions fold
182syntax region  juliaExceptionBlock	matchgroup=juliaException start="\<try\>" end="\<end\>" contains=@juliaExpressions,juliaCatchBlock,juliaFinallyBlock fold
183syntax region  juliaCatchBlock		matchgroup=juliaException transparent contained start="\<catch\>" end="\<end\>"me=s-1 contains=@juliaExpressions,juliaFinallyBlock
184syntax region  juliaFinallyBlock	matchgroup=juliaException transparent contained start="\<finally\>" end="\<end\>"me=s-1 contains=@juliaExpressions
185syntax region  juliaAbstractBlock	matchgroup=juliaBlKeyword start="\<abstract\s\+type\>" end="\<end\>" fold contains=@juliaExpressions,juliaStructR
186syntax region  juliaPrimitiveBlock	matchgroup=juliaBlKeyword start="\<primitive\s\+type\>" end="\<end\>" fold contains=@juliaExpressions,juliaStructR
187
188exec 'syntax region  juliaComprehensionFor	matchgroup=juliaComprehensionFor transparent contained start="\%([^[:space:],;:({[]\_s*\)\@'.s:d(80).'<=\<for\>" end="\ze[]);]" contains=@juliaExpressions,juliaComprehensionIf,juliaComprehensionFor'
189syntax match   juliaComprehensionIf	contained "\<if\>"
190
191exec 'syntax match   juliaOuter		contained "\<outer\ze\s\+' . s:idregex . '\>"'
192
193syntax match   juliaRangeKeyword	contained "\<\%(begin\|end\)\>"
194
195syntax match   juliaBaseTypeBasic	display "\<\%(\%(N\|Named\)\?Tuple\|Symbol\|Function\|Union\%(All\)\?\|Type\%(Name\|Var\)\?\|Any\|ANY\|Vararg\|Ptr\|Exception\|Module\|Expr\|DataType\|\%(LineNumber\|Quote\)Node\|\%(Weak\|Global\)\?Ref\|Method\|Pair\|Val\|Nothing\|Some\|Missing\)\>"
196syntax match   juliaBaseTypeNum		display "\<\%(U\?Int\%(8\|16\|32\|64\|128\)\?\|Float\%(16\|32\|64\)\|Complex\|Bool\|Char\|Number\|Signed\|Unsigned\|Integer\|AbstractFloat\|Real\|Rational\|\%(Abstract\)\?Irrational\|Enum\|BigInt\|BigFloat\|MathConst\|ComplexF\%(16\|32\|64\)\)\>"
197syntax match   juliaBaseTypeC		display "\<\%(FileOffset\|C\%(u\?\%(char\|short\|int\|long\(long\)\?\|w\?string\)\|float\|double\|\%(ptrdiff\|s\?size\|wchar\|off\|u\?intmax\)_t\|void\)\)\>"
198syntax match   juliaBaseTypeError	display "\<\%(\%(Bounds\|Divide\|Domain\|\%(Stack\)\?Overflow\|EOF\|Undef\%(Ref\|Var\)\|System\|Type\|Parse\|Argument\|Key\|Load\|Method\|Inexact\|OutOfMemory\|Init\|Assertion\|ReadOnlyMemory\|StringIndex\)Error\|\%(Interrupt\|Error\|ProcessExited\|Captured\|Composite\|InvalidState\|Missing\|\%(Process\|Task\)Failed\)Exception\|DimensionMismatch\|SegmentationFault\)\>"
199syntax match   juliaBaseTypeIter	display "\<\%(EachLine\|Enumerate\|Cartesian\%(Index\|Range\)\|LinSpace\|CartesianIndices\)\>"
200syntax match   juliaBaseTypeString	display "\<\%(DirectIndex\|Sub\|Rep\|Rev\|Abstract\|Substitution\)\?String\>"
201syntax match   juliaBaseTypeArray	display "\<\%(\%(Sub\)\?Array\|\%(Abstract\|Dense\|Strided\)\?\%(Array\|Matrix\|Vec\%(tor\|OrMat\)\)\|SparseMatrixCSC\|\%(AbstractSparse\|Bit\|Shared\)\%(Array\|Vector\|Matrix\)\|\%\(D\|Bid\|\%(Sym\)\?Trid\)iagonal\|Hermitian\|Symmetric\|UniformScaling\|\%(Lower\|Upper\)Triangular\|\%(Sparse\|Row\)Vector\|VecElement\|Conj\%(Array\|Matrix\|Vector\)\|Index\%(Cartesian\|Linear\|Style\)\|PermutedDimsArray\|Broadcasted\|Adjoint\|Transpose\|LinearIndices\)\>"
202syntax match   juliaBaseTypeDict	display "\<\%(WeakKey\|Id\|Abstract\)\?Dict\>"
203syntax match   juliaBaseTypeSet		display "\<\%(\%(Abstract\|Bit\)\?Set\)\>"
204syntax match   juliaBaseTypeIO		display "\<\%(IO\%(Stream\|Buffer\|Context\)\?\|RawFD\|StatStruct\|FileMonitor\|PollingFileWatcher\|Timer\|Base64\%(Decode\|Encode\)Pipe\|\%(UDP\|TCP\)Socket\|\%(Abstract\)\?Channel\|BufferStream\|ReentrantLock\|GenericIOBuffer\)\>"
205syntax match   juliaBaseTypeProcess	display "\<\%(Pipe\|Cmd\|PipeBuffer\)\>"
206syntax match   juliaBaseTypeRange	display "\<\%(Dims\|RangeIndex\|\%(Abstract\|Lin\|Ordinal\|Step\|\%(Abstract\)\?Unit\)Range\|Colon\|ExponentialBackOff\|StepRangeLen\)\>"
207syntax match   juliaBaseTypeRegex	display "\<Regex\%(Match\)\?\>"
208syntax match   juliaBaseTypeFact	display "\<\%(Factorization\|BunchKaufman\|\%(Cholesky\|QR\)\%(Pivoted\)\?\|\%(Generalized\)\?\%(Eigen\|SVD\|Schur\)\|Hessenberg\|LDLt\|LQ\|LU\)\>"
209syntax match   juliaBaseTypeSort	display "\<\%(Insertion\|\(Partial\)\?Quick\|Merge\)Sort\>"
210syntax match   juliaBaseTypeRound	display "\<Round\%(ingMode\|FromZero\|Down\|Nearest\%(Ties\%(Away\|Up\)\)\?\|ToZero\|Up\)\>"
211syntax match   juliaBaseTypeSpecial	display "\<\%(LocalProcess\|ClusterManager\)\>"
212syntax match   juliaBaseTypeRandom	display "\<\%(AbstractRNG\|MersenneTwister\|RandomDevice\)\>"
213syntax match   juliaBaseTypeDisplay	display "\<\%(Text\(Display\)\?\|\%(Abstract\)\?Display\|MIME\|HTML\)\>"
214syntax match   juliaBaseTypeTime	display "\<\%(Date\%(Time\)\?\|DateFormat\)\>"
215syntax match   juliaBaseTypeOther	display "\<\%(RemoteRef\|Task\|Condition\|VersionNumber\|IPv[46]\|SerializationState\|WorkerConfig\|Future\|RemoteChannel\|IPAddr\|Stack\%(Trace\|Frame\)\|\(Caching\|Worker\)Pool\|AbstractSerializer\)\>"
216
217syntax match   juliaConstNum		display "\%(\<\%(\%(NaN\|Inf\)\%(16\|32\|64\)\?\|pi\|π\)\>\)"
218" Note: recognition of ℯ, which Vim does not consider a valid identifier, is
219" complicated. We detect possible uses by just looking for the character (for
220" performance) and then check that it's actually used by its own.
221" (This also tries to detect preceding number constants; it does so in a crude
222" way.)
223syntax match   juliaPossibleEuler	"ℯ" contains=juliaEuler
224exec 'syntax match   juliaEuler		contained "\%(\%(^\|[' . s:nonidS_chars . s:op_chars_wc . ']\)\%(.\?[0-9][.0-9eEf_]*\d\)\?\)\@'.s:d(80).'<=ℯ\ze[' . s:nonidS_chars . s:op_chars_wc . ']"'
225syntax match   juliaConstBool		display "\<\%(true\|false\)\>"
226syntax match   juliaConstEnv		display "\<\%(ARGS\|ENV\|ENDIAN_BOM\|LOAD_PATH\|VERSION\|PROGRAM_FILE\|DEPOT_PATH\)\>"
227syntax match   juliaConstIO		display "\<\%(std\%(out\|in\|err\)\|devnull\)\>"
228syntax match   juliaConstC		display "\<\%(C_NULL\)\>"
229syntax match   juliaConstGeneric	display "\<\%(nothing\|Main\|undef\|missing\)\>"
230
231syntax match   juliaParamType		contained "[^{([:space:]<>\"]\+\ze{" nextgroup=juliaCurBraBlock
232
233syntax match   juliaPossibleMacro	transparent "@" contains=juliaMacroCall,juliaMacroCallP,juliaPrintfMacro,juliaDocMacro,juliaDocMacroPre
234
235exec 'syntax match   juliaMacro		contained "@' . s:idregex . '\%(\.' . s:idregex . '\)*"'
236syntax match   juliaMacro		contained "@[!.~$%^*/\\|<>+-]\ze[^0-9]"
237exec 'syntax region  juliaMacroCall	contained transparent start="\(@' . s:idregex . '\%(\.' . s:idregex . '\)*\)\@=\1\%([^(]\|$\)" end="\ze\%([])};#]\|$\|\<for\>\|\<end\>\)" contains=@juliaExpressions,juliaMacro,juliaSymbolS,juliaQuotedParBlockS'
238exec 'syntax region  juliaMacroCall	contained transparent start="\(@.\)\@=\1\%([^(]\|$\)" end="\ze\%([])};#]\|$\|\<for\>\|\<end\>\)" contains=@juliaExpressions,juliaMacro,juliaSymbolS,juliaQuotedParBlockS'
239exec 'syntax region  juliaMacroCallP	contained transparent start="@' . s:idregex . '\%(\.' . s:idregex . '\)*(" end=")\@'.s:d(1).'<=" contains=juliaMacro,juliaParBlock'
240exec 'syntax region  juliaMacroCallP	contained transparent start="@.(" end=")\@'.s:d(1).'<=" contains=juliaMacro,juliaParBlock'
241
242exec 'syntax match   juliaNumbers	transparent "\%(^\|[' . s:nonidS_chars . s:op_chars_wc . ']\)\@'.s:d(1).'<=\d\|\.\d\|im\>" contains=juliaNumber,juliaFloat,juliaComplexUnit'
243
244"integer regexes
245let s:dec_regex = '\d\%(_\?\d\)*\%(\>\|im\>\|\ze\D\)'
246let s:hex_regex = '0x\x\%(_\?\x\)*\%(\>\|im\>\|\ze\X\)'
247let s:bin_regex = '0b[01]\%(_\?[01]\)*\%(\>\|im\>\|\ze[^01]\)'
248let s:oct_regex = '0o\o\%(_\?\o\)*\%(\>\|im\>\|\ze\O\)'
249
250let s:int_regex = '\%(' . s:hex_regex .
251      \           '\|'  . s:bin_regex .
252      \           '\|'  . s:oct_regex .
253      \           '\|'  . s:dec_regex .
254      \           '\)'
255
256"floating point regexes
257"  starting with a dot, optional exponent
258let s:float_regex1 = '\.\d\%(_\?\d\)*\%([eEf][-+]\?\d\+\)\?\%(\>\|im\>\|\ze\D\)'
259"  with dot, optional exponent
260let s:float_regex2 = '\d\%(_\?\d\)*\.\%(\d\%(_\?\d\)*\)\?\%([eEf][-+]\?\d\+\)\?\%(\>\|im\>\|\ze\D\)'
261"  without dot, with exponent
262let s:float_regex3 = '\d\%(_\?\d\)*[eEf][-+]\?\d\+\%(\>\|im\>\|\ze\D\)'
263
264"hex floating point numbers
265"  starting with a dot
266let s:hexfloat_regex1 = '0x\.\%\(\x\%(_\?\x\)*\)\?[pP][-+]\?\d\+\%(\>\|im\>\|\ze\X\)'
267"  starting with a digit
268let s:hexfloat_regex2 = '0x\x\%(_\?\x\)*\%\(\.\%\(\x\%(_\?\x\)*\)\?\)\?[pP][-+]\?\d\+\%(\>\|im\>\|\ze\X\)'
269
270let s:float_regex = '\%(' . s:float_regex3 .
271      \             '\|'  . s:float_regex2 .
272      \             '\|'  . s:float_regex1 .
273      \             '\|'  . s:hexfloat_regex2 .
274      \             '\|'  . s:hexfloat_regex1 .
275      \             '\)'
276
277exec 'syntax match   juliaNumber	contained "' . s:int_regex . '" contains=juliaComplexUnit'
278exec 'syntax match   juliaFloat		contained "' . s:float_regex . '" contains=juliaComplexUnit'
279syntax match   juliaComplexUnit		display	contained "\<im\>"
280
281syntax match   juliaRangeOperator	display ":"
282exec 'syntax match   juliaOperator	"' . s:operators . '"'
283
284exec 'syntax region  juliaTernaryRegion	matchgroup=juliaTernaryOperator start="\s\zs?\ze\s" skip="\%(:\(:\|[^:[:space:]'."'".'"({[]\+\s*\ze:\)\|\%(?\s*\)\@'.s:d(6).'<=:(\)" end=":" contains=@juliaExpressions,juliaErrorSemicol'
285
286let s:interp_dollar = '\([' . s:nonidS_chars . s:op_chars_wc . '!]\|^\)\@'.s:d(1).'<=\$'
287
288exec 'syntax match   juliaDollarVar	display contained "' . s:interp_dollar . s:idregex . '"'
289exec 'syntax region  juliaDollarPar	matchgroup=juliaDollarVar contained start="' .s:interp_dollar . '(" end=")" contains=@juliaExpressions'
290exec 'syntax region  juliaDollarSqBra	matchgroup=juliaDollarVar contained start="' .s:interp_dollar . '\[" end="\]" contains=@juliaExpressions,juliaComprehensionFor,juliaSymbolS,juliaQuotedParBlockS'
291
292syntax match   juliaChar		"'\\\?.'" contains=juliaSpecialChar
293syntax match   juliaChar		display "'\\\o\{3\}'" contains=juliaOctalEscapeChar
294syntax match   juliaChar		display "'\\x\x\{2\}'" contains=juliaHexEscapeChar
295syntax match   juliaChar		display "'\\u\x\{1,4\}'" contains=juliaUniCharSmall
296syntax match   juliaChar		display "'\\U\x\{1,8\}'" contains=juliaUniCharLarge
297
298exec 'syntax match   juliaCTransOperator	"[[:space:]}' . s:nonid_chars . s:op_chars_wc . '!]\@'.s:d(1).'<!\.\?' . "'" . 'ᵀ\?"'
299
300" TODO: some of these might be specialized; the rest could be just left to the
301"       generic juliaStringPrefixed fallback
302syntax region  juliaString		matchgroup=juliaStringDelim start=+\z("\(""\)\?\)+ skip=+\%(\\\\\)*\\"+ end=+\z1+ contains=@juliaStringVars,@juliaSpecialChars,@juliaSpellcheckStrings
303syntax region  juliaStringPrefixed	contained matchgroup=juliaStringDelim start=+[^{([:space:]<>"]\+\z("\(""\)\?\)+ skip=+\%(\\\\\)*\\"+ end=+\z1+ contains=@juliaSpecialCharsRaw
304syntax region  juliabString		matchgroup=juliaStringDelim start=+\<b\z("\(""\)\?\)+ skip=+\%(\\\\\)*\\"+ end=+\z1+ contains=@juliaSpecialChars
305syntax region  juliasString		matchgroup=juliaStringDelim start=+\<s\z("\(""\)\?\)+ skip=+\%(\\\\\)*\\"+ end=+\z1+ contains=@juliaSpecialChars
306
307syntax region  juliaDocString		matchgroup=juliaDocStringDelim fold start=+^"""+ skip=+\%(\\\\\)*\\"+ end=+"""+ contains=@juliaStringVars,@juliaSpecialChars,@juliaSpellcheckDocStrings
308
309exec 'syntax region  juliaPrintfMacro		contained transparent start="@s\?printf(" end=")\@'.s:d(1).'<=" contains=juliaMacro,juliaPrintfParBlock'
310syntax region  juliaPrintfMacro		contained transparent start="@s\?printf\s\+" end="\ze\%([])};#]\|$\|\<for\>\)" contains=@juliaExprsPrintf,juliaMacro,juliaSymbolS,juliaQuotedParBlockS
311syntax region  juliaPrintfParBlock	contained matchgroup=juliaParDelim start="(" end=")" contains=@juliaExprsPrintf
312syntax region  juliaPrintfString	contained matchgroup=juliaStringDelim start=+"+ skip=+\%(\\\\\)*\\"+ end=+"+ contains=@juliaSpecialChars,@juliaPrintfChars
313
314exec 'syntax region  juliaDocMacroPre	contained transparent start=+@doc\s\+\%(' . s:idregex . '\%(\.' . s:idregex . '\)*\)\z("\%(""\)\?\)+ skip=+\%(\\\\\)*\\"+ end=+\(\z1\)\@'.s:d(3).'<=+ contains=juliaMacro,juliaDocStringMRaw'
315exec 'syntax region  juliaDocMacro	contained transparent start=+@doc\s\+\z("\%(""\)\?\)+ skip=+\%(\\\\\)*\\"+ end=+\(\z1\)\@'.s:d(3).'<=+ contains=juliaMacro,juliaDocStringM'
316syntax region  juliaDocStringMRaw	contained fold matchgroup=juliaDocStringDelim fold start=+\z\("\(""\)\?\)+ skip=+\%(\\\\\)*\\"+ end=+\z1+ contains=@juliaSpellcheckDocStrings
317syntax region  juliaDocStringM		contained fold matchgroup=juliaDocStringDelim fold start=+\z\("\(""\)\?\)+ skip=+\%(\\\\\)*\\"+ end=+\z1+ contains=@juliaStringVars,@juliaSpecialChars,@juliaSpellcheckDocStrings
318
319syntax region  juliaShellString		matchgroup=juliaStringDelim start=+`+ skip=+\%(\\\\\)*\\`+ end=+`+ contains=@juliaStringVars,juliaSpecialChar
320
321syntax cluster juliaStringVars		contains=juliaStringVarsPar,juliaStringVarsSqBra,juliaStringVarsCurBra,juliaStringVarsPla
322syntax region  juliaStringVarsPar	contained matchgroup=juliaStringVarDelim start="$(" end=")" contains=@juliaExpressions
323syntax region  juliaStringVarsSqBra	contained matchgroup=juliaStringVarDelim start="$\[" end="\]" contains=@juliaExpressions,juliaComprehensionFor,juliaSymbolS,juliaQuotedParBlockS
324syntax region  juliaStringVarsCurBra	contained matchgroup=juliaStringVarDelim start="${" end="}" contains=@juliaExpressions
325exec 'syntax match   juliaStringVarsPla	contained "\$' . s:idregex . '"'
326
327" TODO improve RegEx
328syntax region  juliaRegEx		matchgroup=juliaStringDelim start=+\<r\z("\(""\)\?\)+ skip=+\%(\\\\\)*\\"+ end=+\z1[imsx]*+
329
330syntax cluster juliaSpecialChars	contains=juliaSpecialChar,juliaDoubleBackslash,juliaEscapedQuote,juliaOctalEscapeChar,juliaHexEscapeChar,juliaUniCharSmall,juliaUniCharLarge
331syntax match   juliaSpecialChar		display contained "\\."
332syntax match   juliaOctalEscapeChar	display contained "\\\o\{3\}"
333syntax match   juliaHexEscapeChar	display contained "\\x\x\{2\}"
334syntax match   juliaUniCharSmall	display contained "\\u\x\{1,4\}"
335syntax match   juliaUniCharLarge	display contained "\\U\x\{1,8\}"
336syntax cluster juliaSpecialCharsRaw	contains=juliaDoubleBackslash,juliaEscapedQuote
337syntax match   juliaDoubleBackslash	contained "\\\\"
338syntax match   juliaEscapedQuote	contained "\\\""
339
340syntax cluster juliaPrintfChars		contains=juliaErrorPrintfFmt,juliaPrintfFmt
341syntax match   juliaErrorPrintfFmt	display contained "\\\?%."
342syntax match   juliaPrintfFmt		display contained "%\%(\d\+\$\)\=[-+' #0]*\%(\d*\|\*\|\*\d\+\$\)\%(\.\%(\d*\|\*\|\*\d\+\$\)\)\=\%([hlLjqzt]\|ll\|hh\)\=[aAbdiuoxXDOUfFeEgGcCsSpn]"
343syntax match   juliaPrintfFmt		display contained "%%"
344syntax match   juliaPrintfFmt		display contained "\\%\%(\d\+\$\)\=[-+' #0]*\%(\d*\|\*\|\*\d\+\$\)\%(\.\%(\d*\|\*\|\*\d\+\$\)\)\=\%([hlLjqzt]\|ll\|hh\)\=[aAbdiuoxXDOUfFeEgGcCsSpn]"hs=s+1
345syntax match   juliaPrintfFmt		display contained "\\%%"hs=s+1
346
347" this is used to restrict the search for Symbols to when colons appear at all
348" (for performance reasons)
349syntax match   juliaPossibleSymbol	transparent ":\ze[^:]" contains=juliaSymbol,juliaQuotedParBlock,juliaQuotedQMarkPar,juliaColon
350
351let s:quotable = '\%(' . s:idregex . '\|' . s:operators . '\|[?.]\|' . s:float_regex . '\|' . s:int_regex . '\)'
352let s:quoting_colon = '\%(\%(^\s*\|\s\{6,\}\|[' . s:nonid_chars . s:op_chars_wc . ']\s*\)\@'.s:d(6).'<=\|\%(\<\%(return\|if\|else\%(if\)\?\|while\|try\|begin\)\s\+\)\@'.s:d(9).'<=\)\zs:'
353let s:quoting_colonS = '\s\@'.s:d(1).'<=:'
354
355" note: juliaSymbolS only works within whitespace-sensitive contexts,
356" such as in macro calls without parentheses, or within square brackets.
357" It is used to override the recognition of expressions like `a :b` as
358" ranges rather than symbols in those contexts.
359" (Note that such `a :b` expressions only allows at most 5 spaces between
360" the identifier and the colon anyway.)
361
362exec 'syntax match   juliaSymbol	contained "' . s:quoting_colon . s:quotable . '"'
363exec 'syntax match   juliaSymbolS	contained "' . s:quoting_colonS . s:quotable . '"'
364
365" same as above for quoted expressions such as :(expr)
366exec 'syntax region   juliaQuotedParBlock	matchgroup=juliaQParDelim start="' . s:quoting_colon . '(" end=")" contains=@juliaExpressions'
367exec 'syntax match    juliaQuotedQMarkPar	"' . s:quoting_colon . '(\s*?\s*)" contains=juliaQuotedQMark'
368exec 'syntax region   juliaQuotedParBlockS	matchgroup=juliaQParDelim contained start="' . s:quoting_colonS . '(" end=")" contains=@juliaExpressions'
369
370
371syntax match   juliaTypeOperatorR1	contained "[^{([:space:]<>\"]\+\%(\s*[<>]:\)\@="
372
373" force precedence over Symbols
374syntax match   juliaTypeOperator	contained "[<>:]:"
375exec 'syntax match   juliaTypeOperatorR2	transparent "[<>:]:\s*\%(' . s:idregex . '\.\)*' . s:idregex . '" contains=juliaTypeOperator,juliaType,juliaDottedT,@juliaExpressions nextgroup=juliaTypeOperator'
376syntax match   juliaIsaKeyword		contained "\<isa\>"
377exec 'syntax match   juliaTypeOperatorR3	transparent "\<isa\s\+\%(' . s:idregex . '\.\)*' . s:idregex . '" contains=juliaIsaKeyword,juliaType,juliaDottedT,@juliaExpressions nextgroup=juliaIsaKeyword'
378
379syntax match   juliaWhereKeyword       	"\<where\>"
380exec 'syntax match   juliaWhereR	transparent "\<where\s\+' . s:idregex . '" contains=juliaWhereKeyword,juliaType,juliaDottedT,juliaIdSymbol'
381
382syntax region  juliaCommentL		matchgroup=juliaCommentDelim excludenl start="#\ze\%([^=]\|$\)" end="$" contains=juliaTodo,@juliaSpellcheckComments
383syntax region  juliaCommentM		matchgroup=juliaCommentDelim fold start="#=\ze\%([^#]\|$\)" end="=#" contains=juliaTodo,juliaCommentM,@juliaSpellcheckComments
384syntax keyword juliaTodo		contained TODO FIXME XXX
385
386" detect an end-of-line with only whitespace or comments before it
387let s:eol = '\s*\%(\%(\%(#=\%(=#\@!\|[^=]\|\n\)\{-}=#\)\s*\)\+\)\?\%(#=\@!.*\)\?\n'
388
389" a trailing comma, or colon, or an empty line in an import/using/export
390" multi-line command. Used to recognize the as keyword, and for indentation
391" (this needs to take precedence over normal commas and colons, and comments)
392syntax cluster juliaContinuationItems	contains=juliaContinuationComma,juliaContinuationColon,juliaContinuationNone
393exec 'syntax region  juliaContinuationComma	matchgroup=juliaComma contained start=",\ze'.s:eol.'" end="\n\+\ze." contains=@juliaCommentItems'
394exec 'syntax region  juliaContinuationColon	matchgroup=juliaColon contained start=":\ze'.s:eol.'" end="\n\+\ze." contains=@juliaCommentItems'
395exec 'syntax region  juliaContinuationNone	matchgroup=NONE contained start="\%(\<\%(import\|using\|export\)\>\|^\)\@'.s:d(6).'<=\ze'.s:eol.'" end="\n\+\ze." contains=@juliaCommentItems,juliaAsKeyword'
396exec 'syntax match   juliaMacroName		contained "@' . s:idregex . '\%(\.' . s:idregex . '\)*"'
397
398" the following are disabled by default, but
399" can be enabled by entering e.g.
400"   :hi link juliaParDelim Delimiter
401hi def link juliaParDelim		juliaNone
402hi def link juliaSemicolon		juliaNone
403hi def link juliaComma			juliaNone
404hi def link juliaFunctionCall		juliaNone
405
406hi def link juliaColon			juliaOperator
407
408hi def link juliaFunctionName		juliaFunction
409hi def link juliaFunctionName1		juliaFunction
410hi def link juliaMacroName		juliaMacro
411
412
413hi def link juliaKeyword		Keyword
414hi def link juliaWhereKeyword		Keyword
415hi def link juliaInfixKeyword		Keyword
416hi def link juliaIsaKeyword		Keyword
417hi def link juliaAsKeyword		Keyword
418hi def link juliaRepKeyword		Keyword
419hi def link juliaBlKeyword		Keyword
420hi def link juliaConditional		Conditional
421hi def link juliaRepeat			Repeat
422hi def link juliaException		Exception
423hi def link juliaOuter			Keyword
424hi def link juliaBaseTypeBasic		Type
425hi def link juliaBaseTypeNum		Type
426hi def link juliaBaseTypeC		Type
427hi def link juliaBaseTypeError		Type
428hi def link juliaBaseTypeIter		Type
429hi def link juliaBaseTypeString		Type
430hi def link juliaBaseTypeArray		Type
431hi def link juliaBaseTypeDict		Type
432hi def link juliaBaseTypeSet		Type
433hi def link juliaBaseTypeIO		Type
434hi def link juliaBaseTypeProcess	Type
435hi def link juliaBaseTypeRange		Type
436hi def link juliaBaseTypeRegex		Type
437hi def link juliaBaseTypeFact		Type
438hi def link juliaBaseTypeSort		Type
439hi def link juliaBaseTypeRound		Type
440hi def link juliaBaseTypeSpecial	Type
441hi def link juliaBaseTypeRandom		Type
442hi def link juliaBaseTypeDisplay	Type
443hi def link juliaBaseTypeTime		Type
444hi def link juliaBaseTypeOther		Type
445
446hi def link juliaType			Type
447hi def link juliaParamType		Type
448hi def link juliaTypeOperatorR1		Type
449
450" NOTE: deprecated constants are not highlighted as such. For once,
451" one can still legitimately use them by importing Base.MathConstants.
452" Plus, one-letter variables like `e` and `γ` can be used with other
453" meanings.
454hi def link juliaConstNum		Constant
455hi def link juliaEuler			Constant
456
457hi def link juliaConstEnv		Constant
458hi def link juliaConstC			Constant
459hi def link juliaConstLimits		Constant
460hi def link juliaConstGeneric		Constant
461hi def link juliaRangeKeyword		Constant
462hi def link juliaConstBool		Boolean
463hi def link juliaConstIO		Boolean
464
465hi def link juliaComprehensionFor	Keyword
466hi def link juliaComprehensionIf	Keyword
467
468hi def link juliaDollarVar		Identifier
469
470hi def link juliaFunction		Function
471hi def link juliaMacro			Macro
472hi def link juliaSymbol			Identifier
473hi def link juliaSymbolS		Identifier
474hi def link juliaQParDelim		Identifier
475hi def link juliaQuotedQMarkPar		Identifier
476hi def link juliaQuotedQMark		juliaOperatorHL
477
478hi def link juliaNumber			Number
479hi def link juliaFloat			Float
480hi def link juliaComplexUnit		Constant
481
482hi def link juliaChar			Character
483
484hi def link juliaString			String
485hi def link juliaStringPrefixed		juliaString
486hi def link juliabString		juliaString
487hi def link juliasString		juliaString
488hi def link juliavString		juliaString
489hi def link juliarString		juliaString
490hi def link juliaipString		juliaString
491hi def link juliabigString		juliaString
492hi def link juliaMIMEString		juliaString
493hi def link juliarawString		juliaString
494hi def link juliatestString		juliaString
495hi def link juliahtmlString		juliaString
496hi def link juliaint128String		juliaString
497hi def link juliaPrintfString		juliaString
498hi def link juliaShellString		juliaString
499hi def link juliaDocString		juliaString
500hi def link juliaDocStringM		juliaDocString
501hi def link juliaDocStringMRaw		juliaDocString
502hi def link juliaStringDelim		juliaString
503hi def link juliaDocStringDelim		juliaDocString
504hi def link juliaStringVarsPla		Identifier
505hi def link juliaStringVarDelim		Identifier
506
507hi def link juliaRegEx			String
508
509hi def link juliaSpecialChar		SpecialChar
510hi def link juliaOctalEscapeChar	SpecialChar
511hi def link juliaHexEscapeChar		SpecialChar
512hi def link juliaUniCharSmall		SpecialChar
513hi def link juliaUniCharLarge		SpecialChar
514hi def link juliaDoubleBackslash	SpecialChar
515hi def link juliaEscapedQuote		SpecialChar
516
517hi def link juliaPrintfFmt		SpecialChar
518
519if s:julia_highlight_operators
520  hi! def link juliaOperatorHL		Operator
521else
522  hi! def link juliaOperatorHL		juliaNone
523endif
524hi def link juliaOperator		juliaOperatorHL
525hi def link juliaRangeOperator		juliaOperatorHL
526hi def link juliaCTransOperator		juliaOperatorHL
527hi def link juliaTernaryOperator	juliaOperatorHL
528hi def link juliaTypeOperator		juliaOperatorHL
529
530hi def link juliaCommentL		Comment
531hi def link juliaCommentM		Comment
532hi def link juliaCommentDelim		Comment
533hi def link juliaTodo			Todo
534
535hi def link juliaErrorPar		juliaError
536hi def link juliaErrorEnd		juliaError
537hi def link juliaErrorElse		juliaError
538hi def link juliaErrorCatch		juliaError
539hi def link juliaErrorFinally		juliaError
540hi def link juliaErrorSemicol		juliaError
541hi def link juliaErrorPrintfFmt		juliaError
542
543hi def link juliaError			Error
544
545syntax sync fromstart
546
547let b:current_syntax = "julia"
548
549let &cpo = s:cpo_save
550unlet s:cpo_save
551