Skip to content

Commit

Permalink
revise: updates the WDL TextMate grammar
Browse files Browse the repository at this point in the history
* Adds placeholders within strings.
* Fixes identifier highlighting.
* Adds multi-line string highlighting.
* Removes markdown highlighting for single number-sign comments.
* Removes `call`, `scatter`, and `if` blocks, as they need to
  be parsed by the LSP (they're too complicated to be handled
  with the TextMate grammar).
* Applies `prettier` formatting.
  • Loading branch information
claymcleod committed Jul 30, 2024
1 parent 1e088de commit f95a341
Show file tree
Hide file tree
Showing 2 changed files with 309 additions and 126 deletions.
22 changes: 20 additions & 2 deletions syntaxes/example.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,27 @@ struct AStruct {
String member
}

## # Here are some more
## _double_ pound lines.
# (These should not be markdown highlighted, as they are single number sign comments).
#
# **Here** are some more
# _single_ pound lines.
#
# > And a quote
task a_task {
meta
# Here is a comment between `meta` and the parenthesis.
{
# Here is a comment within `meta`.
an_escaped_string: "bar \\ \n \t \' \" \~ \$ \000 \xFF \uFFFF \UFFFFFFFF"
a_string_with_placeholders: "${foo} ~{bar}"
a_multiline_string: <<<
${some_placeholder}
this
spans
multiple
lines
>>>
a_true: true
a_false: false
an_integer: 42
Expand All @@ -34,6 +46,8 @@ task a_task {
subkey_four: false,
}
an_undefined_value: null
# The '2' at the end of this identifier shouldn't be highlighted as a numeric.
a_name_with_foo2: false
}

parameter_meta
Expand Down Expand Up @@ -67,6 +81,10 @@ task a_task {
# the TextMate language that it's a custom struct.
}

command <<<
echo "Hello, ~{world}"
>>>

output
# Here is a comment before the output.
{
Expand Down
Loading

0 comments on commit f95a341

Please sign in to comment.