-
Notifications
You must be signed in to change notification settings - Fork 1
/
cwl.sublime-syntax
74 lines (65 loc) · 2.9 KB
/
cwl.sublime-syntax
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
%YAML 1.2
---
#
name: CWL
# See http://www.sublimetext.com/docs/3/syntax.html
file_extensions:
- cwl
scope: source.cwl
contexts:
# The prototype context is prepended to all contexts but those setting
# meta_include_prototype: false.
prototype:
- include: comments
main:
# The main context is the initial starting point of our syntax.
# Include other contexts from here (or specify them directly).
- include: keywords
- include: type
- include: constant
- include: double_quoted_strings
- include: single_quoted_strings
keywords:
- match: '\b(class|cwlVersion|dockerPull|inputs|outputs|steps|id|requirements|hints|label|doc|secondaryFiles|streamable|outputBinding|format|outputSource|linkMerge|type|glob|loadContents|outputEval|merge_nested|merge_flattened|location|path|basename|dirname|nameroot|nameext|checksum|size|format|contents|listing|fields|symbols|items|in|out|run|scatter|scatterMethod|source|default|valueFrom|expressionLib|types|linkMerge|inputBinding|position|prefix|separate|itemSeparator|valueFrom|shellQuote|packages|package|version|specs|entry|entryname|writable|baseCommand|arguments|stdin|stderr|stdout|successCodes|temporaryFailCodes|permanentFailCodes|dockerLoad|dockerFile|dockerImport|dockerImageId|dockerOutputDirectory|envDef|envName|envValue|coresMin|coresMax|ramMin|ramMax|tmpdirMin|tmpdirMax|outdirMin|outdirMax)(?=:)'
scope: keyword.control.cwl
type:
- match: '\b(CommandLineTool|ExpressionTool|Workflow|InlineJavascriptRequirement|SchemaDefRequirement|DockerRequirement|SoftwareRequirement|InitialWorkDirRequirement|EnvVarRequirement|ShellCommandRequirement|ResourceRequirement)\b'
scope: support.type.cwl
constant:
- match: ':\s+(null|boolean|int|long|float|double|string|File|Directory)\b'
scope: storage.type.cwl
# double quoted string
double_quoted_strings:
- match: '"'
scope: punctuation.definition.string.begin.cwl
push: inside_double_quoted_string
inside_double_quoted_string:
- meta_include_prototype: false
- meta_scope: string.quoted.double.cwl
- match: '\.'
scope: constant.character.escape.cwl
- match: '"'
scope: punctuation.definition.string.end.cwl
pop: true
# single quoted string
single_quoted_strings:
- match: \'
scope: punctuation.definition.string.begin.cwl
push: inside_single_quoted_string
inside_single_quoted_string:
- meta_include_prototype: false
- meta_scope: string.quoted.single.cwl
- match: '\.'
scope: constant.character.escape.cwl
- match: \'
scope: punctuation.definition.string.end.cwl
pop: true
comments:
# Comments begin with a '#' and finish at the end of the line.
- match: '#.*$'
scope: punctuation.definition.comment.cwl
push:
# This is an anonymous context push for brevity.
- meta_scope: comment.line.number-sign.cwl
- match: $\n?
pop: true