Closed FichteFoll closed 4 years ago
The parser currently handles %
as an inclusion. My idea was to use the following syntax:
main = '<script>'
%{Packages/JavaScript/JavaScript.sublime-syntax, js-exit}
;
js-exit = '</script>' ;
is the first argument optional on this case? Why not use ST's syntax directly, I. e. path#context or scope:source.blub#context (although you should about scopes and context names at the same time, imo).
~ would also be applicable, if I assume correctly.
I'm sorry, but I don't quite follow. The first argument is the syntax/context to include, while the second argument is for the with_prototype
context.
Oh, my bad. I was reading this on mobile and jumping to conclusions. That makes more sense, of course. Maybe make it a prototype:
keyword argument.
b81563dde34448133d3ead244ace161d38234660 Adds an initial implementation for this. There's still work to do with handling all the edge cases, but the basics are there (I'll leave the issue open until those are done). The example has changed dramatically as I've gotten closer to a working implementation. I've arrived at the following:
scope: text.html
main = ( ~'<sbnf>'{tag.begin, embed: Packages/sbnf/sbnf.sublime-syntax, prototype: js-exit}
)*
;
js-exit = ( ~'</sbnf>'{tag.end} )* ;
The functionality to include an external syntax, such as a regular expression syntax within sbnf's own syntax definition, is currently missing.
I don't have any concrete proposals, but I wanted to track this as an issue for now.