kwartz 3.0.0 → 3.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (179) hide show
  1. data/ChangeLog +36 -1
  2. data/LGPL +504 -0
  3. data/README.txt +16 -2
  4. data/bin/kwartz +1 -1
  5. data/doc-api/classes/Kwartz.html +47 -1
  6. data/doc-api/classes/Kwartz/Assertion.html +6 -6
  7. data/doc-api/classes/Kwartz/AssertionError.html +6 -6
  8. data/doc-api/classes/Kwartz/AttrInfo.html +42 -42
  9. data/doc-api/classes/Kwartz/BaseError.html +12 -12
  10. data/doc-api/classes/Kwartz/BaseTranslator.html +210 -43
  11. data/doc-api/classes/Kwartz/CharacterType.html +24 -24
  12. data/doc-api/classes/Kwartz/CommandOptionError.html +7 -7
  13. data/doc-api/classes/Kwartz/CommandOptions.html +49 -49
  14. data/doc-api/classes/Kwartz/Config.html +6 -1
  15. data/doc-api/classes/Kwartz/ConvertError.html +14 -14
  16. data/doc-api/classes/Kwartz/Converter.html +31 -30
  17. data/doc-api/classes/Kwartz/CssStyleParser.html +79 -57
  18. data/doc-api/classes/Kwartz/Defun.html +313 -0
  19. data/doc-api/classes/Kwartz/DocumentRuleset.html +58 -58
  20. data/doc-api/classes/Kwartz/ElementExpander.html +32 -32
  21. data/doc-api/classes/Kwartz/ElementInfo.html +29 -29
  22. data/doc-api/classes/Kwartz/ElementRuleset.html +126 -96
  23. data/doc-api/classes/Kwartz/EperlHandler.html +108 -84
  24. data/doc-api/classes/Kwartz/EperlTranslator.html +7 -7
  25. data/doc-api/classes/Kwartz/ErubisHandler.html +2 -2
  26. data/doc-api/classes/Kwartz/ErubisTranslator.html +8 -8
  27. data/doc-api/classes/Kwartz/ErubyHandler.html +2 -220
  28. data/doc-api/classes/Kwartz/ErubyTranslator.html +7 -7
  29. data/doc-api/classes/Kwartz/ExpandStatement.html +20 -20
  30. data/doc-api/classes/Kwartz/Handler.html +122 -117
  31. data/doc-api/classes/Kwartz/HandlerArgument.html +215 -0
  32. data/doc-api/classes/Kwartz/Helper.html +112 -0
  33. data/doc-api/classes/Kwartz/Helper/ActionViewHelper.html +221 -0
  34. data/doc-api/classes/Kwartz/Helper/RailsTemplate.html +630 -0
  35. data/doc-api/classes/Kwartz/JstlHandler.html +208 -193
  36. data/doc-api/classes/Kwartz/JstlTranslator.html +15 -15
  37. data/doc-api/classes/Kwartz/KwartzError.html +6 -6
  38. data/doc-api/classes/Kwartz/Main.html +39 -23
  39. data/doc-api/classes/Kwartz/NativeExpression.html +18 -18
  40. data/doc-api/classes/Kwartz/NativeStatement.html +25 -25
  41. data/doc-api/classes/Kwartz/Node.html +6 -6
  42. data/doc-api/classes/Kwartz/PIErubisHandler.html +113 -0
  43. data/doc-api/classes/Kwartz/PIErubisTranslator.html +200 -0
  44. data/doc-api/classes/Kwartz/ParseError.html +6 -6
  45. data/doc-api/classes/Kwartz/PhpHandler.html +102 -83
  46. data/doc-api/classes/Kwartz/PhpTranslator.html +14 -14
  47. data/doc-api/classes/Kwartz/PresentationLogicParser.html +136 -128
  48. data/doc-api/classes/Kwartz/PrintStatement.html +19 -19
  49. data/doc-api/classes/Kwartz/RailsHandler.html +121 -118
  50. data/doc-api/classes/Kwartz/RailsTranslator.html +7 -7
  51. data/doc-api/classes/Kwartz/RubyHandler.html +349 -0
  52. data/doc-api/classes/Kwartz/RubyStyleParser.html +85 -85
  53. data/doc-api/classes/Kwartz/RubyTranslator.html +218 -0
  54. data/doc-api/classes/Kwartz/StatementHelper.html +479 -0
  55. data/doc-api/classes/Kwartz/StrutsTranslator.html +12 -12
  56. data/doc-api/classes/Kwartz/TagInfo.html +28 -28
  57. data/doc-api/classes/Kwartz/TextConverter.html +28 -28
  58. data/doc-api/classes/Kwartz/Translator.html +42 -42
  59. data/doc-api/classes/Kwartz/Util.html +284 -0
  60. data/doc-api/created.rid +1 -1
  61. data/doc-api/files/__/README_txt.html +30 -3
  62. data/doc-api/files/kwartz/assert_rb.html +1 -1
  63. data/doc-api/files/kwartz/binding/eperl_rb.html +2 -2
  64. data/doc-api/files/kwartz/binding/erubis_rb.html +3 -3
  65. data/doc-api/files/kwartz/binding/eruby_rb.html +3 -2
  66. data/doc-api/files/kwartz/binding/jstl_rb.html +2 -2
  67. data/doc-api/files/kwartz/binding/php_rb.html +2 -2
  68. data/doc-api/files/kwartz/binding/pierubis_rb.html +116 -0
  69. data/doc-api/files/kwartz/binding/rails_rb.html +2 -2
  70. data/doc-api/files/kwartz/binding/ruby_rb.html +115 -0
  71. data/doc-api/files/kwartz/binding/struts_rb.html +1 -1
  72. data/doc-api/files/kwartz/config_rb.html +2 -2
  73. data/doc-api/files/kwartz/converter_rb.html +3 -2
  74. data/doc-api/files/kwartz/defun_rb.html +116 -0
  75. data/doc-api/files/kwartz/error_rb.html +1 -1
  76. data/doc-api/files/kwartz/helper/rails_rb.html +123 -0
  77. data/doc-api/files/kwartz/main_rb.html +5 -2
  78. data/doc-api/files/kwartz/node_rb.html +2 -2
  79. data/doc-api/files/kwartz/parser_rb.html +2 -2
  80. data/doc-api/files/kwartz/translator_rb.html +2 -2
  81. data/doc-api/files/kwartz/util/assert-text-equal_rb.html +1 -1
  82. data/doc-api/files/kwartz/util/testcase-helper_rb.html +2 -2
  83. data/doc-api/files/kwartz/util_rb.html +107 -0
  84. data/doc-api/files/kwartz_rb.html +3 -2
  85. data/doc-api/fr_class_index.html +11 -0
  86. data/doc-api/fr_file_index.html +5 -0
  87. data/doc-api/fr_method_index.html +242 -190
  88. data/doc/p-pattern.html +94 -94
  89. data/doc/reference.html +847 -612
  90. data/doc/users-guide.html +744 -241
  91. data/examples/rails1/README +2 -2
  92. data/examples/rails1/application_helper.rb +2 -27
  93. data/examples/rails1/link_to.plogic +5 -5
  94. data/examples/rails1/list.plogic +2 -2
  95. data/examples/rails2/app/controllers/application.rb +14 -0
  96. data/examples/rails2/app/controllers/groups_controller.rb +47 -0
  97. data/examples/rails2/app/controllers/members_controller.rb +56 -0
  98. data/examples/rails2/app/helpers/application_helper.rb +6 -0
  99. data/examples/rails2/app/helpers/groups_helper.rb +2 -0
  100. data/examples/rails2/app/helpers/members_helper.rb +2 -0
  101. data/examples/rails2/app/models/group.rb +2 -0
  102. data/examples/rails2/app/models/member.rb +3 -0
  103. data/examples/rails2/app/views/groups/_form.html +30 -0
  104. data/examples/rails2/app/views/groups/_form.plogic +11 -0
  105. data/examples/rails2/app/views/groups/_link.plogic +19 -0
  106. data/examples/rails2/app/views/groups/_read.plogic +7 -0
  107. data/examples/rails2/app/views/groups/edit.cfg.yaml +2 -0
  108. data/examples/rails2/app/views/groups/edit.html +26 -0
  109. data/examples/rails2/app/views/groups/edit.plogic +9 -0
  110. data/examples/rails2/app/views/groups/list.html +48 -0
  111. data/examples/rails2/app/views/groups/list.plogic +32 -0
  112. data/examples/rails2/app/views/groups/new.cfg.yaml +2 -0
  113. data/examples/rails2/app/views/groups/new.html +27 -0
  114. data/examples/rails2/app/views/groups/new.plogic +9 -0
  115. data/examples/rails2/app/views/groups/show.html +27 -0
  116. data/examples/rails2/app/views/groups/show.plogic +2 -0
  117. data/examples/rails2/app/views/layouts/groups.html +23 -0
  118. data/examples/rails2/app/views/layouts/groups.plogic +11 -0
  119. data/examples/rails2/app/views/layouts/members.html +23 -0
  120. data/examples/rails2/app/views/layouts/members.plogic +11 -0
  121. data/examples/rails2/app/views/layouts/members2.html +24 -0
  122. data/examples/rails2/app/views/layouts/members2.plogic +11 -0
  123. data/examples/rails2/app/views/members/_form.plogic +27 -0
  124. data/examples/rails2/app/views/members/_link.plogic +19 -0
  125. data/examples/rails2/app/views/members/_read.plogic +29 -0
  126. data/examples/rails2/app/views/members/edit.cfg.yaml +6 -0
  127. data/examples/rails2/app/views/members/edit.html +27 -0
  128. data/examples/rails2/app/views/members/edit.plogic +10 -0
  129. data/examples/rails2/app/views/members/list.html +53 -0
  130. data/examples/rails2/app/views/members/list.plogic +32 -0
  131. data/examples/rails2/app/views/members/new.html +61 -0
  132. data/examples/rails2/app/views/members/new.plogic +17 -0
  133. data/examples/rails2/app/views/members/show.html +41 -0
  134. data/examples/rails2/app/views/members/show.plogic +3 -0
  135. data/examples/rails2/db/create-tables.mysql.sql +27 -0
  136. data/examples/rails2/db/create-tables.pgsql.sql +27 -0
  137. data/examples/rails2/db/insert-data.sql +21 -0
  138. data/examples/rails2/db/tabledef.yaml +51 -0
  139. data/kwartz.gemspec +4 -4
  140. data/lib/kwartz.rb +10 -2
  141. data/lib/kwartz/assert.rb +1 -1
  142. data/lib/kwartz/binding/eperl.rb +85 -61
  143. data/lib/kwartz/binding/erubis.rb +6 -8
  144. data/lib/kwartz/binding/eruby.rb +5 -120
  145. data/lib/kwartz/binding/jstl.rb +116 -101
  146. data/lib/kwartz/binding/php.rb +79 -60
  147. data/lib/kwartz/binding/pierubis.rb +58 -0
  148. data/lib/kwartz/binding/rails.rb +45 -42
  149. data/lib/kwartz/binding/ruby.rb +193 -0
  150. data/lib/kwartz/binding/struts.rb +1 -1
  151. data/lib/kwartz/config.rb +4 -3
  152. data/lib/kwartz/converter.rb +231 -68
  153. data/lib/kwartz/defun.rb +126 -0
  154. data/lib/kwartz/error.rb +1 -1
  155. data/lib/kwartz/helper/rails.rb +437 -0
  156. data/lib/kwartz/main.rb +30 -38
  157. data/lib/kwartz/node.rb +46 -31
  158. data/lib/kwartz/parser.rb +43 -15
  159. data/lib/kwartz/translator.rb +104 -6
  160. data/lib/kwartz/util.rb +113 -0
  161. data/lib/kwartz/util/assert-text-equal.rb +1 -1
  162. data/lib/kwartz/util/testcase-helper.rb +26 -8
  163. data/test/test-compile.rb +3 -3
  164. data/test/test-compile.yaml +135 -5
  165. data/test/test-converter.rb +16 -8
  166. data/test/test-converter.yaml +307 -76
  167. data/test/test-directives.rb +1 -1
  168. data/test/test-directives.yaml +964 -979
  169. data/test/test-main.rb +61 -146
  170. data/test/test-main.yaml +235 -0
  171. data/test/test-parser.rb +10 -12
  172. data/test/test-parser.yaml +484 -326
  173. data/test/test-rails.rb +1 -1
  174. data/test/test-rails.yaml +37 -37
  175. data/test/test-ruleset.rb +1 -1
  176. data/test/test-ruleset.yaml +34 -40
  177. data/test/test.rb +1 -1
  178. metadata +82 -3
  179. data/COPYING +0 -340
@@ -1,6 +1,6 @@
1
1
  ###
2
- ### $Rev: 114 $
3
- ### $Release: 3.0.0 $
2
+ ### $Rev: 123 $
3
+ ### $Release: 3.1.0 $
4
4
  ### copyright(c) 2004-2006 kuwata-lab.com all rights reserved
5
5
  ###
6
6
 
@@ -12,15 +12,23 @@ class ConverterTest < Test::Unit::TestCase
12
12
 
13
13
  ## define test methods
14
14
  filename = __FILE__.sub(/\.rb$/, '.yaml')
15
- load_yaml_testdata(filename)
15
+ #load_yaml_testdata(filename)
16
+ load_yaml_testdata_with_each_lang(filename, :langs=>%w[eruby php])
16
17
 
17
18
 
18
19
  def _test
19
- parser = Kwartz::PresentationLogicParser.get_class('css').new
20
- ruleset_list = parser.parse(@plogic)
21
- #handler = Kwartz::Handler.new(ruleset_list)
22
- handler = Kwartz::ErubyHandler.new(ruleset_list, :delspan=>true)
23
- converter = Kwartz::TextConverter.new(handler, :delspan=>true)
20
+ #parser = Kwartz::PresentationLogicParser.get_class('css').new
21
+ #ruleset_list = parser.parse(@plogic)
22
+ ruleset_list = []
23
+ (@properties ||= {}).each do |key, val|
24
+ if key.is_a?(String)
25
+ key = key.intern
26
+ @properties.delete(key)
27
+ @properties[key] = val
28
+ end
29
+ end
30
+ handler = Kwartz::Handler.get_class(@lang).new(ruleset_list, @properties)
31
+ converter = Kwartz::TextConverter.new(handler, @properties)
24
32
  stmt_list = converter.convert(@pdata)
25
33
  sb = ''
26
34
  stmt_list.each do |stmt|
@@ -1,76 +1,294 @@
1
- ---
2
- - name: span1
3
- pdata: |
1
+ ###
2
+ - name: delspan1
3
+ desc: <span> and id="mark:foo"
4
+ properties: { delspan : true }
5
+ pdata*:
6
+ eruby: |
7
+ <p>
8
+ <span id="foo">FOO</span>
9
+ <span id="mark:bar">BAR</span>
10
+ <span kw:d="id: baz">BAZ</span>
11
+ <span kw:d="mark:poo" class="foo">POO</span>
12
+ </p>
13
+
14
+ php: &delspan1_pdata |
4
15
  <p>
5
16
  <span id="foo">FOO</span>
6
17
  <span id="mark:bar">BAR</span>
7
- <span title="id: baz">BAZ</span>
8
- <span id="mark:poo" class="foo">POO</span>
18
+ <span kw:d="id(baz)">BAZ</span>
19
+ <span kw:d="mark(poo)" class="foo">POO</span>
20
+ </p>
21
+
22
+ jstl: *delspan1_pdata
23
+
24
+ eperl: *delspan1_pdata
25
+
26
+ expected*:
27
+ eruby: &delspan2_expected |
28
+ print("<p>\n")
29
+ print(" <span id=\"foo\">")
30
+ print("FOO")
31
+ print("</span>\n")
32
+ print()
33
+ print("BAR")
34
+ print()
35
+ print()
36
+ print("BAZ")
37
+ print()
38
+ print(" <span class=\"foo\">")
39
+ print("POO")
40
+ print("</span>\n")
41
+ print("</p>\n")
42
+
43
+ php: *delspan2_expected
44
+
45
+ jstl: *delspan2_expected
46
+
47
+ eperl: *delspan2_expected
48
+
49
+ ###
50
+ - name: delspan2
51
+ desc: <span> and 'attr:' or 'append:'
52
+ properties: { delspan : true }
53
+ pdata*:
54
+ eruby: |
55
+ <p>
56
+ <span kw:d="attr: 'class' classname">ATTR</span>
57
+ <span kw:d="append: ' checked'">APPEND</span>
58
+ <span kw:d="append: ' checked'" class="foo">APPEND</span>
59
+ </p>
60
+
61
+ php: &delspan2_pdata |
62
+ <p>
63
+ <span kw:d="attr('class', $classname)">ATTR</span>
64
+ <span kw:d="append(' checked')">APPEND</span>
65
+ <span kw:d="append(' checked')" class="foo">APPEND</span>
66
+ </p>
67
+
68
+ jstl: |
69
+ <p>
70
+ <span kw:d="attr('class', classname)">ATTR</span>
71
+ <span kw:d="append(' checked')">APPEND</span>
72
+ <span kw:d="append(' checked')" class="foo">APPEND</span>
73
+ </p>
74
+
75
+ eperl: |
76
+ <p>
77
+ <span kw:d="attr('class', $classname)">ATTR</span>
78
+ <span kw:d="append(' checked')">APPEND</span>
79
+ <span kw:d="append(' checked')" class="foo">APPEND</span>
80
+ </p>
81
+
82
+ expected*:
83
+ eruby: |
84
+ print("<p>\n")
85
+ print(" <span class=\"", <%=classname%>, "\">")
86
+ print("ATTR")
87
+ print("</span>\n")
88
+ print(" <span", <%=' checked'%>, ">")
89
+ print("APPEND")
90
+ print("</span>\n")
91
+ print(" <span class=\"foo\"", <%=' checked'%>, ">")
92
+ print("APPEND")
93
+ print("</span>\n")
94
+ print("</p>\n")
95
+
96
+ php: |
97
+ print("<p>\n")
98
+ print(" <span class=\"", <%=$classname%>, "\">")
99
+ print("ATTR")
100
+ print("</span>\n")
101
+ print(" <span", <%=' checked'%>, ">")
102
+ print("APPEND")
103
+ print("</span>\n")
104
+ print(" <span class=\"foo\"", <%=' checked'%>, ">")
105
+ print("APPEND")
106
+ print("</span>\n")
107
+ print("</p>\n")
108
+
109
+ jstl: |
110
+ print("<p>\n")
111
+ print(" <span class=\"", <%=classname%>, "\">")
112
+ print("ATTR")
113
+ print("</span>\n")
114
+ print(" <span", <%=' checked'%>, ">")
115
+ print("APPEND")
116
+ print("</span>\n")
117
+ print(" <span class=\"foo\"", <%=' checked'%>, ">")
118
+ print("APPEND")
119
+ print("</span>\n")
120
+ print("</p>\n")
121
+
122
+ eperl: |
123
+ print("<p>\n")
124
+ print(" <span class=\"", <%=$classname%>, "\">")
125
+ print("ATTR")
126
+ print("</span>\n")
127
+ print(" <span", <%=' checked'%>, ">")
128
+ print("APPEND")
129
+ print("</span>\n")
130
+ print(" <span class=\"foo\"", <%=' checked'%>, ">")
131
+ print("APPEND")
132
+ print("</span>\n")
133
+ print("</p>\n")
134
+
135
+ ###
136
+ - name: delspan3
137
+ desc: <span> and 'value:'
138
+ properties: { delspan : true }
139
+ pdata*:
140
+ eruby: |
141
+ <p>
142
+ <span kw:d="value: expr">EXPR</span>
143
+ <span kw:d="value: expr" class="foo">EXPR</span>
9
144
  </p>
145
+
146
+ php: |
10
147
  <p>
11
- <span title="attr: 'class' classname">ATTR</span>
12
- <span title="append: ' checked'">APPEND</span>
13
- <span title="append: ' checked'" class="foo">APPEND</span>
148
+ <span kw:d="value($expr)">EXPR</span>
149
+ <span kw:d="value($expr)" class="foo">EXPR</span>
14
150
  </p>
151
+
152
+ jstl: |
15
153
  <p>
16
- <span title="value: expr">EXPR</span>
17
- <span title="value: expr" class="foo">EXPR</span>
154
+ <span kw:d="value(expr)">EXPR</span>
155
+ <span kw:d="value(expr)" class="foo">EXPR</span>
18
156
  </p>
157
+
158
+ eperl: |
19
159
  <p>
20
- <span title="if x > 0">positive</span>
21
- <span title="elsif x < 0">negative</span>
22
- <span title="else">zero</span>
160
+ <span kw:d="value($expr)">EXPR</span>
161
+ <span kw:d="value($expr)" class="foo">EXPR</span>
162
+ </p>
163
+
164
+ expected*:
165
+ eruby: |
166
+ print("<p>\n")
167
+ print(<%=expr%>)
168
+ print(" <span class=\"foo\">", <%=expr%>, "</span>\n")
169
+ print("</p>\n")
170
+
171
+ php: |
172
+ print("<p>\n")
173
+ print(<%=$expr%>)
174
+ print(" <span class=\"foo\">", <%=$expr%>, "</span>\n")
175
+ print("</p>\n")
176
+
177
+ jstl: |
178
+ print("<p>\n")
179
+ print(<%=expr%>)
180
+ print(" <span class=\"foo\">", <%=expr%>, "</span>\n")
181
+ print("</p>\n")
182
+
183
+ eperl: |
184
+ print("<p>\n")
185
+ print(<%=$expr%>)
186
+ print(" <span class=\"foo\">", <%=$expr%>, "</span>\n")
187
+ print("</p>\n")
188
+
189
+ ###
190
+ - name: delspan4
191
+ desc: <span> and 'if:', 'elsif:', 'else:'
192
+ properties: { delspan : true }
193
+ pdata*:
194
+ eruby: |
195
+ <p>
196
+ <span kw:d="if x > 0">positive</span>
197
+ <span kw:d="elsif x < 0">negative</span>
198
+ <span kw:d="else">zero</span>
199
+ </p>
200
+
201
+ php: |
202
+ <p>
203
+ <span kw:d="if($x > 0)">positive</span>
204
+ <span kw:d="elseif($x < 0)">negative</span>
205
+ <span kw:d="else">zero</span>
206
+ </p>
207
+
208
+ jstl: |
209
+ <p>
210
+ <span kw:d="if(x > 0)">positive</span>
211
+ <span kw:d="elseif(x < 0)">negative</span>
212
+ <span kw:d="else">zero</span>
213
+ </p>
214
+
215
+ eperl: |
216
+ <p>
217
+ <span kw:d="if($x > 0)">positive</span>
218
+ <span kw:d="elsif($x < 0)">negative</span>
219
+ <span kw:d="else">zero</span>
23
220
  </p>
