Created
July 27, 2018 04:54
-
-
Save infininight/b03b1354ae402f6170814af88efed26f to your computer and use it in GitHub Desktop.
Sample extension grammar for HTML based template language (This is in bundle editor format, create a new grammar and paste in the contents.)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ patterns = ( | |
{ name = 'meta.tag.template.start.html'; | |
begin = '(<)(s:[\-.0-9_a-zA-Z]*)(?=\s|/?>)'; | |
end = '/?>'; | |
beginCaptures = { | |
1 = { name = 'punctuation.definition.tag.begin.html'; }; | |
2 = { name = 'entity.name.tag.html'; }; | |
}; | |
endCaptures = { 0 = { name = 'punctuation.definition.tag.end.html'; }; }; | |
patterns = ( { include = 'text.html.basic#attribute'; } ); | |
}, | |
{ name = 'meta.tag.template.end.html'; | |
begin = '(</)(s:[\-.0-9_a-zA-Z]*)(?=\s|/?>)'; | |
end = '>'; | |
beginCaptures = { | |
1 = { name = 'punctuation.definition.tag.begin.html'; }; | |
2 = { name = 'entity.name.tag.html'; }; | |
}; | |
endCaptures = { 0 = { name = 'punctuation.definition.tag.end.html'; }; }; | |
patterns = ( { include = 'text.html.basic#attribute'; } ); | |
}, | |
{ name = 'meta.embedded.line.scala-template'; | |
begin = '\$\{'; | |
end = '(\})'; | |
beginCaptures = { 0 = { name = 'punctuation.section.embedded.begin.scala-template'; }; }; | |
endCaptures = { | |
0 = { name = 'punctuation.section.embedded.end.scala-template'; }; | |
1 = { name = 'source.scala-template'; }; | |
}; | |
contentName = 'source.scala'; | |
patterns = ( | |
{ name = 'variable.other.readwrite.scala-template'; | |
match = 'foobar'; | |
}, | |
); | |
}, | |
{ include = 'text.html.basic'; }, | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment