%YAML 1.2 --- name: Ruby Haml file_extensions: - haml - sass scope: text.haml contexts: main: - match: ^(!!!)($|\s.*) scope: meta.prolog.haml captures: 1: punctuation.definition.prolog.haml - match: ^ *(/)\s*\S.*$\n? scope: comment.line.slash.haml captures: 1: punctuation.section.comment.haml - match: ^( *)(/)\s*$ captures: 2: punctuation.section.comment.haml push: - meta_scope: comment.block.haml - match: ^(?!\1 ) pop: true - include: "Ruby Haml.sublime-syntax" - match: '^\s*(?:((%)([\w:]+))|(?=\.|#))' captures: 1: meta.tag.haml 2: punctuation.definition.tag.haml 3: entity.name.tag.haml push: - match: '$|(?!\.|#|\{|\[|=|-|~|/)' pop: true - match: '\.[\w-]+' scope: entity.name.tag.class.haml - match: '#[\w-]+' scope: entity.name.tag.id.haml - match: '\{(?=.*\}|.*\|\s*$)' push: - meta_scope: meta.section.attributes.haml - match: '\}|$|^(?!.*\|\s*$)' pop: true - include: "Ruby on Rails.sublime-syntax" - include: continuation - match: '\[(?=.*\]|.*\|\s*$)' push: - meta_scope: meta.section.object.haml - match: '\]|$|^(?!.*\|\s*$)' pop: true - include: "Ruby on Rails.sublime-syntax" - include: continuation - include: rubyline - match: / scope: punctuation.terminator.tag.haml - match: ^\s*(\\.) captures: 1: meta.escape.haml - match: ^\s*(?==|-|~) push: - match: $ pop: true - include: rubyline continuation: - match: (\|)\s*\n captures: 1: punctuation.separator.continuation.haml rubyline: - match: "=|-|~" push: - meta_scope: meta.line.ruby.haml - meta_content_scope: source.ruby.embedded.haml - match: '((do|\{)( \|[^|]+\|)?)$|$|^(?!.*\|\s*$)' captures: 1: source.ruby.embedded.html 2: keyword.control.start-block.ruby pop: true - match: "#.*$" comment: Hack to let ruby comments work in this context properly scope: comment.line.number-sign.ruby - include: Packages/Rails/Ruby on Rails.sublime-syntax - include: continuation