我目前正在为具有不寻常评论格式的语言编写Sublime语法模式(YAML,for v3)。
文档评论:
# The following function returns
the opposite of what you think it does.
code...
作为LOC中的第一个字符开始,一个简单的例子是:
#
This is a comment,
this is still the same comment.
This, too. These don't matter: # foobar ##
code...
和最糟糕的例子:
- match: '#'
scope: punctuation.definition.comment.mona
push: doc_comment
我目前的做法是使用堆栈。
推送:
line_comment:
- meta_scope: comment.line.mona
- match: '\n\n'
pop: true
流行:
s
但这并不奏效。我尝试使用{{1}}解决此问题,认为它会产生类似this的行为,但它会产生Sublime错误(捕获组的无效选项)。
如何将此评论格式与S3 YAML正确匹配?