@aibb

Как переопределить meta.preprocessor в sublime text 3?

Делаю кастомный синтаксис в Sublime и столкнулся с тем, что не хочет переопределять include из области meta.preprocessor.
Делаю так:
- match: "^\\s*(#)\\s*\\b(include)\\b"
      captures:
        1: meta.preprocessor.is3
        2: keyword.control.include.is3


Но в итоге выделяется только сам команда include, решетка не выделяется. Полный конфиг:
%YAML 1.2
---

name: IS3
file_extensions:
  - st3
  - sc3
scope: source.is3
contexts:
  main:

    - match: '"'
      scope: punctuation.definition.string.begin.is3
      push: double_quoted_string

    - match: '//'
      scope: punctuation.definition.comment.is3
      push: line_comment

    - match: '\b(include|define|new|SetHandler|If|Else|For|While|Endif|Endfor|Endwhile|break|continue|return|Try|Endtry|Catch|Endcatch|Var|EndVar|Sub|EndSub|EndScript)\b'
      scope: keyword.control.is3

    # Numbers
    - match: '\b(-)?[0-9.]+\b'
      scope: constant.numeric.is3
    - match: \b(exception|string|Int|Float|String|Variant|Object|Message|void|message)\b
      scope: storage.type
    - match: \b(struct|endstruct)\b
      scope: entity.name.struct

    - match: 'declspec|constructor'
      scope: entity.name.function.constructor
    - match: 'declspec|destructor|handler'
      scope: entity.name.function.destructor
    - match: ''
      scope: entity.name.function

    - match: "^\\s*(#)\\s*\\b(include)\\b"
      captures:
        1: meta.preprocessor.is3
        2: keyword.control.include.is3




  double_quoted_string:
    - meta_scope: string.quoted.double.is3
    - match: '\\.'
      scope: constant.character.escape.is3
    - match: '"'
      scope: punctuation.definition.string.end.is3
      pop: true

  line_comment:
    - meta_scope: comment.line.is3
    - match: $
      pop: true
  • Вопрос задан
  • 26 просмотров
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы