Debian Codegraph @

sublime/cwl.sublime-syntax

raw
1 %YAML 1.2
2 ---
3 # CWL syntax highlighting file
4 # Maintainer: Manabu Ishii
5 # Source: https://github.com/manabuishii
6
7 name: CWL
8 # See http://www.sublimetext.com/docs/3/syntax.html
9 file_extensions:
10 - cwl
11 scope: source.cwl
12
13 contexts:
14 # The prototype context is prepended to all contexts but those setting
15 # meta_include_prototype: false.
16 prototype:
17 - include: comments
18
19 main:
20
21 # The main context is the initial starting point of our syntax.
22 # Include other contexts from here (or specify them directly).
23 - include: keywords
24 - include: type
25 - include: constant
26 - include: double_quoted_strings
27 - include: single_quoted_strings
28
29 keywords:
30 - 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)(?=:)'
31 scope: keyword.control.cwl
32
33 type:
34 - match: '\b(CommandLineTool|ExpressionTool|Workflow|InlineJavascriptRequirement|SchemaDefRequirement|DockerRequirement|SoftwareRequirement|InitialWorkDirRequirement|EnvVarRequirement|ShellCommandRequirement|ResourceRequirement)\b'
35 scope: support.type.cwl
36 constant:
37 - match: ':\s+(null|boolean|int|long|float|double|string|File|Directory)\b'
38 scope: storage.type.cwl
39
40 # double quoted string
41 double_quoted_strings:
42 - match: '"'
43 scope: punctuation.definition.string.begin.cwl
44 push: inside_double_quoted_string
45
46 inside_double_quoted_string:
47 - meta_include_prototype: false
48 - meta_scope: string.quoted.double.cwl
49 - match: '\.'
50 scope: constant.character.escape.cwl
51 - match: '"'
52 scope: punctuation.definition.string.end.cwl
53 pop: true
54 # single quoted string
55 single_quoted_strings:
56 - match: \'
57 scope: punctuation.definition.string.begin.cwl
58 push: inside_single_quoted_string
59
60 inside_single_quoted_string:
61 - meta_include_prototype: false
62 - meta_scope: string.quoted.single.cwl
63 - match: '\.'
64 scope: constant.character.escape.cwl
65 - match: \'
66 scope: punctuation.definition.string.end.cwl
67 pop: true
68
69 comments:
70 # Comments begin with a '#' and finish at the end of the line.
71 - match: '#.*$'
72 scope: punctuation.definition.comment.cwl
73 push:
74 # This is an anonymous context push for brevity.
75 - meta_scope: comment.line.number-sign.cwl
76 - match: $\n?
77 pop: true
78
79 # MIT License
80
81 # Copyright (c) 2018 Manabu ISHII
82
83 # Permission is hereby granted, free of charge, to any person obtaining a copy
84 # of this software and associated documentation files (the "Software"), to deal
85 # in the Software without restriction, including without limitation the rights
86 # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
87 # copies of the Software, and to permit persons to whom the Software is
88 # furnished to do so, subject to the following conditions:
89
90 # The above copyright notice and this permission notice shall be included in all
91 # copies or substantial portions of the Software.
92
93 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
94 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
95 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
96 # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
97 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
98 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
99 # SOFTWARE.