<commit_before>%YAML 1.2
---
# See http://www.sublimetext.com/docs/3/syntax.html
# See http://www.sublimetext.com/docs/3/scope_naming.html
name: CaffeineScript
file_extensions:
  - caf
  - caffeine
scope: source.caffeine
contexts:
  main:

    - match: '/([^\\]|\\.)+/[igmuy]*'
      scope: string.regexp.caffeine

    - match: '(?:^( *))##'
      push: block_comment

    - match: '(?:^( *))"""? *\n'
      scope: string.quoted.double.caffeine
      push: block_string

    - match: '""'
      scope: string.quoted.double.caffeine
      push: to_eol_string

    - match: '^[|]'
      push: caffeine_mc_block

    # Numbers
    - match: '[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?'
      scope: constant.numeric.caffeine

    # object-literal property names:
    - match: '((?!\s)[-~!@\#$%^&*_+=|\\<>?/.$\w\u007f-\uffff])+\:'
      scope: entity.name.function.caffeine

    - match: '\:((?!\s)[-~!@\#$%^&*_+=|\\<>?/.$\w\u007f-\uffff])+'
      scope: string.quoted.double.caffeine

    - match: '->'
      scope: storage.type.function.caffeine

    - match : '&(?!\d)((?:(?!\s)[$\w\u007f-\uffff])+)'
      scope: string.quoted.double.caffeine

    - match: '[-+=!%&*|<>?]|==|&&|\|\|'
      scope: keyword.operator.caffeine

    - match: '\@(?!\d)((?:(?!\s)[$\w\u007f-\uffff])+)?'
      scope: variable.other.readwrite.instance.caffeine

    - match: '\b(false|true)\b'
      scope: constant.language.boolean.caffeine


    # Comments begin with a '#' and finish at the end of the line
    - match: '#'
      scope: punctuation.definition.comment.caffeine
      push: line_comment

    # - match: '"".*'
    #   scope: string.quoted.double.caffeine

    # Strings begin and end with quotes, and use backslashes as an escape
    # character
    - match: '"(?!")'
      scope: punctuation.definition.string.begin.caffeine
      push: double_quoted_string

    - match: "'"
      scope: punctuation.definition.string.begin.caffeine
      push: single_quoted_string

    - match: '\.[_a-zA-Z0-9]'

    # Keywords are if, else for and while.
    # Note that blackslashes don't need to be escaped within single quoted
    # strings in YAML. When using single quoted strings, only single quotes
    # need to be escaped: this is done by using two single quotes next to each
    # other.
    - match: '\b(null|super|instanceof|return|break|into|try|catch|then|and|or|is|isnt|not|if|else|switch|unless|until|throw|new|while|class|extends|array|object|find|each|in|from|with|do|case|when|import)\b'
      scope: keyword.caffeine

    - match: '[.,\[\]\(\)]'
      scope: comment.line_comment

    - match: "\\{"
      push: main

    - match: "\\}"
      pop: true

    - match: '\bfor.*\b(in|of)\b'
      scope: invalid constant.character.escape.caffeine

  interpolation:
    - match: "\\}"
      scope: string.quoted.double.caffeine
      pop: true
    - include: main

  interpolatable:
    - match: "\\#\\{"
      scope: string.quoted.double.caffeine
      push: interpolation

  caffeine_mc_block:
    - meta_scope: comment.block
    - match: '^(?=[^ \s])'
      pop: true

  block_comment:
    - meta_scope: comment.block
    - match: '^(?!\1 +[^ ])(?= *[^ \n])'
      pop: true

  block_string:
    - match: '^(?!\1 +[^ ])(?= *[^ \n])'
      pop: true
    - include: interpolatable
    - match: "."
      scope: string.quoted.double.caffeine

  to_eol_string:
    - match: '(?:\n)'
      pop: true
    - include: interpolatable
    - match: "."
      scope: string.quoted.double.caffeine

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

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

  line_comment:
    - meta_scope: comment.line.caffeine
    - match: $
      pop: true
<commit_msg>FIX: /foo/ ... " / " highlighted most of that as regex<commit_after>%YAML 1.2
---
# See http://www.sublimetext.com/docs/3/syntax.html
# See http://www.sublimetext.com/docs/3/scope_naming.html
name: CaffeineScript
file_extensions:
  - caf
  - caffeine
scope: source.caffeine
contexts:
  main:

    - match: '/([^\\/]|\\.)+/[igmuy]*'
      scope: string.regexp.caffeine

    - match: '<[\w\u007f-\uffff]+>'
      scope: keyword.macro.compileTime.caffeine

    - match: '(?:^( *))##'
      push: block_comment

    - match: '(?:^( *))"""? *\n'
      scope: string.quoted.double.caffeine
      push: block_string

    - match: '""'
      scope: string.quoted.double.caffeine
      push: to_eol_string

    - match: '^[|]'
      push: caffeine_mc_block

    # Numbers
    - match: '[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?'
      scope: constant.numeric.caffeine

    # object-literal property names:
    - match: '((?!\s)[-~!@\#$%^&*_+=|\\<>?/.$\w\u007f-\uffff])+\:'
      scope: entity.name.function.caffeine

    - match: '\:((?!\s)[-~!@\#$%^&*_+=|\\<>?/.$\w\u007f-\uffff])+'
      scope: string.quoted.double.caffeine

    - match: '->'
      scope: storage.type.function.caffeine

    - match : '&(?!\d)((?:(?!\s)[$\w\u007f-\uffff])+)'
      scope: string.quoted.double.caffeine

    - match: '[-+=!%&*|<>?]|==|&&|\|\|'
      scope: keyword.operator.caffeine

    - match: '\@(?!\d)((?:(?!\s)[$\w\u007f-\uffff])+)?'
      scope: variable.other.readwrite.instance.caffeine

    - match: '\b(false|true)\b'
      scope: constant.language.boolean.caffeine


    # Comments begin with a '#' and finish at the end of the line
    - match: '#'
      scope: punctuation.definition.comment.caffeine
      push: line_comment

    # - match: '"".*'
    #   scope: string.quoted.double.caffeine

    # Strings begin and end with quotes, and use backslashes as an escape
    # character
    - match: '"(?!")'
      scope: punctuation.definition.string.begin.caffeine
      push: double_quoted_string

    - match: "'"
      scope: punctuation.definition.string.begin.caffeine
      push: single_quoted_string

    - match: '\.[_a-zA-Z0-9]'

    # Keywords are if, else for and while.
    # Note that blackslashes don't need to be escaped within single quoted
    # strings in YAML. When using single quoted strings, only single quotes
    # need to be escaped: this is done by using two single quotes next to each
    # other.
    - match: '\b(null|super|instanceof|return|break|into|try|catch|then|and|or|is|isnt|not|if|else|switch|unless|until|throw|new|while|class|extends|array|object|find|each|in|from|with|do|case|when|import)\b'
      scope: keyword.caffeine

    - match: '[.,\[\]\(\)]'
      scope: comment.line_comment

    - match: "\\{"
      push: main

    - match: "\\}"
      pop: true

    - match: '\bfor.*\b(in|of)\b'
      scope: invalid constant.character.escape.caffeine

  interpolation:
    - match: "\\}"
      scope: string.quoted.double.caffeine
      pop: true
    - include: main

  interpolatable:
    - match: "\\#\\{"
      scope: string.quoted.double.caffeine
      push: interpolation

  caffeine_mc_block:
    - meta_scope: comment.block
    - match: '^(?=[^ \s])'
      pop: true

  block_comment:
    - meta_scope: comment.block
    - match: '^(?!\1 +[^ ])(?= *[^ \n])'
      pop: true

  block_string:
    - match: '^(?!\1 +[^ ])(?= *[^ \n])'
      pop: true
    - include: interpolatable
    - match: "."
      scope: string.quoted.double.caffeine

  to_eol_string:
    - match: '(?:\n)'
      pop: true
    - include: interpolatable
    - match: "."
      scope: string.quoted.double.caffeine

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

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

  line_comment:
    - meta_scope: comment.line.caffeine
    - match: $
      pop: true

{'fraction_non_alphanumeric': 0.18547121998310606, 'fraction_numerical': 0.006636901170508025, 'mean_word_length': 2.5074058400338552, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 12, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4485465', 'n_tokens_mistral': 3121, 'n_tokens_neox': 2952, 'n_words': 529}