fix highlighting of unicode variables in julia
This commit is contained in:
parent
2327d155b4
commit
ea07bfb4e7
3 changed files with 14 additions and 8 deletions
|
|
@ -2,7 +2,7 @@ for op = (:+, :*, :&, :|, :$)
|
|||
@eval ($op)(a,b,c) = ($op)(($op)(a,b),c)
|
||||
end
|
||||
|
||||
|
||||
v = α';
|
||||
function g(x,y)
|
||||
return x * y
|
||||
x + y
|
||||
|
|
|
|||
|
|
@ -38,7 +38,13 @@
|
|||
],[
|
||||
"start"
|
||||
],[
|
||||
"start"
|
||||
"start",
|
||||
["text","v "],
|
||||
["keyword.operator.update.julia","="],
|
||||
["text"," "],
|
||||
["variable","α"],
|
||||
["keyword.operator.transposed-variable.julia","'"],
|
||||
["text",";"]
|
||||
],[
|
||||
"start",
|
||||
["keyword.other.julia","function"],
|
||||
|
|
|
|||
|
|
@ -63,11 +63,11 @@ var JuliaHighlightRules = function() {
|
|||
regex: '(#)(?!\\{)(.*$)'} ],
|
||||
'#function_call':
|
||||
[ { token: [ 'support.function.julia', 'text' ],
|
||||
regex: '([a-zA-Z0-9_]+!?)(\\w*\\()'} ],
|
||||
regex: '([a-zA-Z0-9_]+!?)([\\w\\xff-\\u218e\\u2455-\\uffff]*\\()'} ],
|
||||
'#function_decl':
|
||||
[ { token: [ 'keyword.other.julia', 'meta.function.julia',
|
||||
'entity.name.function.julia', 'meta.function.julia','text' ],
|
||||
regex: '(function|macro)(\\s*)([a-zA-Z0-9_\\{]+!?)(\\w*)([(\\\\{])'} ],
|
||||
regex: '(function|macro)(\\s*)([a-zA-Z0-9_\\{]+!?)([\\w\\xff-\\u218e\\u2455-\\uffff]*)([(\\\\{])'} ],
|
||||
'#keyword':
|
||||
[ { token: 'keyword.other.julia',
|
||||
regex: '\\b(?:function|type|immutable|macro|quote|abstract|bitstype|typealias|module|baremodule|new)\\b' },
|
||||
|
|
@ -75,7 +75,7 @@ var JuliaHighlightRules = function() {
|
|||
regex: '\\b(?:if|else|elseif|while|for|in|begin|let|end|do|try|catch|finally|return|break|continue)\\b' },
|
||||
{ token: 'storage.modifier.variable.julia',
|
||||
regex: '\\b(?:global|local|const|export|import|importall|using)\\b' },
|
||||
{ token: 'variable.macro.julia', regex: '@\\w+\\b' } ],
|
||||
{ token: 'variable.macro.julia', regex: '@[\\w\\xff-\\u218e\\u2455-\\uffff]+\\b' } ],
|
||||
'#number':
|
||||
[ { token: 'constant.numeric.julia',
|
||||
regex: '\\b0(?:x|X)[0-9a-fA-F]*|(?:\\b[0-9]+\\.?[0-9]*|\\.[0-9]+)(?:(?:e|E)(?:\\+|-)?[0-9]*)?(?:im)?|\\bInf(?:32)?\\b|\\bNaN(?:32)?\\b|\\btrue\\b|\\bfalse\\b' } ],
|
||||
|
|
@ -99,7 +99,7 @@ var JuliaHighlightRules = function() {
|
|||
{ token: 'keyword.operator.interpolation.julia',
|
||||
regex: '\\$#?(?=.)' },
|
||||
{ token: [ 'variable', 'keyword.operator.transposed-variable.julia' ],
|
||||
regex: '(\\w+)((?:\'|\\.\')*\\.?\')' },
|
||||
regex: '([\\w\\xff-\\u218e\\u2455-\\uffff]+)((?:\'|\\.\')*\\.?\')' },
|
||||
{ token: 'text',
|
||||
regex: '\\[|\\('},
|
||||
{ token: [ 'text', 'keyword.operator.transposed-matrix.julia' ],
|
||||
|
|
@ -122,10 +122,10 @@ var JuliaHighlightRules = function() {
|
|||
{ include: '#string_escaped_char' },
|
||||
{ defaultToken: 'string.quoted.double.julia' } ] },
|
||||
{ token: 'punctuation.definition.string.begin.julia',
|
||||
regex: '\\b\\w+"',
|
||||
regex: '\\b[\\w\\xff-\\u218e\\u2455-\\uffff]+"',
|
||||
push:
|
||||
[ { token: 'punctuation.definition.string.end.julia',
|
||||
regex: '"\\w*',
|
||||
regex: '"[\\w\\xff-\\u218e\\u2455-\\uffff]*',
|
||||
next: 'pop' },
|
||||
{ include: '#string_custom_escaped_char' },
|
||||
{ defaultToken: 'string.quoted.custom-double.julia' } ] },
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue