| { | |
| "name": "upstart", | |
| "scopeName": "source.upstart", | |
| "patterns": [ | |
| { "include": "#comment" }, | |
| { "include": "#exec" }, | |
| { "include": "#script" }, | |
| { "include": "#env" }, | |
| { "include": "#export" }, | |
| { "include": "#expect" }, | |
| { "include": "#kill-reload-signal" }, | |
| { "include": "#kill-timeout" }, | |
| { "include": "#documentation" }, | |
| { "include": "#emits" }, | |
| { "include": "#event-definition" }, | |
| { "include": "#normal-exit" }, | |
| { "include": "#respawn-limit" }, | |
| { "include": "#tasks-respawning" }, | |
| { "include": "#console" }, | |
| { "include": "#limit" }, | |
| { "include": "#nice" }, | |
| { "include": "#oom-score" }, | |
| { "include": "#umask" }, | |
| { "include": "#instance" }, | |
| { "include": "#import" }, | |
| { "include": "#tmpfiles" } | |
| ], | |
| "repository": { | |
| "comment": { | |
| "name": "comment.line.upstart", | |
| "begin": "#", | |
| "end": "$" | |
| }, | |
| "script": { | |
| "begin": "^((pre|post)-(start|stop) )?script", | |
| "end": "^end script", | |
| "name": "meta.script.upstart", | |
| "beginCaptures": { | |
| "0": { "name": "storage.type.script.upstart" } | |
| }, | |
| "endCaptures": { | |
| "0": { "name": "storage.type.script.upstart" } | |
| }, | |
| "contentName": "meta.embedded.block.shellscript", | |
| "patterns": [ | |
| { "include": "source.shell" } | |
| ] | |
| }, | |
| "exec": { | |
| "begin": "^((pre|post)-(start|stop) )?exec", | |
| "end": "(?<!\\\\)\\n", | |
| "name": "meta.exec.upstart", | |
| "beginCaptures": { | |
| "0": { "name": "storage.type.exec.upstart" } | |
| }, | |
| "contentName": "meta.embedded.block.shellscript", | |
| "patterns": [ | |
| { "include": "source.shell" } | |
| ] | |
| }, | |
| "env": { | |
| "match": "^env\\s+(\\w+)(?:(=)(.+))?$", | |
| "name": "keyword.other.env.upstart", | |
| "captures": { | |
| "1": { "name": "variable.upstart" }, | |
| "2": { "name": "keyword.operator.equals.upstart" }, | |
| "3": { "name": "string.upstart" } | |
| } | |
| }, | |
| "export": { | |
| "match": "^export (\\w+)$", | |
| "name": "keyword.other.export.upstart", | |
| "captures": { | |
| "1": { "name": "variable.upstart"} | |
| } | |
| }, | |
| "expect": { | |
| "match": "^expect (fork|daemon|stop)$", | |
| "name": "keyword.other.expect.upstart" | |
| }, | |
| "unsigned-number": { | |
| "match": "\\b\\d+\\b", | |
| "name": "constant.numeric.upstart" | |
| }, | |
| "signal-name": { | |
| "match": "\\b(SIG)?(HUP|INT|QUIT|ILL|TRAP|ABRT|IOT|BUS|EMT|FPE|KILL|USR1|SEGV|USR2|PIPE|ALRM|TERM|STKFLT|CHLD|CLD|CONT|STOP|TSTP|TTIN|TTOU|URG|XCPU|XFSZ|VTALRM|PROF|WINCH|IO|POLL|PWR|INFO|LOST|SYS|UNUSED)\\b", | |
| "name": "constant.language.signal.upstart" | |
| }, | |
| "kill-reload-signal": { | |
| "begin": "^(kill|reload) signal", | |
| "end": "$", | |
| "beginCaptures": { | |
| "0": { "name": "keyword.other.kill-reload.upstart" } | |
| }, | |
| "patterns": [ | |
| { "include": "#unsigned-number" }, | |
| { "include": "#signal-name" } | |
| ] | |
| }, | |
| "number": { | |
| "match": "\\b\\d+\\b", | |
| "name": "constant.numeric.upstart" | |
| }, | |
| "kill-timeout": { | |
| "begin": "^kill timeout", | |
| "end": "$", | |
| "beginCaptures": { | |
| "0": { "name": "keyword.other.kill-timeout.upstart" } | |
| }, | |
| "patterns": [ | |
| { "include": "#number" } | |
| ] | |
| }, | |
| "double-quoted-string": { | |
| "begin": "\"", | |
| "end": "\"", | |
| "name": "string.quoted.double.upstart" | |
| }, | |
| "documentation": { | |
| "begin": "^(author|description|version|usage)", | |
| "end": "$", | |
| "beginCaptures": { | |
| "0": { "name": "keyword.other.documentation.upstart"} | |
| }, | |
| "patterns":[ | |
| { "include": "#double-quoted-string" } | |
| ] | |
| }, | |
| "emits": { | |
| "begin": "^emits", | |
| "end": "$", | |
| "beginCaptures": { | |
| "0": { "name": "keyword.other.emits.upstart" } | |
| }, | |
| "patterns": [ | |
| { | |
| "comment": "No special treatment for wildcards (*,?), becuase there is no usage in platform2.", | |
| "match": "\\S+", | |
| "name": "string.unquoted.event.upstart" | |
| } | |
| ] | |
| }, | |
| "event-definition": { | |
| "begin": "^(start|stop) on", | |
| "end": "$", | |
| "beginCaptures": { | |
| "0": { "name": "keyword.other.event-definition.upstart" } | |
| }, | |
| "patterns":[ | |
| { | |
| "match": "\\b(started|starting|stopped|stopping)\\b", | |
| "name": "keyword.operator.modifier.upstart" | |
| }, | |
| { | |
| "match": "\\b(and|or)\\b", | |
| "name": "keyword.operator.logical.upstart" | |
| }, | |
| { | |
| "match": "(\\w|-)+", | |
| "name": "entity.name.function.event.upstart" | |
| } | |
| ] | |
| }, | |
| "normal-exit": { | |
| "begin": "^normal exit", | |
| "end": "$", | |
| "beginCaptures": { | |
| "0": { "name": "keyword.other.normal-exit.upstart" } | |
| }, | |
| "patterns": [ | |
| { "include": "#unsigned-number" }, | |
| { "include": "#signal-name"} | |
| ] | |
| }, | |
| "respawn-limit": { | |
| "match": "^(respawn limit) (?:(\\d+) (\\d+)|(unlimited))", | |
| "name": "meta.respawn-limit.upstart", | |
| "captures": { | |
| "1": { "name": "keyword.other.respawn-limit.upstart" }, | |
| "2": { "name": "constant.numeric.upstart" }, | |
| "3": { "name": "constant.numeric.upstart" }, | |
| "4": { "name": "constant.language.unlimited.upstart" } | |
| } | |
| }, | |
| "tasks-respawning": { | |
| "match": "^(task|respawn)", | |
| "name": "keyword.other.task-respawn.upstart" | |
| }, | |
| "console": { | |
| "match": "^console (none|log|output|owner)", | |
| "name": "keyword.other.console.upstart" | |
| }, | |
| "limit": { | |
| "begin": "^(limit) (\\w+)", | |
| "end": "$", | |
| "beginCaptures": { | |
| "1": { "name": "keyword.other.limit.upstart" }, | |
| "2": { "name": "entity.name.other.resource.upstart" } | |
| }, | |
| "patterns": [ | |
| { | |
| "match": "\\bunlimited\\b", | |
| "name": "constant.language.unlimited.upstart" | |
| }, | |
| { "include": "#unsigned-number" } | |
| ] | |
| }, | |
| "nice": { | |
| "match": "^(nice) (\\d+)+", | |
| "name": "meta.nice.upstart", | |
| "captures": { | |
| "1": { "name": "keyword.other.nice.upstart" }, | |
| "2": { "name": "constant.numeric.upstart" } | |
| } | |
| }, | |
| "oom-score": { | |
| "match": "^(oom score) (?:(-?\\d+)|(never))", | |
| "name": "meta.oom-score.upstart", | |
| "captures" : { | |
| "1": { "name": "keyword.other.oom-score.upstart" }, | |
| "2": { "name": "constant.numeric.upstart" }, | |
| "3": { "name": "constant.language.never.upstart" } | |
| } | |
| }, | |
| "umask": { | |
| "match": "^umask", | |
| "name": "keyword.other.umask.upstart" | |
| }, | |
| "instance": { | |
| "match": "^(instance) (\\$\\S+)", | |
| "name": "meta.instance.upstart", | |
| "captures": { | |
| "1": { "name": "keyword.other.instance.upstart" }, | |
| "2": { "name": "variable.other.instance.upstart" } | |
| } | |
| }, | |
| "import": { | |
| "match": "^(import) (\\w+)$", | |
| "name": "meta.import.upstart", | |
| "captures": { | |
| "1": { "name": "keyword.other.import.upstart" }, | |
| "2": { "name": "variable.upstart" } | |
| } | |
| }, | |
| "tmpfiles": { | |
| "begin": "^tmpfiles", | |
| "end": "$", | |
| "beginCaptures" : { | |
| "0" : { "name": "keyword.other.tmpfiles.upstart" } | |
| }, | |
| "name": "meta.tmpfiles.upstart", | |
| "patterns": [ | |
| { | |
| "match": "/\\S+", | |
| "name": "string.unquoted.tmpfiles.upstart" | |
| } | |
| ] | |
| } | |
| } | |
| } |