Skip to content

web search done right

1.8 KB
Raw Blame
{
  "scopeName": "source.optic",
  "patterns": [
    {
      "include": "#expression"
    }
  ],
  "repository": {
    "expression": {
      "patterns": [
        {
          "include": "#keywords"
        },
        {
          "include": "#control"
        },
        {
          "include": "#punctuation"
        },
        {
          "include": "#comments"
        },
        {
          "include": "#strings"
        }
      ]
    },
    "keywords": {
      "match": "\\b(Matches|Signal|Field|Site|Url|Domain|Title|Description|Content|MicroformatTag|Schema|Action|Boost|Downrank|Discard|Ranking|Stage)\\b",
      "name": "entity.name.function"
    },
    "control": {
      "match": "\\b(DiscardNonMatching|Rule|Like|Dislike|RankingPipeline)\\b",
      "name": "keyword.control"
    },
    "punctuation": {
      "match": ",|;",
      "name": "punctuation.separator"
    },
    "strings": {
      "name": "string.quoted.double.optic",
      "begin": "\"",
      "end": "\"",
      "patterns": [
        {
          "name": "constant.character.escape.optic",
          "match": "\\\\."
        }
      ]
    },
    "comments": {
      "patterns": [
        {
          "name": "comment.block",
          "begin": "(\\/\\*)",
          "beginCaptures": {
            "1": {
              "name": "punctuation.definition.comment"
            }
          },
          "end": "(\\*\\/)",
          "endCaptures": {
            "1": {
              "name": "punctuation.definition.comment"
            }
          }
        },
        {
          "name": "comment.line.double-slash",
          "begin": "(\\/\\/)",
          "beginCaptures": {
            "1": {
              "name": "punctuation.definition.comment"
            }
          },
          "end": "(?:\\n|$)"
        }
      ]
    }
  }
}