Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Commit

Permalink
Merge pull request #91 from atom/wl-herestring-end
Browse files Browse the repository at this point in the history
End herestrings when parentheses are reached
  • Loading branch information
50Wliu committed Nov 14, 2017
2 parents 152ffbd + 5206d24 commit 1fd9027
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion grammars/shell-unix-bash.cson
Expand Up @@ -623,7 +623,7 @@
'include': '$self'
}
]
'match': '(<<<)\\s*(([^\\s\\\\]|\\\\.)+)'
'match': '(<<<)\\s*(([^\\s)\\\\]|\\\\.)+)'
'name': 'meta.herestring.shell'
}
]
Expand Down
6 changes: 6 additions & 0 deletions spec/shell-unix-bash-spec.coffee
Expand Up @@ -150,6 +150,12 @@ describe "Shell script grammar", ->
expect(tokens[5]).toEqual value: 'TEST', scopes: ['source.shell', 'meta.herestring.shell', 'string.unquoted.herestring.shell']
expect(tokens[6]).toEqual value: ' 1 2', scopes: ['source.shell']
{tokens} = grammar.tokenizeLine '$cmd = "$(3 / x <<< $WORD)"'
expect(tokens[6]).toEqual value: '<<<', scopes: ['source.shell', 'string.quoted.double.shell', 'string.interpolated.dollar.shell', 'meta.herestring.shell', 'keyword.operator.herestring.shell']
expect(tokens[8]).toEqual value: '$', scopes: ['source.shell', 'string.quoted.double.shell', 'string.interpolated.dollar.shell', 'meta.herestring.shell', 'string.unquoted.herestring.shell', 'variable.other.normal.shell', 'punctuation.definition.variable.shell']
expect(tokens[9]).toEqual value: 'WORD', scopes: ['source.shell', 'string.quoted.double.shell', 'string.interpolated.dollar.shell', 'meta.herestring.shell', 'string.unquoted.herestring.shell', 'variable.other.normal.shell']
expect(tokens[10]).toEqual value: ')', scopes: ['source.shell', 'string.quoted.double.shell', 'string.interpolated.dollar.shell', 'punctuation.definition.string.end.shell']
it "tokenizes heredocs", ->
delimsByScope =
"ruby": "RUBY"
Expand Down

0 comments on commit 1fd9027

Please sign in to comment.