24
221
 
25
222
  plogic: |
223
+ expected*:
224
+ eruby: |
225
+ print("<p>\n")
226
+ <%if x > 0 then%>
227
+ print()
228
+ print("positive")
229
+ print()
230
+ <%elsif x < 0 then%>
231
+ print()
232
+ print("negative")
233
+ print()
234
+ <%else%>
235
+ print()
236
+ print("zero")
237
+ print()
238
+ <%end%>
239
+ print("</p>\n")
240
+
241
+ php: |
242
+ print("<p>\n")
243
+ <%if ($x > 0) {%>
244
+ print()
245
+ print("positive")
246
+ print()
247
+ <%} elseif ($x < 0) {%>
248
+ print()
249
+ print("negative")
250
+ print()
251
+ <%} else {%>
252
+ print()
253
+ print("zero")
254
+ print()
255
+ <%}%>
256
+ print("</p>\n")
257
+
258
+ jstl: |
259
+ print("<p>\n")
260
+ <%<c:choose><c:when test="${x > 0}">%>
261
+ print()
262
+ print("positive")
263
+ print()
264
+ <%</c:when><c:when test="${x < 0}">%>
265
+ print()
266
+ print("negative")
267
+ print()
268
+ <%</c:when><c:otherwise>%>
269
+ print()
270
+ print("zero")
271
+ print()
272
+ <%</c:otherwise></c:choose>%>
273
+ print("</p>\n")
274
+
275
+ eperl: |
276
+ print("<p>\n")
277
+ <%if ($x > 0) {%>
278
+ print()
279
+ print("positive")
280
+ print()
281
+ <%} elsif ($x < 0) {%>
282
+ print()
283
+ print("negative")
284
+ print()
285
+ <%} else {%>
286
+ print()
287
+ print("zero")
288
+ print()
289
+ <%}%>
290
+ print("</p>\n")
26
291
 
