@@ -154,37 +154,41 @@ syntax region juliaParBlockInRange matchgroup=juliaParDelim contained start="("
154
154
syntax region juliaSqBraBlock matchgroup =juliaParDelim start =" \[ " end =" \] " contains =@juliaExpressions,juliaParBlockInRange,juliaRangeEnd,juliaComprehensionFor,juliaSymbolS,juliaQuotedParBlockS,juliaQuotedQMarkParS
155
155
syntax region juliaCurBraBlock matchgroup =juliaParDelim start =" {" end =" }" contains =@juliaExpressions
156
156
157
- syntax match juliaKeyword display " \<\% (return\| local\| global\| import\% (all\)\?\| export\| using\| const\| where\)\> "
157
+ " This is really ugly. It would be better to mask most keywords when a dot is
158
+ " found, introducing some kind of dot-environment
159
+ let s: nodot = ' \%(\.\)\@1<!'
160
+
161
+ exec ' syntax match juliaKeyword display "' .s: nodot .' \<\%(return\|local\|global\|import\%(all\)\?\|export\|using\|const\|where\)\>"'
158
162
syntax match juliaInfixKeyword display " \% (=\s *\)\@ <!\<\% (in\| isa\)\>\S\@ !\% (\s *=\)\@ !"
159
- syntax match juliaRepKeyword display " \<\% (break\| continue\)\> "
160
- syntax region juliaConditionalBlock matchgroup =juliaConditional start =" \< if\> " end =" \< end\> " contains =@juliaExpressions,juliaConditionalEIBlock,juliaConditionalEBlock fold
161
- syntax region juliaConditionalEIBlock matchgroup =juliaConditional transparent contained start =" \< elseif\> " end =" \<\% (end\| else\| elseif\)\> " me =s - 1 contains =@juliaExpressions,juliaConditionalEIBlock,juliaConditionalEBlock
162
- syntax region juliaConditionalEBlock matchgroup =juliaConditional transparent contained start =" \< else\> " end =" \< end\> " me =s - 1 contains =@juliaExpressions
163
- syntax region juliaWhileBlock matchgroup =juliaRepeat start =" \< while\> " end =" \< end\> " contains =@juliaExpressions fold
164
- syntax region juliaForBlock matchgroup =juliaRepeat start =" \< for\> " end =" \< end\> " contains =@juliaExpressions,juliaOuter fold
165
- syntax region juliaBeginBlock matchgroup =juliaBlKeyword start =" \< begin\> " end =" \< end\> " contains =@juliaExpressions fold
166
- syntax region juliaFunctionBlock matchgroup =juliaBlKeyword start =" \< function\> " end =" \< end\> " contains =@juliaExpressions fold
167
- syntax region juliaMacroBlock matchgroup =juliaBlKeyword start =" \< macro\> " end =" \< end\> " contains =@juliaExpressions fold
168
- syntax region juliaQuoteBlock matchgroup =juliaBlKeyword start =" \< quote\> " end =" \< end\> " contains =@juliaExpressions fold
163
+ exec ' syntax match juliaRepKeyword display "' . s: nodot . ' \<\%(break\|continue\)\>"'
164
+ exec ' syntax region juliaConditionalBlock matchgroup=juliaConditional start="' . s: nodot . ' \<if\>" end="' . s: nodot . ' \<end\>" contains=@juliaExpressions,juliaConditionalEIBlock,juliaConditionalEBlock fold'
165
+ exec ' syntax region juliaConditionalEIBlock matchgroup=juliaConditional transparent contained start="' . s: nodot . ' \<elseif\>" end="' . s: nodot . ' \<\%(end\|else\|elseif\)\>"me=s-1 contains=@juliaExpressions,juliaConditionalEIBlock,juliaConditionalEBlock'
166
+ exec ' syntax region juliaConditionalEBlock matchgroup=juliaConditional transparent contained start="' . s: nodot . ' \<else\>" end="' . s: nodot . ' \<end\>"me=s-1 contains=@juliaExpressions'
167
+ exec ' syntax region juliaWhileBlock matchgroup=juliaRepeat start="' . s: nodot . ' \<while\>" end="' . s: nodot . ' \<end\>" contains=@juliaExpressions fold'
168
+ exec ' syntax region juliaForBlock matchgroup=juliaRepeat start="' . s: nodot . ' \<for\>" end="' . s: nodot . ' \<end\>" contains=@juliaExpressions,juliaOuter fold'
169
+ exec ' syntax region juliaBeginBlock matchgroup=juliaBlKeyword start="' . s: nodot . ' \<begin\>" end="' . s: nodot . ' \<end\>" contains=@juliaExpressions fold'
170
+ exec ' syntax region juliaFunctionBlock matchgroup=juliaBlKeyword start="' . s: nodot . ' \<function\>" end="' . s: nodot . ' \<end\>" contains=@juliaExpressions fold'
171
+ exec ' syntax region juliaMacroBlock matchgroup=juliaBlKeyword start="' . s: nodot . ' \<macro\>" end="' . s: nodot . ' \<end\>" contains=@juliaExpressions fold'
172
+ exec ' syntax region juliaQuoteBlock matchgroup=juliaBlKeyword start="' . s: nodot . ' \<quote\>" end="' . s: nodot . ' \<end\>" contains=@juliaExpressions fold'
169
173
if b: julia_syntax_version <= 10
170
- syntax region juliaTypeBlock matchgroup =juliaBlKeyword06 start =" \< type\> " end =" \< end\> " contains =@juliaExpressions fold
171
- syntax region juliaImmutableBlock matchgroup =juliaBlKeyword06 start =" \< immutable\> " end =" \< end\> " contains =@juliaExpressions fold
174
+ exec ' syntax region juliaTypeBlock matchgroup=juliaBlKeyword06 start="' . s: nodot . ' \<type\>" end="' . s: nodot . ' \<end\>" contains=@juliaExpressions fold'
175
+ exec ' syntax region juliaImmutableBlock matchgroup=juliaBlKeyword06 start="' . s: nodot . ' \<immutable\>" end="' . s: nodot . ' \<end\>" contains=@juliaExpressions fold'
172
176
endif
173
- syntax region juliaStructBlock matchgroup =juliaBlKeyword start =" \< struct\> " end =" \< end\> " contains =@juliaExpressions fold
174
- syntax region juliaMutableStructBlock matchgroup =juliaBlKeyword start =" \< mutable struct\> " end =" \< end\> " contains =@juliaExpressions fold
175
- syntax region juliaLetBlock matchgroup =juliaBlKeyword start =" \< let\> " end =" \< end\> " contains =@juliaExpressions fold
176
- syntax region juliaDoBlock matchgroup =juliaBlKeyword start =" \< do\> " end =" \< end\> " contains =@juliaExpressions fold
177
+ exec ' syntax region juliaStructBlock matchgroup=juliaBlKeyword start="' . s: nodot . ' \<struct\>" end="' . s: nodot . ' \<end\>" contains=@juliaExpressions fold'
178
+ exec ' syntax region juliaMutableStructBlock matchgroup=juliaBlKeyword start="' . s: nodot . ' \<mutable struct\>" end="' . s: nodot . ' \<end\>" contains=@juliaExpressions fold'
179
+ exec ' syntax region juliaLetBlock matchgroup=juliaBlKeyword start="' . s: nodot . ' \<let\>" end="' . s: nodot . ' \<end\>" contains=@juliaExpressions fold'
180
+ exec ' syntax region juliaDoBlock matchgroup=juliaBlKeyword start="' . s: nodot . ' \<do\>" end="' . s: nodot . ' \<end\>" contains=@juliaExpressions fold'
177
181
exec ' syntax region juliaModuleBlock matchgroup=juliaBlKeyword start="\%(\%(\.\s*\)\@' .s: d (6 ).' <!\|\%(@\s*\.\s*\)\@' .s: d (6 ).' <=\)\<\%(bare\)\?module\>" end="\<end\>" contains=@juliaExpressions fold'
178
- syntax region juliaExceptionBlock matchgroup =juliaException start =" \< try\> " end =" \< end\> " contains =@juliaExpressions,juliaCatchBlock,juliaFinallyBlock fold
179
- syntax region juliaCatchBlock matchgroup =juliaException transparent contained start =" \< catch\> " end =" \< end\> " me =s - 1 contains =@juliaExpressions,juliaFinallyBlock
180
- syntax region juliaFinallyBlock matchgroup =juliaException transparent contained start =" \< finally\> " end =" \< end\> " me =s - 1 contains =@juliaExpressions
181
- syntax match juliaTypedef " \<\% (abstract\| typealias\| bitstype\)\> "
182
+ exec ' syntax region juliaExceptionBlock matchgroup=juliaException start="' . s: nodot . ' \<try\>" end="' . s: nodot . ' \<end\>" contains=@juliaExpressions,juliaCatchBlock,juliaFinallyBlock fold'
183
+ exec ' syntax region juliaCatchBlock matchgroup=juliaException transparent contained start="' . s: nodot . ' \<catch\>" end="' . s: nodot . ' \<end\>"me=s-1 contains=@juliaExpressions,juliaFinallyBlock'
184
+ exec ' syntax region juliaFinallyBlock matchgroup=juliaException transparent contained start="' . s: nodot . ' \<finally\>" end="' . s: nodot . ' \<end\>"me=s-1 contains=@juliaExpressions'
185
+ exec ' syntax match juliaTypedef "' . s: nodot . ' \<\%(abstract\|typealias\|bitstype\)\>"'
182
186
" AbstractBlock needs to come after to take precedence
183
- syntax region juliaAbstractBlock matchgroup =juliaBlKeyword start =" \< abstract type\> " end =" \< end\> " fold contains =@juliaExpressions
184
- syntax region juliaPrimitiveBlock matchgroup =juliaBlKeyword start =" \< primitive type\> " end =" \< end\> " fold contains =@juliaExpressions
187
+ exec ' syntax region juliaAbstractBlock matchgroup=juliaBlKeyword start="' . s: nodot . ' \<abstract type\>" end="' . s: nodot . ' \<end\>" fold contains=@juliaExpressions'
188
+ exec ' syntax region juliaPrimitiveBlock matchgroup=juliaBlKeyword start="' . s: nodot . ' \<primitive type\>" end="' . s: nodot . ' \<end\>" fold contains=@juliaExpressions'
185
189
186
190
exec ' syntax region juliaComprehensionFor matchgroup=juliaComprehensionFor transparent contained start="\%([^[:space:],;:({[]\_s*\)\@' .s: d (80 ).' <=\<for\>" end="\ze[]);]" contains=@juliaExpressions,juliaComprehensionIf,juliaComprehensionFor'
187
- syntax match juliaComprehensionIf contained " \< if\> "
191
+ exec ' syntax match juliaComprehensionIf contained "' . s: nodot . ' \<if\>"'
188
192
189
193
exec ' syntax match juliaOuter contained "\<outer\ze\s\+' . s: idregex . ' \>"'
190
194
0 commit comments