I’ve this in a Sublime Text syntax file:
contexts:
deambiguatedSubexpressions:
- include: ignoreBlank
- match: '/=?'
pop: true
- match: '\<'
pop: true
- match: '(?![<\s\t\n\r/]|/=)'
pop: true
ignoreBlank:
- match: '{{Whitespace}}|{{LineTerminator}}'
- include: comments
The context deambiguatedSubexpressions
allows to distinguish divide operator from regular expression in an ActionScript 3.0 dialect. Line breaks are allowed before the slash operator, but actually it seems like Sublime Text pops the context right on the line terminator, which causes the following:
a
/ b
To wrongly highlight / b
as a regular expression.