27
- expected: |
28
- [ "<p>\n"]
29
- [ " <span id=\"foo\">"]
30
- [ "FOO"]
31
- [ "</span>\n"]
32
- [ ]
33
- [ "BAR"]
34
- [ ]
35
- [ ]
36
- [ "BAZ"]
37
- [ ]
38
- [ " <span class=\"foo\">"]
39
- [ "POO"]
40
- [ "</span>\n"]
41
- [ "</p>\n"]
42
- [ "<p>\n"]
43
- [ " <span class=\"", <%=classname%>, "\">"]
44
- [ "ATTR"]
45
- [ "</span>\n"]
46
- [ " <span", <%=' checked'%>, ">"]
47
- [ "APPEND"]
48
- [ "</span>\n"]
49
- [ " <span class=\"foo\"", <%=' checked'%>, ">"]
50
- [ "APPEND"]
51
- [ "</span>\n"]
52
- [ "</p>\n"]
53
- [ "<p>\n"]
54
- [ <%=expr%>]
55
- [ " <span class=\"foo\">", <%=expr%>, "</span>\n"]
56
- [ "</p>\n"]
57
- [ "<p>\n"]
58
- "if x > 0 then"
59
- [ ]
60
- [ "positive"]
61
- [ ]
62
- "elsif x < 0 then"
63
- [ ]
64
- [ "negative"]
65
- [ ]
66
- "else"
67
- [ ]
68
- [ "zero"]
69
- [ ]
70
- "end"
71
- [ "</p>\n"]
72
-
73
- output: |
74
292
 
75
293
  ###
76
294
  #- name: span2
@@ -95,33 +313,46 @@
95
313
  # }
96
314
  #
97
315
  # expected: |
98
- # [ "<p>\n"]
99
- # [ ]
100
- # [ <%=title1%>]
101
- # [ ]
102
- # [ " <span class=\"", <%=name%>, "\">"]
103
- # [ <%=title2%>]
104
- # [ "</span>\n"]
105
- # [ " <span", <%=' checked="checked"'%>, ">"]
106
- # [ <%=title3%>]
107
- # [ "</span>\n"]
108
- # [ "</p>\n"]
316
+ # print("<p>\n")
317
+ # print()
318
+ # print(<%=title1%>)
319
+ # print()
320
+ # print(" <span class=\"", <%=name%>, "\">")
321
+ # print(<%=title2%>)
322
+ # print("</span>\n")
323
+ # print(" <span", <%=' checked="checked"'%>, ">")
324
+ # print(<%=title3%>)
325
+ # print("</span>\n")
326
+ # print("</p>\n")
109
327
  #
110
328
  #
111
329
  # output: |
112
330
  #
113
331
 
114
332
 
115
- ##
333
+ ###
116
334
  - name: unmatched
117
335
  desc: unmatched text to fetch pattern
118
336
  bug: self found
119
- pdata: |
337
+ pdata*:
338
+ eruby: &unmatched_pdata |
120
339
  foo
121
340
  bar
122
341
  baz
123
- plogic: |
124
- expected: |
125
- [ "foo\nbar\nbaz\n"]
342
+ php: *unmatched_pdata
343
+ jstl: *unmatched_pdata
344
+ eperl: *unmatched_pdata
345
+
346
+ plogic*:
347
+ eruby: |
348
+ php: |
349
+ jstl: |
350
+ eperl: |
126
351
 
352
+ expected*:
353
+ eruby: &unmatched_expected |
354
+ print("foo\nbar\nbaz\n")
355
+ php: *unmatched_expected
356
+ jstl: *unmatched_expected
357
+ eperl: *unmatched_expected
127
358