<commit_before>%YAML 1.2
---
name: 'GoSublime: Template'
scope: source.gotemplate
hidden: true
contexts:
  main:
    - match: ":="
      scope: keyword.operator.initialize.gotemplate
    - match: \|
      scope: keyword.operator.pipe.gotemplate
    - match: '[.$][\w]*'
      scope: variable.other.gotemplate
    - match: \b(if|else|range|template|with|end|nil|define)\b
      scope: keyword.control.gotemplate
    - match: \b(and|call|html|index|js|len|not|or|print|printf|println|urlquery|eq|ne|lt|le|gt|ge)\b
      scope: support.function.builtin.gotemplate
    - match: /\*
      push:
        - meta_scope: comment.block.gotemplate
        - match: \*/
          pop: true
    - match: '"'
      captures:
        0: punctuation.definition.string.begin.gotemplate
      push:
        - meta_scope: string.quoted.double.gotemplate
        - match: '"'
          captures:
            0: punctuation.definition.string.end.gotemplate
          pop: true
        - include: string_placeholder
        - include: string_escaped_char
    - match: "`"
      captures:
        0: punctuation.definition.string.begin.gotemplate
      push:
        - meta_scope: string.quoted.raw.gotemplate
        - match: "`"
          captures:
            0: punctuation.definition.string.end.gotemplate
          pop: true
        - include: string_placeholder
  string_escaped_char:
    - match: '\\(\\|[abfnrtv''"]|x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|U[0-9a-fA-F]{8}|[0-7]{3})'
      scope: constant.character.escape.gotemplate
    - match: \\.
      scope: invalid.illegal.unknown-escape.gotemplate
  string_placeholder:
    - match: |-
        (?x)%
            (\d+\$)?                                    # field (argument #)
            [#0\- +']*                                  # flags
            [,;:_]?                                     # separator character (AltiVec)
            ((-?\d+)|\*(-?\d+\$)?)?                     # minimum field width
            (\.((-?\d+)|\*(-?\d+\$)?)?)?                # precision
            [diouxXDOUeEfFgGaAcCsSqpnvtTbyYhHmMzZ%]     # conversion type
      scope: constant.other.placeholder.gotemplate
    - match: "%"
      scope: invalid.illegal.placeholder.gotemplate
<commit_msg>Add `block` to template syntax definition (#950)<commit_after>%YAML 1.2
---
name: 'GoSublime: Template'
scope: source.gotemplate
hidden: true
contexts:
  main:
    - match: ":="
      scope: keyword.operator.initialize.gotemplate
    - match: \|
      scope: keyword.operator.pipe.gotemplate
    - match: '[.$][\w]*'
      scope: variable.other.gotemplate
    - match: \b(if|else|range|template|with|end|nil|define|block)\b
      scope: keyword.control.gotemplate
    - match: \b(and|call|html|index|js|len|not|or|print|printf|println|urlquery|eq|ne|lt|le|gt|ge)\b
      scope: support.function.builtin.gotemplate
    - match: /\*
      push:
        - meta_scope: comment.block.gotemplate
        - match: \*/
          pop: true
    - match: '"'
      captures:
        0: punctuation.definition.string.begin.gotemplate
      push:
        - meta_scope: string.quoted.double.gotemplate
        - match: '"'
          captures:
            0: punctuation.definition.string.end.gotemplate
          pop: true
        - include: string_placeholder
        - include: string_escaped_char
    - match: "`"
      captures:
        0: punctuation.definition.string.begin.gotemplate
      push:
        - meta_scope: string.quoted.raw.gotemplate
        - match: "`"
          captures:
            0: punctuation.definition.string.end.gotemplate
          pop: true
        - include: string_placeholder
  string_escaped_char:
    - match: '\\(\\|[abfnrtv''"]|x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|U[0-9a-fA-F]{8}|[0-7]{3})'
      scope: constant.character.escape.gotemplate
    - match: \\.
      scope: invalid.illegal.unknown-escape.gotemplate
  string_placeholder:
    - match: |-
        (?x)%
            (\d+\$)?                                    # field (argument #)
            [#0\- +']*                                  # flags
            [,;:_]?                                     # separator character (AltiVec)
            ((-?\d+)|\*(-?\d+\$)?)?                     # minimum field width
            (\.((-?\d+)|\*(-?\d+\$)?)?)?                # precision
            [diouxXDOUeEfFgGaAcCsSqpnvtTbyYhHmMzZ%]     # conversion type
      scope: constant.other.placeholder.gotemplate
    - match: "%"
      scope: invalid.illegal.placeholder.gotemplate

{'fraction_non_alphanumeric': 0.1524703778224905, 'fraction_numerical': 0.009166107757657053, 'mean_word_length': 1.8227129337539432, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6426372', 'n_tokens_mistral': 1466, 'n_tokens_neox': 1459, 'n_words': 208}