File tree 2 files changed +18
-2
lines changed
2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -39,8 +39,9 @@ def self.builtins
39
39
40
40
state :strings do
41
41
rule %r/\\ ./ , Str ::Escape
42
+ rule %r/(\$ [\$ ]+|%[%]+)(\{ )/ , Str
42
43
rule %r/\$ \{ / do
43
- token Keyword
44
+ token Punctuation
44
45
push :interpolation
45
46
end
46
47
end
@@ -66,7 +67,7 @@ def self.builtins
66
67
67
68
state :interpolation do
68
69
rule %r/\} / do
69
- token Keyword
70
+ token Punctuation
70
71
pop!
71
72
end
72
73
Original file line number Diff line number Diff line change @@ -84,3 +84,18 @@ resource "aws_subnet" "main" {
84
84
resource "aws_cloudfront_distribution" "s3_distribution" {
85
85
aliases = ["www.${replace(var.domain_name, "/\\.$/", "")}"]
86
86
}
87
+
88
+ # Directives in string templates
89
+ locals {
90
+ policy = <<EOT
91
+ %{ for ip in aws_instance.example[*].private_ip }
92
+ server ${ip}
93
+ %{ endfor }
94
+ EOT
95
+ }
96
+
97
+ # Special escape sequences that do not use backslashes
98
+ locals {
99
+ demo_dollars_1 = "$${local.demo}"
100
+ demo_dollars_2 = "%%{for i in items}"
101
+ }
You can’t perform that action at this time.
0 commit comments