Skip to content

Tips & Tricks

deathaxe edited this page Aug 22, 2021 · 2 revisions

Context Switching

Direct Push Statement

If foo is matched an foo-arguments context is pushed onto stack.

contexts:
  main:
    - match: \bfoo\b
      push: foo-arguments

  foo-arguments:
    - meta_scope: meta.foo
    - match: $
      pop: 1

Indirect Push Statement

If foo is matched an anonymous context is pushed onto stack, which includes foo-arguments context.

contexts:
  main:
    - match: \bfoo\b
      push:
        - include: foo-arguments

  foo-arguments:
    - meta_scope: meta.foo
    - match: $
      pop: 1
Clone this wiki locally