Skip to content

Instantly share code, notes, and snippets.

@Phrogz
Created February 22, 2010 23:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Phrogz/311644 to your computer and use it in GitHub Desktop.
Save Phrogz/311644 to your computer and use it in GitHub Desktop.
{
"patterns" : [
{
"begin" : "^\\s*==",
"patterns" : [
{
"include" : "#interpolated_ruby"
}
],
"contentName" : "string.quoted.double.ruby",
"end" : "$\\n?"
},
{
"name" : "meta.prolog.haml",
"match" : "^(!!!)($|\\s.*)",
"captures" : {
"1" : {
"name" : "punctuation.definition.prolog.haml"
}
}
},
{
"name" : "comment.line.slash.haml",
"match" : "^ *(/)\\s*\\S.*$\\n?",
"captures" : {
"1" : {
"name" : "punctuation.section.comment.haml"
}
}
},
{
"begin" : "^( *)(/)\\s*$",
"patterns" : [
{
"include" : "text.haml"
}
],
"name" : "comment.block.haml",
"end" : "^(?!\\1 )",
"beginCaptures" : {
"2" : {
"name" : "punctuation.section.comment.haml"
}
}
},
{
"begin" : "^(\\s*):markdown\\b",
"end" : "^(?!\\1)|^\\1\\S",
"patterns" : [
{
"include" : "text.html.markdown"
}
]
},
{
"begin" : "^\\s*(?:((%)([\\w:]+))|(?=\\.|#))",
"patterns" : [
{
"begin" : "==",
"patterns" : [
{
"include" : "#interpolated_ruby"
}
],
"contentName" : "string.quoted.double.ruby",
"end" : "$\\n?"
},
{
"name" : "entity.name.tag.class.haml",
"match" : "\\.[\\w-]+"
},
{
"name" : "entity.name.tag.id.haml",
"match" : "#[\\w-]+"
},
{
"begin" : "\\{(?=.*\\}|.*\\|\\s*$)",
"patterns" : [
{
"include" : "source.ruby.rails"
},
{
"include" : "#continuation"
}
],
"name" : "meta.section.attributes.haml",
"end" : "\\}|$|^(?!.*\\|\\s*$)"
},
{
"begin" : "\\[(?=.*\\]|.*\\|\\s*$)",
"patterns" : [
{
"include" : "source.ruby.rails"
},
{
"include" : "#continuation"
}
],
"name" : "meta.section.object.haml",
"end" : "\\]|$|^(?!.*\\|\\s*$)"
},
{
"include" : "#rubyline"
},
{
"name" : "punctuation.terminator.tag.haml",
"match" : "/"
}
],
"captures" : {
"3" : {
"name" : "entity.name.tag.haml"
},
"1" : {
"name" : "meta.tag.haml"
},
"2" : {
"name" : "punctuation.definition.tag.haml"
}
},
"end" : "$|(?!\\.|#|\\{|\\[|=|-|~|/)"
},
{
"match" : "^\\s*(\\\\.)",
"captures" : {
"1" : {
"name" : "meta.escape.haml"
}
}
},
{
"begin" : "^\\s*(?==|-|~)",
"patterns" : [
{
"include" : "#rubyline"
}
],
"end" : "$"
}
],
"name" : "Ruby Haml",
"scopeName" : "text.haml",
"fileTypes" : [
"haml",
"sass"
],
"foldingStopMarker" : "^\\s*$",
"foldingStartMarker" : "^\\s*([-%#\\:\\.\\w\\=].*)\\s$",
"repository" : {
"nest_curly_and_self" : {
"patterns" : [
{
"begin" : "\\{",
"patterns" : [
{
"include" : "#nest_curly_and_self"
}
],
"captures" : {
"0" : {
"name" : "punctuation.section.scope.ruby"
}
},
"end" : "\\}"
},
{
"include" : "source.ruby"
}
]
},
"interpolated_ruby" : {
"patterns" : [
{
"name" : "source.ruby.embedded.source",
"match" : "#\\{(\\})",
"captures" : {
"0" : {
"name" : "punctuation.section.embedded.ruby"
},
"1" : {
"name" : "source.ruby.embedded.source.empty"
}
}
},
{
"begin" : "#\\{",
"patterns" : [
{
"include" : "#nest_curly_and_self"
},
{
"include" : "source.ruby"
}
],
"name" : "source.ruby.embedded.source",
"captures" : {
"0" : {
"name" : "punctuation.section.embedded.ruby"
}
},
"end" : "(\\})"
},
{
"name" : "variable.other.readwrite.instance.ruby",
"match" : "(#@)[a-zA-Z_]\\w*",
"captures" : {
"1" : {
"name" : "punctuation.definition.variable.ruby"
}
}
},
{
"name" : "variable.other.readwrite.class.ruby",
"match" : "(#@@)[a-zA-Z_]\\w*",
"captures" : {
"1" : {
"name" : "punctuation.definition.variable.ruby"
}
}
},
{
"name" : "variable.other.readwrite.global.ruby",
"match" : "(#\\$)[a-zA-Z_]\\w*",
"captures" : {
"1" : {
"name" : "punctuation.definition.variable.ruby"
}
}
}
]
},
"continuation" : {
"match" : "(\\|)\\s*\\n",
"captures" : {
"1" : {
"name" : "punctuation.separator.continuation.haml"
}
}
},
"rubyline" : {
"begin" : "=|-|~",
"patterns" : [
{
"name" : "comment.line.number-sign.ruby",
"match" : "#.*$",
"comment" : "Hack to let ruby comments work in this context properly"
},
{
"include" : "source.ruby.rails"
},
{
"include" : "#continuation"
}
],
"name" : "meta.line.ruby.haml",
"contentName" : "source.ruby.embedded.haml",
"endCaptures" : {
"1" : {
"name" : "source.ruby.embedded.html"
},
"2" : {
"name" : "keyword.control.ruby.start-block"
}
},
"end" : "((do|\\{)( \\|[^|]+\\|)?)$|$|^(?!.*\\|\\s*$)"
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment