Merge pull request #116 from fonsecas72/fix-heredoc

terraform Fix heredoc
This commit is contained in:
Alexandru Dima 2020-12-23 14:51:35 +01:00 committed by GitHub
commit 1fd3a99e93
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 30 additions and 1 deletions

View file

@ -992,6 +992,35 @@ testTokenization('hcl', [
}
],
/*
foo = <<-EOF
bar
EOF
*/
[
{
line: ' foo = <<-EOF',
tokens: [
{ startIndex: 0, type: '' },
{ startIndex: 2, type: 'variable.hcl' },
{ startIndex: 5, type: '' },
{ startIndex: 6, type: 'operator.hcl' },
{ startIndex: 7, type: '' },
{ startIndex: 8, type: 'string.heredoc.delimiter.hcl' }
]
},
{
line: ' bar',
tokens: [{ startIndex: 0, type: 'string.heredoc.hcl' }]
},
{
line: ' EOF',
tokens: [
{ startIndex: 0, type: 'string.heredoc.hcl' },
{ startIndex: 2, type: 'string.heredoc.delimiter.hcl' }
]
}
],
/*
foo = <<EOF
bar
EOF

View file

@ -143,7 +143,7 @@ export const language = <languages.IMonarchLanguage>{
],
heredocBody: [
[
/^([\w\-]+)$/,
/([\w\-]+)$/,
{
cases: {
'$1==$S2': [