Closed mitranim closed 1 year ago
FWIW, this is the generated sublime-syntax:
%YAML 1.2
---
# http://www.sublimetext.com/docs/syntax.html
version: 2
name:
scope: source.
contexts:
# Rule: comment
comment|0:
- meta_content_scope: comment
- match: '\['
scope: comment comment # <- double scope
push: [comment|meta, comment|0] # <- no need for comment|meta
- match: '\]'
scope: comment
pop: true
# Meta scope context for comment
comment|meta:
- meta_content_scope: comment
- match: ''
pop: true
# Rule: main
main:
- match: '\['
scope: comment
push: comment|0
Removing the meta scope:
main = (~comment)*;
comment = `[` (~comment)* ~`]`;
generates:
%YAML 1.2
---
# http://www.sublimetext.com/docs/syntax.html
version: 2
name:
scope: source.
contexts:
# Rule: comment
comment|0:
- match: '\['
push: comment|0
- match: '\]'
pop: true
# Rule: main
main:
- match: '\['
push: comment|0
Consider the following over-simplified syntax that supports only comments inside
[]
, nestable:The first comment level has 1 comment scope as expected, but every additional level gets another +2: