7 lines
31 KiB
JavaScript
7 lines
31 KiB
JavaScript
|
const lang = Object.freeze({ "displayName": "AppleScript", "fileTypes": ["applescript", "scpt", "script editor"], "firstLineMatch": "^#!.*(osascript)", "name": "applescript", "patterns": [{ "include": "#blocks" }, { "include": "#inline" }], "repository": { "attributes.considering-ignoring": { "patterns": [{ "match": ",", "name": "punctuation.separator.array.attributes.applescript" }, { "match": "\\b(and)\\b", "name": "keyword.control.attributes.and.applescript" }, { "match": "\\b(?i:case|diacriticals|hyphens|numeric\\s+strings|punctuation|white\\s+space)\\b", "name": "constant.other.attributes.text.applescript" }, { "match": "\\b(?i:application\\s+responses)\\b", "name": "constant.other.attributes.application.applescript" }] }, "blocks": { "patterns": [{ "begin": "^\\s*(script)\\s+(\\w+)", "beginCaptures": { "1": { "name": "keyword.control.script.applescript" }, "2": { "name": "entity.name.type.script-object.applescript" } }, "end": "^\\s*(end(?:\\s+script)?)(?=\\s*(--.*?)?$)", "endCaptures": { "1": { "name": "keyword.control.script.applescript" } }, "name": "meta.block.script.applescript", "patterns": [{ "include": "$self" }] }, { "begin": "^(?x)\n\\s*(to|on)\\s+\n(\\w+)\n(\\()\n((?:[\\s,:\\{\\}]*(?:\\w+)?)*)\n(\\))\n", "beginCaptures": { "1": { "name": "keyword.control.function.applescript" }, "2": { "name": "entity.name.function.handler.applescript" }, "3": { "name": "punctuation.definition.parameters.begin.applescript" }, "4": { "name": "variable.parameter.handler.applescript" }, "5": { "name": "punctuation.definition.parameters.end.applescript" } }, "comment": "\n This is not a very well-designed rule. For now,\n we can leave it like this though, as it sorta works.\n ", "end": "^\\s*(end)(?:\\s+(\\2))?(?=\\s*(--.*?)?$)", "endCaptures": { "1": { "name": "keyword.control.function.applescript" } }, "name": "meta.function.positional.applescript", "patterns": [{ "include": "$self" }] }, { "begin": "^(?x)\n\\s*(to|on)\\s+\n(\\w+)\n(?:\\s+\n(of|in)\\s+\n(\\w+)\n)?\n(?=\\s+(above|against|apart\\s+from|around|aside\\s+from|at|below|beneath|beside|between|by|for|from|instead\\s+of|into|on|onto|out\\s+of|over|thru|under)\\b)\n", "beginCaptures": { "1": { "name": "keyword.control.function.applescript" }, "2": { "name": "entity.name.function.handler.applescript" }, "3": { "name": "keyword.control.function.applescript" }, "4": { "name": "variable.parameter.handler.direct.applescript" } }, "comment": "TODO: match `given` parameters", "end": "^\\s*(end)(?:\\s+(\\2))?(?=\\s*(--.*?)?$)", "endCaptures": { "1": { "name": "keyword.control.function.applescript" } }, "name": "meta.function.prepositional.applescript", "patterns": [{ "captures": { "1": { "name": "keyword.control.preposition.applescript" }, "2": { "name": "variable.parameter.handler.applescript" } }, "match": "\\b(?i:above|against|apart\\s+from|around|aside\\s+from|at|below|beneath|beside|between|by|for|from|instead\\s+of|into|on|onto|out\\s+of|over|thru|under)\\s+(\\w+)\\b" }, { "include": "$self" }] }, { "begin": "^(?x)\n\\s*(to|on)\\s+\n(\\w+)\n(?=\\s*(--.*?)?$)\n", "beginCaptures": { "1": { "name": "keyword.control.function.applescript" }, "2": { "name": "entity.name.function.handler.applescript" } }, "end": "^\\s*(end)(?:\\s+(\\2))?(?=\\s*(--.*?)?$)", "endCaptures": { "1": { "name": "keyword.control.function.applescript" } }, "name": "meta.function.parameterless.applescript", "patterns": [{ "include": "$self" }] }, { "include": "#blocks.tell" }, { "include": "#blocks.repeat" }, { "include": "#blocks.statement" }, { "include": "#blocks.other" }] }, "blocks.other": { "patterns": [{ "begin": "^\\s*(considering)\\b", "end": "^\\s*(end(?:\\s+considering)?)(?=\\s*(--.*?)?$)", "name": "meta.block.considering.applescript", "patterns": [{ "begin": "(?<=considering)", "end": "(?<!\xAC)$", "name": "meta.array.attributes.considering.applescript", "patterns": [{ "include": "#attributes.considering-ignoring" }] }, { "begin": "(?<=ignoring)", "end": "(?<!\xAC)$", "name": "meta.array.attributes.ignoring.applescript", "patterns": [{ "include": "#attributes.considering-ig
|
||
|
var applescript = [
|
||
|
lang
|
||
|
];
|
||
|
|
||
|
export { applescript as default };
|