Skip to content

Commit

Permalink
Fix text interpolations
Browse files Browse the repository at this point in the history
  • Loading branch information
menduz committed Sep 7, 2017
1 parent d208cea commit c20cee1
Show file tree
Hide file tree
Showing 4 changed files with 1,232 additions and 0 deletions.
16 changes: 16 additions & 0 deletions DataWeave.YAML-tmLanguage
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,7 @@ repository:
'0': { name: string.quoted.double.dw punctuation.definition.string.end.dw }
patterns:
- include: '#template-substitution-element'
- include: '#template-dollar'
- include: '#string-character-escape'
- match: ([^`])
name: string.template.dw
Expand All @@ -417,6 +418,7 @@ repository:
'0': { name: string.template.dw punctuation.definition.string.template.end.dw}
patterns:
- include: '#template-substitution-element'
- include: '#template-dollar'
- include: '#string-character-escape'
- match: ([^`])
name: string.template.dw
Expand All @@ -434,6 +436,7 @@ repository:
'0': { name: string.quoted.double.dw punctuation.definition.string.end.dw }
patterns:
- include: '#template-substitution-element'
- include: '#template-dollar'
- include: '#string-character-escape'
- match: ([^"])
name: string.quoted.double.dw
Expand All @@ -448,10 +451,23 @@ repository:
'2': { name: invalid.illegal.newline.dw }
patterns:
- include: '#template-substitution-element'
- include: '#template-dollar'
- include: '#string-character-escape'
- match: ([^'])
name: string.quoted.single.dw

template-dollar:
patterns:
- match: (\$(\$)+)
name: variable.parameter.dw
- match: (\$)(?![a-zA-Z(])
name: variable.parameter.dw
- match: (\$)([a-zA-Z][a-zA-Z0-9_]*)
captures:
'1': {name: keyword.other.dw}
'2': {name: variable.other.dw}
name: variable.parameter.dw

template-substitution-element:
name: meta.template.expression.dw
begin: \$\(
Expand Down
53 changes: 53 additions & 0 deletions DataWeave.tmLanguage
Original file line number Diff line number Diff line change
Expand Up @@ -1192,6 +1192,10 @@
<key>include</key>
<string>#template-substitution-element</string>
</dict>
<dict>
<key>include</key>
<string>#template-dollar</string>
</dict>
<dict>
<key>include</key>
<string>#string-character-escape</string>
Expand Down Expand Up @@ -1237,6 +1241,10 @@
<key>include</key>
<string>#template-substitution-element</string>
</dict>
<dict>
<key>include</key>
<string>#template-dollar</string>
</dict>
<dict>
<key>include</key>
<string>#string-character-escape</string>
Expand Down Expand Up @@ -1284,6 +1292,10 @@
<key>include</key>
<string>#template-substitution-element</string>
</dict>
<dict>
<key>include</key>
<string>#template-dollar</string>
</dict>
<dict>
<key>include</key>
<string>#string-character-escape</string>
Expand Down Expand Up @@ -1329,6 +1341,10 @@
<key>include</key>
<string>#template-substitution-element</string>
</dict>
<dict>
<key>include</key>
<string>#template-dollar</string>
</dict>
<dict>
<key>include</key>
<string>#string-character-escape</string>
Expand All @@ -1341,6 +1357,43 @@
</dict>
</array>
</dict>
<key>template-dollar</key>
<dict>
<key>patterns</key>
<array>
<dict>
<key>match</key>
<string>(\$(\$)+)</string>
<key>name</key>
<string>variable.parameter.dw</string>
</dict>
<dict>
<key>match</key>
<string>(\$)(?![a-zA-Z(])</string>
<key>name</key>
<string>variable.parameter.dw</string>
</dict>
<dict>
<key>match</key>
<string>(\$)([a-zA-Z][a-zA-Z0-9_]*)</string>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>keyword.other.dw</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>variable.other.dw</string>
</dict>
</dict>
<key>name</key>
<string>variable.parameter.dw</string>
</dict>
</array>
</dict>
<key>template-substitution-element</key>
<dict>
<key>name</key>
Expand Down
Loading

0 comments on commit c20cee1

Please sign in to comment.