This commit is contained in:
Daniel Felder 2014-08-11 11:57:29 +00:00
commit 917c4da39d

View file

@ -12,19 +12,19 @@ var LatexHighlightRules = function() {
// the end of the line
token : "comment",
regex : "%.*$"
},{
}, {
// Documentclass and usepackage
token : ["keyword","lparen","variable.parameter","rparen", "lparen","storage.type","rparen"],
regex : "(\\\\(?:documentclass|usepackage|input))(?:(\\[)([^\\]]*)(\\]))?({)([^}]*)(})"
},{
}, {
// A label
token : ["keyword","lparen","variable.parameter","rparen"],
regex : "(\\\\label)(?:({)([^}]*)(}))?"
},{
}, {
// A block
token : ["storage.type", "lparen","variable.parameter","rparen"],
regex : "(\\\\(?:begin|end))({)(\\w*)(})"
},{
}, {
// A tex command e.g. \foo
token : "storage.type",
regex : "\\\\[a-zA-Z]+"
@ -36,11 +36,11 @@ var LatexHighlightRules = function() {
// Curly and square braces
token : "rparen",
regex : "[\\])}]"
},{
}, {
// Escaped character (including new line)
token : "constant.character.escape",
regex : "\\\\[^a-zA-Z]?"
},{
}, {
// An equation
token : "string",
regex : "\\${1,2}",
@ -49,18 +49,18 @@ var LatexHighlightRules = function() {
"equation" : [{
token : "comment",
regex : "%.*$"
},{
}, {
token : "string",
regex : "\\${1,2}",
next : "start"
},{
}, {
token : "constant.character.escape",
regex : "\\\\(?:[^a-zA-Z]|[a-zA-Z]+)"
},{
}, {
token : "error",
regex : "^\\s*$",
next : "start"
},{
}, {
defaultToken : "string"
}]