Blame view

bower_components/prism/tests/languages/puppet/interpolation_feature.test 1.75 KB
f748e9cf   Luigi Serra   new controllet an...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
  "$foo ${::foo} ${foo::bar.foobar}

  ${foobar(42)} ${::interfaces.split(",")[3]}

  ${[1,20,3].filter |$value| { $value < 10 }}"

  

  ----------------------------------------------------

  

  [

  	["string", [["double-quoted", [

  		"\"",

  		["interpolation", ["$foo"]],

  		["interpolation", [

  			["delimiter", "$"], ["punctuation", "{"],

  			["short-variable", [["punctuation", "::"], "foo"]],

  			["punctuation", "}"]

  		]],

  		["interpolation", [

  			["delimiter", "$"], ["punctuation", "{"],

  			["short-variable", ["foo", ["punctuation", "::"], "bar"]],

  			["punctuation", "."], ["function", "foobar"],

  			["punctuation", "}"]

  		]],

  		["interpolation", [

  			["delimiter", "$"], ["punctuation", "{"],

  			["function", "foobar"], ["punctuation", "("],

  			["number", "42"], ["punctuation", ")"],

  			["punctuation", "}"]

  		]],

  		["interpolation", [

  			["delimiter", "$"], ["punctuation", "{"],

  			["short-variable", [["punctuation", "::"], "interfaces"]],

  			["punctuation", "."], ["function", "split"],

  			["punctuation", "("], ["string", [["double-quoted", ["\",\""]]]],

  			["punctuation", ")"], ["punctuation", "["],

  			["number", "3"], ["punctuation", "]"],

  			["punctuation", "}"]

  		]],

  		["interpolation", [

  			["delimiter", "$"], ["punctuation", "{"],

  			["punctuation", "["], ["number", "1"],

  			["punctuation", ","], ["number", "20"],

  			["punctuation", ","], ["number", "3"], ["punctuation", "]"],

  			["punctuation", "."], ["function", "filter"],

  			["operator", "|"], ["variable", ["$value"]], ["operator", "|"],

  			["punctuation", "{"], ["variable", ["$value"]],

  			["operator", "<"], ["number", "10"], ["punctuation", "}"],

  			["punctuation", "}"]

  		]],

  		"\""

  	]]]]

  ]

  

  ----------------------------------------------------

  

  Checks for interpolation.