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
@@ -94,20 +94,20 @@ directive handler for JSTL
94
94
  <h3 class="section-bar">Methods</h3>
95
95
 
96
96
  <div class="name-list">
97
- <a href="#M000062">_evaluate_options</a>&nbsp;&nbsp;
98
- <a href="#M000060">_handle_jstl_params</a>&nbsp;&nbsp;
99
- <a href="#M000061">_handle_jstl_tag</a>&nbsp;&nbsp;
100
- <a href="#M000052">directive_format</a>&nbsp;&nbsp;
101
- <a href="#M000050">directive_pattern</a>&nbsp;&nbsp;
102
- <a href="#M000053">handle</a>&nbsp;&nbsp;
103
- <a href="#M000058">handle_jstl_forEach</a>&nbsp;&nbsp;
104
- <a href="#M000059">handle_jstl_forTokens</a>&nbsp;&nbsp;
105
- <a href="#M000055">handle_jstl_import</a>&nbsp;&nbsp;
106
- <a href="#M000054">handle_jstl_redirect</a>&nbsp;&nbsp;
107
- <a href="#M000057">handle_jstl_remove</a>&nbsp;&nbsp;
108
- <a href="#M000056">handle_jstl_url</a>&nbsp;&nbsp;
109
- <a href="#M000051">mapping_pattern</a>&nbsp;&nbsp;
110
- <a href="#M000049">new</a>&nbsp;&nbsp;
97
+ <a href="#M000098">_evaluate_options</a>&nbsp;&nbsp;
98
+ <a href="#M000096">_handle_jstl_params</a>&nbsp;&nbsp;
99
+ <a href="#M000097">_handle_jstl_tag</a>&nbsp;&nbsp;
100
+ <a href="#M000088">directive_format</a>&nbsp;&nbsp;
101
+ <a href="#M000086">directive_pattern</a>&nbsp;&nbsp;
102
+ <a href="#M000089">handle</a>&nbsp;&nbsp;
103
+ <a href="#M000094">handle_jstl_forEach</a>&nbsp;&nbsp;
104
+ <a href="#M000095">handle_jstl_forTokens</a>&nbsp;&nbsp;
105
+ <a href="#M000091">handle_jstl_import</a>&nbsp;&nbsp;
106
+ <a href="#M000090">handle_jstl_redirect</a>&nbsp;&nbsp;
107
+ <a href="#M000093">handle_jstl_remove</a>&nbsp;&nbsp;
108
+ <a href="#M000092">handle_jstl_url</a>&nbsp;&nbsp;
109
+ <a href="#M000087">mapping_pattern</a>&nbsp;&nbsp;
110
+ <a href="#M000085">new</a>&nbsp;&nbsp;
111
111
  </div>
112
112
  </div>
113
113
 
@@ -152,24 +152,24 @@ directive handler for JSTL
152
152
  <div id="methods">
153
153
  <h3 class="section-bar">Public Class methods</h3>
154
154
 
155
- <div id="method-M000049" class="method-detail">
156
- <a name="M000049"></a>
155
+ <div id="method-M000085" class="method-detail">
156
+ <a name="M000085"></a>
157
157
 
158
158
  <div class="method-heading">
159
- <a href="#M000049" class="method-signature">
159
+ <a href="#M000085" class="method-signature">
160
160
  <span class="method-name">new</span><span class="method-args">(elem_rulesets=[], properties={})</span>
161
161
  </a>
162
162
  </div>
163
163
 
164
164
  <div class="method-description">
165
165
  <p><a class="source-toggle" href="#"
166
- onclick="toggleCode('M000049-source');return false;">[Source]</a></p>
167
- <div class="method-source-code" id="M000049-source">
166
+ onclick="toggleCode('M000085-source');return false;">[Source]</a></p>
167
+ <div class="method-source-code" id="M000085-source">
168
168
  <pre>
169
169
  <span class="ruby-comment cmt"># File kwartz/binding/jstl.rb, line 23</span>
170
170
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">elem_rulesets</span>=[], <span class="ruby-identifier">properties</span>={})
171
171
  <span class="ruby-keyword kw">super</span>
172
- <span class="ruby-ivar">@jstl_ver</span> = <span class="ruby-identifier">properties</span>[<span class="ruby-identifier">:jstl</span>] <span class="ruby-operator">||</span> <span class="ruby-value">1.2</span>
172
+ <span class="ruby-ivar">@jstl_ver</span> = <span class="ruby-identifier">properties</span>[<span class="ruby-identifier">:jstl</span>] <span class="ruby-operator">||</span> <span class="ruby-constant">Config</span><span class="ruby-operator">::</span><span class="ruby-constant">PROPERTY_JSTL</span>
173
173
  <span class="ruby-keyword kw">end</span>
174
174
  </pre>
175
175
  </div>
@@ -178,19 +178,19 @@ directive handler for JSTL
178
178
 
179
179
  <h3 class="section-bar">Public Instance methods</h3>
180
180
 
181
- <div id="method-M000052" class="method-detail">
182
- <a name="M000052"></a>
181
+ <div id="method-M000088" class="method-detail">
182
+ <a name="M000088"></a>
183
183
 
184
184
  <div class="method-heading">
185
- <a href="#M000052" class="method-signature">
185
+ <a href="#M000088" class="method-signature">
186
186
  <span class="method-name">directive_format</span><span class="method-args">()</span>
187
187
  </a>
188
188
  </div>
189
189
 
190
190
  <div class="method-description">
191
191
  <p><a class="source-toggle" href="#"
192
- onclick="toggleCode('M000052-source');return false;">[Source]</a></p>
193
- <div class="method-source-code" id="M000052-source">
192
+ onclick="toggleCode('M000088-source');return false;">[Source]</a></p>
193
+ <div class="method-source-code" id="M000088-source">
194
194
  <pre>
195
195
  <span class="ruby-comment cmt"># File kwartz/binding/jstl.rb, line 45</span>
196
196
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">directive_format</span>
@@ -201,19 +201,19 @@ directive handler for JSTL
201
201
  </div>
202
202
  </div>
203
203
 
204
- <div id="method-M000050" class="method-detail">
205
- <a name="M000050"></a>
204
+ <div id="method-M000086" class="method-detail">
205
+ <a name="M000086"></a>
206
206
 
207
207
  <div class="method-heading">
208
- <a href="#M000050" class="method-signature">
208
+ <a href="#M000086" class="method-signature">
209
209
  <span class="method-name">directive_pattern</span><span class="method-args">()</span>
210
210
  </a>
211
211
  </div>
212
212
 
213
213
  <div class="method-description">
214
214
  <p><a class="source-toggle" href="#"
215
- onclick="toggleCode('M000050-source');return false;">[Source]</a></p>
216
- <div class="method-source-code" id="M000050-source">
215
+ onclick="toggleCode('M000086-source');return false;">[Source]</a></p>
216
+ <div class="method-source-code" id="M000086-source">
217
217
  <pre>
218
218
  <span class="ruby-comment cmt"># File kwartz/binding/jstl.rb, line 31</span>
219
219
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">directive_pattern</span>
@@ -224,143 +224,149 @@ directive handler for JSTL
224
224
  </div>
225
225
  </div>
226
226
 
227
- <div id="method-M000053" class="method-detail">
228
- <a name="M000053"></a>
227
+ <div id="method-M000089" class="method-detail">
228
+ <a name="M000089"></a>
229
229
 
230
230
  <div class="method-heading">
231
- <a href="#M000053" class="method-signature">
232
- <span class="method-name">handle</span><span class="method-args">(directive_name, directive_arg, directive_str, stag_info, etag_info, cont_stmts, attr_info, append_exprs, stmt_list)</span>
231
+ <a href="#M000089" class="method-signature">
232
+ <span class="method-name">handle</span><span class="method-args">(stmt_list, handler_arg)</span>
233
233
  </a>
234
234
  </div>
235
235
 
236
236
  <div class="method-description">
237
237
  <p><a class="source-toggle" href="#"
238
- onclick="toggleCode('M000053-source');return false;">[Source]</a></p>
239
- <div class="method-source-code" id="M000053-source">
238
+ onclick="toggleCode('M000089-source');return false;">[Source]</a></p>
239
+ <div class="method-source-code" id="M000089-source">
240
240
  <pre>
241
241
  <span class="ruby-comment cmt"># File kwartz/binding/jstl.rb, line 50</span>
242
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">handle</span>(<span class="ruby-identifier">directive_name</span>, <span class="ruby-identifier">directive_arg</span>, <span class="ruby-identifier">directive_str</span>, <span class="ruby-identifier">stag_info</span>, <span class="ruby-identifier">etag_info</span>, <span class="ruby-identifier">cont_stmts</span>, <span class="ruby-identifier">attr_info</span>, <span class="ruby-identifier">append_exprs</span>, <span class="ruby-identifier">stmt_list</span>)
242
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">handle</span>(<span class="ruby-identifier">stmt_list</span>, <span class="ruby-identifier">handler_arg</span>)
243
243
  <span class="ruby-identifier">ret</span> = <span class="ruby-keyword kw">super</span>
244
244
  <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">ret</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">ret</span>
245
245
 
246
- <span class="ruby-identifier">d_name</span> = <span class="ruby-identifier">directive_name</span>
247
- <span class="ruby-identifier">d_arg</span> = <span class="ruby-identifier">directive_arg</span>
248
- <span class="ruby-identifier">d_str</span> = <span class="ruby-identifier">directive_str</span>
246
+ <span class="ruby-identifier">arg</span> = <span class="ruby-identifier">handler_arg</span>
247
+ <span class="ruby-identifier">d_name</span> = <span class="ruby-identifier">arg</span>.<span class="ruby-identifier">directive_name</span>
248
+ <span class="ruby-identifier">d_arg</span> = <span class="ruby-identifier">arg</span>.<span class="ruby-identifier">directive_arg</span>
249
+ <span class="ruby-identifier">d_str</span> = <span class="ruby-identifier">arg</span>.<span class="ruby-identifier">directive_str</span>
249
250
 
250
- <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">directive_name</span>
251
+ <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">d_name</span>
251
252
 
252
253
  <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:for</span>, <span class="ruby-identifier">:For</span>, <span class="ruby-identifier">:FOR</span>, <span class="ruby-identifier">:list</span>, <span class="ruby-identifier">:List</span>, <span class="ruby-identifier">:LIST</span>
253
254
  <span class="ruby-identifier">is_foreach</span> = <span class="ruby-identifier">d_name</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:for</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">d_name</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:For</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">d_name</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:FOR</span>
255
+ <span class="ruby-identifier">error_if_empty_tag</span>(<span class="ruby-identifier">arg</span>) <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">is_foreach</span>
254
256
  <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">d_arg</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/\A(\w+)\s*:\s*(.*)\z/</span>
255
- <span class="ruby-identifier">raise</span> <span class="ruby-identifier">convert_error</span>(<span class="ruby-node">&quot;'#{d_str}': invalid argument.&quot;</span>, <span class="ruby-identifier">stag_info</span>.<span class="ruby-identifier">linenum</span>)
257
+ <span class="ruby-identifier">raise</span> <span class="ruby-identifier">convert_error</span>(<span class="ruby-node">&quot;'#{d_str}': invalid argument.&quot;</span>, <span class="ruby-identifier">arg</span>.<span class="ruby-identifier">stag_info</span>.<span class="ruby-identifier">linenum</span>)
256
258
  <span class="ruby-keyword kw">end</span>
257
259
  <span class="ruby-identifier">loopvar</span> = <span class="ruby-identifier">$1</span> ; <span class="ruby-identifier">looplist</span> = <span class="ruby-identifier">$2</span>
258
260
  <span class="ruby-identifier">counter</span> = <span class="ruby-identifier">d_name</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:for</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">d_name</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:list</span> <span class="ruby-operator">?</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-operator">:</span> <span class="ruby-node">&quot;#{loopvar}_ctr&quot;</span>
259
261
  <span class="ruby-identifier">toggle</span> = <span class="ruby-identifier">d_name</span> <span class="ruby-operator">!=</span> <span class="ruby-identifier">:FOR</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">d_name</span> <span class="ruby-operator">!=</span> <span class="ruby-identifier">:LIST</span> <span class="ruby-operator">?</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-operator">:</span> <span class="ruby-node">&quot;#{loopvar}_tgl&quot;</span>
260
262
  <span class="ruby-identifier">status</span> = <span class="ruby-identifier">d_name</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:for</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">d_name</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:list</span> <span class="ruby-operator">?</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-operator">:</span> <span class="ruby-node">&quot;#{loopvar}_status&quot;</span>
261
- <span class="ruby-identifier">stmt_list</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">build_print_stmt</span>(<span class="ruby-identifier">stag_info</span>, <span class="ruby-identifier">attr_info</span>, <span class="ruby-identifier">append_exprs</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">is_foreach</span>
262
- <span class="ruby-identifier">sb</span> = <span class="ruby-node">&quot;&lt;c:forEach var=\&quot;#{loopvar}\&quot; items=\&quot;${#{looplist}}\&quot;&quot;</span>
263
- <span class="ruby-identifier">sb</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot; varStatus=\&quot;#{status}\&quot;&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">status</span>
264
- <span class="ruby-identifier">sb</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;&gt;&quot;</span>
265
- <span class="ruby-identifier">stmt_list</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">NativeStatement</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">sb</span>, <span class="ruby-identifier">:foreach</span>)
266
- <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">counter</span>
267
- <span class="ruby-identifier">stmt_list</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">NativeStatement</span>.<span class="ruby-identifier">new</span>(<span class="ruby-node">&quot;&lt;c:set var=\&quot;#{counter}\&quot; value=\&quot;${#{status}.count}\&quot; /&gt;&quot;</span>)
268
- <span class="ruby-keyword kw">end</span>
263
+ <span class="ruby-identifier">foreach_code</span> = <span class="ruby-node">&quot;&lt;c:forEach var=\&quot;#{loopvar}\&quot; items=\&quot;${#{looplist}}\&quot;&quot;</span>
264
+ <span class="ruby-identifier">foreach_code</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot; varStatus=\&quot;#{status}\&quot;&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">status</span>
265
+ <span class="ruby-identifier">foreach_code</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;&gt;&quot;</span>
266
+ <span class="ruby-identifier">code</span> = []
267
+ <span class="ruby-identifier">code</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">foreach_code</span>
268
+ <span class="ruby-identifier">code</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;&lt;c:set var=\&quot;#{counter}\&quot; value=\&quot;${#{status}.count}\&quot;/&gt;&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">counter</span>
269
269
  <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">toggle</span>
270
270
  <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@jstl_ver</span> <span class="ruby-operator">&lt;</span> <span class="ruby-value">1.2</span>
271
- <span class="ruby-identifier">stmt_list</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">NativeStatement</span>.<span class="ruby-identifier">new</span>(<span class="ruby-node">&quot;&lt;c:choose&gt;&lt;c:when test=\&quot;${#{status}.count%2==0}\&quot;&gt;&quot;</span>)
272
- <span class="ruby-identifier">stmt_list</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">NativeStatement</span>.<span class="ruby-identifier">new</span>(<span class="ruby-node">&quot;&lt;c:set var=\&quot;#{toggle}\&quot; value=\&quot;${self.even}\&quot;/&gt;&quot;</span>)
273
- <span class="ruby-identifier">stmt_list</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">NativeStatement</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value str">&quot;&lt;/c:when&gt;&lt;c:otherwise&gt;&quot;</span>)
274
- <span class="ruby-identifier">stmt_list</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">NativeStatement</span>.<span class="ruby-identifier">new</span>(<span class="ruby-node">&quot;&lt;c:set var=\&quot;#{toggle}\&quot; value=\&quot;${self.odd}\&quot;/&gt;&quot;</span>)
275
- <span class="ruby-identifier">stmt_list</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">NativeStatement</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value str">&quot;&lt;/c:otherwise&gt;&lt;/c:choose&gt;&quot;</span>)
271
+ <span class="ruby-identifier">code</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;&lt;c:choose&gt;&lt;c:when test=\&quot;${#{status}.count%2==0}\&quot;&gt;&quot;</span>
272
+ <span class="ruby-identifier">code</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;&lt;c:set var=\&quot;#{toggle}\&quot; value=\&quot;${self.even}\&quot;/&gt;&quot;</span>
273
+ <span class="ruby-identifier">code</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;&lt;/c:when&gt;&lt;c:otherwise&gt;&quot;</span>
274
+ <span class="ruby-identifier">code</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;&lt;c:set var=\&quot;#{toggle}\&quot; value=\&quot;${self.odd}\&quot;/&gt;&quot;</span>
275
+ <span class="ruby-identifier">code</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;&lt;/c:otherwise&gt;&lt;/c:choose&gt;&quot;</span>
276
276
  <span class="ruby-keyword kw">else</span>
277
- <span class="ruby-identifier">sb</span> = <span class="ruby-node">&quot;&lt;c:set var=\&quot;#{toggle}\&quot; value=\&quot;${#{status}.count%2==0 ? #{self.even} : #{self.odd}}\&quot; /&gt;&quot;</span>
278
- <span class="ruby-identifier">stmt_list</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">NativeStatement</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">sb</span>)
277
+ <span class="ruby-identifier">code</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;&lt;c:set var=\&quot;#{toggle}\&quot; value=\&quot;${#{status}.count%2==0 ? #{self.even} : #{self.odd}}\&quot;/&gt;&quot;</span>
279
278
  <span class="ruby-keyword kw">end</span>
280
279
  <span class="ruby-keyword kw">end</span>
281
- <span class="ruby-identifier">stmt_list</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">build_print_stmt</span>(<span class="ruby-identifier">stag_info</span>, <span class="ruby-identifier">attr_info</span>, <span class="ruby-identifier">append_exprs</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">is_foreach</span>
282
- <span class="ruby-identifier">stmt_list</span>.<span class="ruby-identifier">concat</span>(<span class="ruby-identifier">cont_stmts</span>)
283
- <span class="ruby-identifier">stmt_list</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">build_print_stmt</span>(<span class="ruby-identifier">etag_info</span>, <span class="ruby-keyword kw">nil</span>, <span class="ruby-keyword kw">nil</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">is_foreach</span>
284
- <span class="ruby-identifier">stmt_list</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">NativeStatement</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value str">&quot;&lt;/c:forEach&gt;&quot;</span>, <span class="ruby-identifier">:foreach</span>)
285
- <span class="ruby-identifier">stmt_list</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">build_print_stmt</span>(<span class="ruby-identifier">etag_info</span>, <span class="ruby-keyword kw">nil</span>, <span class="ruby-keyword kw">nil</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">is_foreach</span>
280
+ <span class="ruby-identifier">end_code</span> = <span class="ruby-value str">&quot;&lt;/c:forEach&gt;&quot;</span>
281
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">is_foreach</span>
282
+ <span class="ruby-identifier">wrap_element_with_native_stmt</span>(<span class="ruby-identifier">stmt_list</span>, <span class="ruby-identifier">arg</span>, <span class="ruby-identifier">code</span>, <span class="ruby-identifier">end_code</span>, <span class="ruby-identifier">:set</span>)
283
+ <span class="ruby-keyword kw">else</span>
284
+ <span class="ruby-identifier">wrap_content_with_native_stmt</span>(<span class="ruby-identifier">stmt_list</span>, <span class="ruby-identifier">arg</span>, <span class="ruby-identifier">code</span>, <span class="ruby-identifier">end_code</span>, <span class="ruby-identifier">:set</span>)
285
+ <span class="ruby-keyword kw">end</span>
286
286
 
287
287
  <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:while</span>, <span class="ruby-identifier">:loop</span>
288
- <span class="ruby-identifier">raise</span> <span class="ruby-identifier">convert_error</span>(<span class="ruby-node">&quot;'#{d_str}': jstl doesn't support '#{d_arg}' directive.&quot;</span>, <span class="ruby-identifier">stag_info</span>.<span class="ruby-identifier">linenum</span>)
288
+ <span class="ruby-identifier">msg</span> = <span class="ruby-node">&quot;'#{d_str}': jstl doesn't support '#{d_arg}' directive.&quot;</span>
289
+ <span class="ruby-identifier">raise</span> <span class="ruby-identifier">convert_error</span>(<span class="ruby-identifier">msg</span>, <span class="ruby-identifier">arg</span>.<span class="ruby-identifier">stag_info</span>.<span class="ruby-identifier">linenum</span>)
289
290
 
290
291
  <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:set</span>
291
292
  <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">d_arg</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/\A(\S+)\s*=\s*(.*)\z/</span>
292
- <span class="ruby-identifier">raise</span> <span class="ruby-identifier">convert_error</span>(<span class="ruby-node">&quot;'#{d_str}': invalid argument.&quot;</span>, <span class="ruby-identifier">stag_info</span>.<span class="ruby-identifier">linenum</span>)
293
+ <span class="ruby-identifier">raise</span> <span class="ruby-identifier">convert_error</span>(<span class="ruby-node">&quot;'#{d_str}': invalid argument.&quot;</span>, <span class="ruby-identifier">arg</span>.<span class="ruby-identifier">stag_info</span>.<span class="ruby-identifier">linenum</span>)
293
294
  <span class="ruby-keyword kw">end</span>
294
295
  <span class="ruby-identifier">lhs</span> = <span class="ruby-identifier">$1</span>; <span class="ruby-identifier">rhs</span> = <span class="ruby-identifier">$2</span>
295
- <span class="ruby-identifier">sb</span> = <span class="ruby-node">&quot;&lt;c:set var=\&quot;#{lhs}\&quot; value=\&quot;${#{rhs}}\&quot; /&gt;&quot;</span>
296
- <span class="ruby-identifier">stmt_list</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">NativeStatement</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">sb</span>, <span class="ruby-identifier">:set</span>)
297
- <span class="ruby-identifier">stmt_list</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">build_print_stmt</span>(<span class="ruby-identifier">stag_info</span>, <span class="ruby-identifier">attr_info</span>, <span class="ruby-identifier">append_exprs</span>)
298
- <span class="ruby-identifier">stmt_list</span>.<span class="ruby-identifier">concat</span>(<span class="ruby-identifier">cont_stmts</span>)
299
- <span class="ruby-identifier">stmt_list</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">build_print_stmt</span>(<span class="ruby-identifier">etag_info</span>, <span class="ruby-keyword kw">nil</span>, <span class="ruby-keyword kw">nil</span>)
296
+ <span class="ruby-identifier">code</span> = <span class="ruby-node">&quot;&lt;c:set var=\&quot;#{lhs}\&quot; value=\&quot;${#{rhs}}\&quot;/&gt;&quot;</span>
297
+ <span class="ruby-identifier">wrap_element_with_native_stmt</span>(<span class="ruby-identifier">stmt_list</span>, <span class="ruby-identifier">arg</span>, <span class="ruby-identifier">code</span>, <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">:set</span>)
298
+ <span class="ruby-comment cmt">#code = &quot;&lt;c:set var=\&quot;#{lhs}\&quot; value=\&quot;${#{rhs}}\&quot;/&gt;&quot;</span>
299
+ <span class="ruby-comment cmt">#stmt_list &lt;&lt; NativeStatement.new(code, :set)</span>
300
+ <span class="ruby-comment cmt">#stmt_list &lt;&lt; stag_stmt(arg)</span>
301
+ <span class="ruby-comment cmt">#stmt_list.concat(cont_stmts)</span>
302
+ <span class="ruby-comment cmt">#stmt_list &lt;&lt; etag_stmt(arg)</span>
300
303
 
301
304
  <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:if</span>
302
- <span class="ruby-identifier">sb</span> = <span class="ruby-node">&quot;&lt;c:choose&gt;&lt;c:when test=\&quot;${#{d_arg}}\&quot;&gt;&quot;</span>
303
- <span class="ruby-identifier">stmt_list</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">NativeStatement</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">sb</span>, <span class="ruby-identifier">:if</span>)
304
- <span class="ruby-identifier">stmt_list</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">build_print_stmt</span>(<span class="ruby-identifier">stag_info</span>, <span class="ruby-identifier">attr_info</span>, <span class="ruby-identifier">append_exprs</span>)
305
- <span class="ruby-identifier">stmt_list</span>.<span class="ruby-identifier">concat</span>(<span class="ruby-identifier">cont_stmts</span>)
306
- <span class="ruby-identifier">stmt_list</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">build_print_stmt</span>(<span class="ruby-identifier">etag_info</span>, <span class="ruby-keyword kw">nil</span>, <span class="ruby-keyword kw">nil</span>)
307
- <span class="ruby-identifier">stmt_list</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">NativeStatement</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value str">&quot;&lt;/c:when&gt;&lt;/c:choose&gt;&quot;</span>, <span class="ruby-identifier">:if</span>)
305
+ <span class="ruby-identifier">start_code</span> = <span class="ruby-node">&quot;&lt;c:choose&gt;&lt;c:when test=\&quot;${#{d_arg}}\&quot;&gt;&quot;</span>
306
+ <span class="ruby-identifier">end_code</span> = <span class="ruby-value str">&quot;&lt;/c:when&gt;&lt;/c:choose&gt;&quot;</span>
307
+ <span class="ruby-identifier">wrap_element_with_native_stmt</span>(<span class="ruby-identifier">stmt_list</span>, <span class="ruby-identifier">arg</span>, <span class="ruby-identifier">start_code</span>, <span class="ruby-identifier">end_code</span>, <span class="ruby-identifier">:if</span>)
308
+ <span class="ruby-comment cmt">#stmt_list &lt;&lt; NativeStatement.new(start_code, :if)</span>
309
+ <span class="ruby-comment cmt">#stmt_list &lt;&lt; stag_stmt(arg)</span>
310
+ <span class="ruby-comment cmt">#stmt_list.concat(cont_stmts)</span>
311
+ <span class="ruby-comment cmt">#stmt_list &lt;&lt; etag_stmt(arg)</span>
312
+ <span class="ruby-comment cmt">#stmt_list &lt;&lt; NativeStatement.new(end, :if)</span>
308
313
 
309
314
  <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:elseif</span>, <span class="ruby-identifier">:else</span>
310
- <span class="ruby-keyword kw">unless</span> <span class="ruby-operator">!</span><span class="ruby-identifier">stmt_list</span>.<span class="ruby-identifier">empty?</span> <span class="ruby-operator">&amp;&amp;</span> (<span class="ruby-identifier">st</span>=<span class="ruby-identifier">stmt_list</span>[<span class="ruby-value">-1</span>]).<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">NativeStatement</span>) <span class="ruby-operator">&amp;&amp;</span> (<span class="ruby-identifier">st</span>.<span class="ruby-identifier">kind</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:if</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">st</span>.<span class="ruby-identifier">kind</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:elseif</span>)
311
- <span class="ruby-identifier">raise</span> <span class="ruby-identifier">convert_error</span>(<span class="ruby-node">&quot;'#{d_str}': previous statement should be 'if' or 'elseif'.&quot;</span>, <span class="ruby-identifier">stag_info</span>.<span class="ruby-identifier">linenum</span>)
312
- <span class="ruby-keyword kw">end</span>
315
+ <span class="ruby-identifier">error_when_last_stmt_is_not_if</span>(<span class="ruby-identifier">stmt_list</span>, <span class="ruby-identifier">arg</span>)
313
316
  <span class="ruby-identifier">stmt_list</span>.<span class="ruby-identifier">pop</span> <span class="ruby-comment cmt"># delete '&lt;/c:when&gt;&lt;/c:choose&gt;'</span>
314
317
  <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">d_name</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:else</span>
315
318
  <span class="ruby-identifier">kind</span> = <span class="ruby-identifier">:else</span>
316
- <span class="ruby-identifier">sb</span> = <span class="ruby-value str">&quot;&lt;/c:when&gt;&lt;c:otherwise&gt;&quot;</span>
317
- <span class="ruby-identifier">stmt_list</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">NativeStatement</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">sb</span>, <span class="ruby-identifier">:else</span>)
318
- <span class="ruby-identifier">sb</span> = <span class="ruby-value str">&quot;&lt;/c:otherwise&gt;&lt;/c:choose&gt;&quot;</span>
319
+ <span class="ruby-identifier">start_code</span> = <span class="ruby-value str">&quot;&lt;/c:when&gt;&lt;c:otherwise&gt;&quot;</span>
320
+ <span class="ruby-identifier">end_code</span> = <span class="ruby-value str">&quot;&lt;/c:otherwise&gt;&lt;/c:choose&gt;&quot;</span>
319
321
  <span class="ruby-keyword kw">else</span>
320
322
  <span class="ruby-identifier">kind</span> = <span class="ruby-identifier">:elseif</span>
321
- <span class="ruby-identifier">sb</span> = <span class="ruby-node">&quot;&lt;/c:when&gt;&lt;c:when test=\&quot;${#{d_arg}}\&quot;&gt;&quot;</span>
322
- <span class="ruby-identifier">stmt_list</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">NativeStatement</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">sb</span>, <span class="ruby-identifier">:elseif</span>)
323
- <span class="ruby-identifier">sb</span> = <span class="ruby-value str">&quot;&lt;/c:when&gt;&lt;/c:choose&gt;&quot;</span>
323
+ <span class="ruby-identifier">start_code</span> = <span class="ruby-node">&quot;&lt;/c:when&gt;&lt;c:when test=\&quot;${#{d_arg}}\&quot;&gt;&quot;</span>
324
+ <span class="ruby-identifier">end_code</span> = <span class="ruby-value str">&quot;&lt;/c:when&gt;&lt;/c:choose&gt;&quot;</span>
324
325
  <span class="ruby-keyword kw">end</span>
325
- <span class="ruby-identifier">stmt_list</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">build_print_stmt</span>(<span class="ruby-identifier">stag_info</span>, <span class="ruby-identifier">attr_info</span>, <span class="ruby-identifier">append_exprs</span>)
326
- <span class="ruby-identifier">stmt_list</span>.<span class="ruby-identifier">concat</span>(<span class="ruby-identifier">cont_stmts</span>)
327
- <span class="ruby-identifier">stmt_list</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">build_print_stmt</span>(<span class="ruby-identifier">etag_info</span>, <span class="ruby-keyword kw">nil</span>, <span class="ruby-keyword kw">nil</span>)
328
- <span class="ruby-identifier">stmt_list</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">NativeStatement</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">sb</span>, <span class="ruby-identifier">kind</span>)
326
+ <span class="ruby-identifier">wrap_element_with_native_stmt</span>(<span class="ruby-identifier">stmt_list</span>, <span class="ruby-identifier">arg</span>, <span class="ruby-identifier">start_code</span>, <span class="ruby-identifier">end_code</span>, <span class="ruby-identifier">kind</span>)
327
+ <span class="ruby-comment cmt">#stmt_list &lt;&lt; NativeStatement.new(start_code, kind)</span>
328
+ <span class="ruby-comment cmt">#stmt_list &lt;&lt; stag_stmt</span>
329
+ <span class="ruby-comment cmt">#stmt_list.concat(cont_stmts)</span>
330
+ <span class="ruby-comment cmt">#stmt_list &lt;&lt; etag_stmt</span>
331
+ <span class="ruby-comment cmt">#stmt_list &lt;&lt; NativeStatement.new(end_code, kind)</span>
329
332
 
330
333
  <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:default</span>, <span class="ruby-identifier">:Default</span>, <span class="ruby-identifier">:DEFAULT</span>
331
- <span class="ruby-identifier">error_if_empty_tag</span>(<span class="ruby-identifier">stag_info</span>, <span class="ruby-identifier">etag_info</span>, <span class="ruby-identifier">d_name</span>, <span class="ruby-identifier">d_arg</span>)
332
- <span class="ruby-identifier">stmt_list</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">build_print_stmt</span>(<span class="ruby-identifier">stag_info</span>, <span class="ruby-identifier">attr_info</span>, <span class="ruby-identifier">append_exprs</span>)
334
+ <span class="ruby-identifier">error_if_empty_tag</span>(<span class="ruby-identifier">arg</span>)
335
+ <span class="ruby-identifier">stmt_list</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">stag_stmt</span>(<span class="ruby-identifier">arg</span>)
333
336
  <span class="ruby-identifier">flag_escape</span> = <span class="ruby-identifier">d_name</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:default</span> <span class="ruby-operator">?</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-operator">:</span> (<span class="ruby-identifier">d_name</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:Default</span>)
334
- <span class="ruby-identifier">argstr</span> = <span class="ruby-identifier">cont_stmts</span>[<span class="ruby-value">0</span>].<span class="ruby-identifier">args</span>[<span class="ruby-value">0</span>]
335
- <span class="ruby-identifier">sb</span> = <span class="ruby-node">&quot;&lt;c:out value=\&quot;${#{d_arg}}\&quot;&quot;</span>
336
- <span class="ruby-identifier">sb</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot; escapeXml=\&quot;#{flag_escape}\&quot;&quot;</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">flag_escape</span> <span class="ruby-operator">==</span> <span class="ruby-keyword kw">nil</span>
337
- <span class="ruby-identifier">sb</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot; default=#{argstr.dump} /&gt;&quot;</span>
338
- <span class="ruby-identifier">stmt_list</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">NativeStatement</span>.<span class="ruby-identifier">new_without_newline</span>(<span class="ruby-identifier">sb</span>)
339
- <span class="ruby-identifier">stmt_list</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">build_print_stmt</span>(<span class="ruby-identifier">etag_info</span>, <span class="ruby-keyword kw">nil</span>, <span class="ruby-keyword kw">nil</span>)
337
+ <span class="ruby-identifier">argstr</span> = <span class="ruby-identifier">arg</span>.<span class="ruby-identifier">cont_stmts</span>[<span class="ruby-value">0</span>].<span class="ruby-identifier">args</span>[<span class="ruby-value">0</span>]
338
+ <span class="ruby-identifier">code</span> = <span class="ruby-node">&quot;&lt;c:out value=\&quot;${#{d_arg}}\&quot;&quot;</span>
339
+ <span class="ruby-identifier">code</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot; escapeXml=\&quot;#{flag_escape}\&quot;&quot;</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">flag_escape</span> <span class="ruby-operator">==</span> <span class="ruby-keyword kw">nil</span>
340
+ <span class="ruby-identifier">code</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot; default=\&quot;#{argstr}\&quot;/&gt;&quot;</span>
341
+ <span class="ruby-identifier">stmt_list</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">NativeStatement</span>.<span class="ruby-identifier">new_without_newline</span>(<span class="ruby-identifier">code</span>)
342
+ <span class="ruby-identifier">stmt_list</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">etag_stmt</span>(<span class="ruby-identifier">arg</span>)
340
343
 
341
344
  <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:catch</span>
342
345
  <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">d_arg</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-identifier">d_arg</span>.<span class="ruby-identifier">empty?</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">d_arg</span> <span class="ruby-operator">!~</span> <span class="ruby-regexp re">/\A\w+\z/</span>
343
- <span class="ruby-identifier">raise</span> <span class="ruby-identifier">convert_error</span>(<span class="ruby-node">&quot;'#{d_str}': invalid varname.&quot;</span>, <span class="ruby-identifier">stag_info</span>.<span class="ruby-identifier">linenum</span>)
346
+ <span class="ruby-identifier">raise</span> <span class="ruby-identifier">convert_error</span>(<span class="ruby-node">&quot;'#{d_str}': invalid varname.&quot;</span>, <span class="ruby-identifier">arg</span>.<span class="ruby-identifier">stag_info</span>.<span class="ruby-identifier">linenum</span>)
344
347
  <span class="ruby-keyword kw">end</span>
345
- <span class="ruby-identifier">sb</span> = <span class="ruby-value str">&quot;&lt;c:catch&quot;</span>
346
- <span class="ruby-identifier">sb</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot; var=\&quot;#{d_arg}\&quot;&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">d_arg</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-identifier">d_arg</span>.<span class="ruby-identifier">empty?</span>
347
- <span class="ruby-identifier">sb</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;&gt;&quot;</span>
348
- <span class="ruby-identifier">stmt_list</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">NativeStatement</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">sb</span>)
349
- <span class="ruby-identifier">stmt_list</span>.<span class="ruby-identifier">concat</span>(<span class="ruby-identifier">cont_stmts</span>)
348
+ <span class="ruby-identifier">code</span> = <span class="ruby-value str">&quot;&lt;c:catch&quot;</span>
349
+ <span class="ruby-identifier">code</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot; var=\&quot;#{d_arg}\&quot;&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">d_arg</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-identifier">d_arg</span>.<span class="ruby-identifier">empty?</span>
350
+ <span class="ruby-identifier">code</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;&gt;&quot;</span>
351
+ <span class="ruby-identifier">stmt_list</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">NativeStatement</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">code</span>)
352
+ <span class="ruby-identifier">stmt_list</span>.<span class="ruby-identifier">concat</span>(<span class="ruby-identifier">arg</span>.<span class="ruby-identifier">cont_stmts</span>)
350
353
  <span class="ruby-identifier">stmt_list</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">NativeStatement</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value str">&quot;&lt;/c:catch&gt;&quot;</span>)
351
354
 
352
355
  <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:forEach</span>, <span class="ruby-identifier">:forTokens</span>
353
- <span class="ruby-identifier">stag</span>, <span class="ruby-identifier">etag</span> = <span class="ruby-identifier">eval</span> <span class="ruby-node">&quot;handle_jstl_#{d_name}(#{d_arg})&quot;</span>
354
- <span class="ruby-identifier">stmt_list</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">NativeStatement</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">stag</span>)
355
- <span class="ruby-identifier">stmt_list</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">build_print_stmt</span>(<span class="ruby-identifier">stag_info</span>, <span class="ruby-identifier">attr_info</span>, <span class="ruby-identifier">append_exprs</span>)
356
- <span class="ruby-identifier">stmt_list</span>.<span class="ruby-identifier">concat</span>(<span class="ruby-identifier">cont_stmts</span>)
357
- <span class="ruby-identifier">stmt_list</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">build_print_stmt</span>(<span class="ruby-identifier">etag_info</span>, <span class="ruby-keyword kw">nil</span>, <span class="ruby-keyword kw">nil</span>)
358
- <span class="ruby-identifier">stmt_list</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">NativeStatement</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">etag</span>)
356
+ <span class="ruby-identifier">options</span> = <span class="ruby-identifier">eval</span> <span class="ruby-node">&quot;{ #{d_arg} }&quot;</span>
357
+ <span class="ruby-identifier">stag</span>, <span class="ruby-identifier">etag</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">__send__</span> <span class="ruby-node">&quot;handle_jstl_#{d_name}&quot;</span>, <span class="ruby-identifier">options</span>
358
+ <span class="ruby-identifier">wrap_element_with_native_stmt</span>(<span class="ruby-identifier">stmt_list</span>, <span class="ruby-identifier">arg</span>, <span class="ruby-identifier">stag</span>, <span class="ruby-identifier">etag</span>, <span class="ruby-keyword kw">nil</span>)
359
+ <span class="ruby-comment cmt">#stmt_list &lt;&lt; NativeStatement.new(stag)</span>
360
+ <span class="ruby-comment cmt">#stmt_list &lt;&lt; stag_stmt</span>
361
+ <span class="ruby-comment cmt">#stmt_list.concat(cont_stmts)</span>
362
+ <span class="ruby-comment cmt">#stmt_list &lt;&lt; etag_stmt</span>
363
+ <span class="ruby-comment cmt">#stmt_list &lt;&lt; NativeStatement.new(etag)</span>
359
364
 
360
365
  <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:redirect</span>, <span class="ruby-identifier">:import</span>, <span class="ruby-identifier">:url</span>, <span class="ruby-identifier">:remove</span>
361
- <span class="ruby-identifier">lines</span> = <span class="ruby-identifier">eval</span> <span class="ruby-node">&quot;handle_jstl_#{d_name}(#{d_arg})&quot;</span>
366
+ <span class="ruby-identifier">options</span> = <span class="ruby-identifier">eval</span> <span class="ruby-node">&quot;{ #{d_arg} }&quot;</span>
367
+ <span class="ruby-identifier">lines</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">__send__</span> <span class="ruby-node">&quot;handle_jstl_#{d_name}&quot;</span>, <span class="ruby-identifier">options</span>
362
368
  <span class="ruby-identifier">lines</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">line</span><span class="ruby-operator">|</span>
363
- <span class="ruby-identifier">stmt_list</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">NativeStatement</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">line</span>)
369
+ <span class="ruby-identifier">stmt_list</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">NativeStatement</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">line</span>.<span class="ruby-identifier">chomp</span>)
364
370
  <span class="ruby-keyword kw">end</span>
365
371
 
366
372
  <span class="ruby-keyword kw">else</span>
@@ -375,19 +381,19 @@ directive handler for JSTL
375
381
  </div>
376
382
  </div>
377
383
 
378
- <div id="method-M000051" class="method-detail">
379
- <a name="M000051"></a>
384
+ <div id="method-M000087" class="method-detail">
385
+ <a name="M000087"></a>
380
386
 
381
387
  <div class="method-heading">
382
- <a href="#M000051" class="method-signature">
388
+ <a href="#M000087" class="method-signature">
383
389
  <span class="method-name">mapping_pattern</span><span class="method-args">()</span>
384
390
  </a>
385
391
  </div>
386
392
 
387
393
  <div class="method-description">
388
394
  <p><a class="source-toggle" href="#"
389
- onclick="toggleCode('M000051-source');return false;">[Source]</a></p>
390
- <div class="method-source-code" id="M000051-source">
395
+ onclick="toggleCode('M000087-source');return false;">[Source]</a></p>
396
+ <div class="method-source-code" id="M000087-source">
391
397
  <pre>
392
398
  <span class="ruby-comment cmt"># File kwartz/binding/jstl.rb, line 38</span>
393
399
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">mapping_pattern</span>
@@ -400,21 +406,21 @@ directive handler for JSTL
400
406
 
401
407
  <h3 class="section-bar">Protected Instance methods</h3>
402
408
 
403
- <div id="method-M000062" class="method-detail">
404
- <a name="M000062"></a>
409
+ <div id="method-M000098" class="method-detail">
410
+ <a name="M000098"></a>
405
411
 
406
412
  <div class="method-heading">
407
- <a href="#M000062" class="method-signature">
413
+ <a href="#M000098" class="method-signature">
408
414
  <span class="method-name">_evaluate_options</span><span class="method-args">(options={})</span>
409
415
  </a>
410
416
  </div>
411
417
 
412
418
  <div class="method-description">
413
419
  <p><a class="source-toggle" href="#"
414
- onclick="toggleCode('M000062-source');return false;">[Source]</a></p>
415
- <div class="method-source-code" id="M000062-source">
420
+ onclick="toggleCode('M000098-source');return false;">[Source]</a></p>
421
+ <div class="method-source-code" id="M000098-source">
416
422
  <pre>
417
- <span class="ruby-comment cmt"># File kwartz/binding/jstl.rb, line 261</span>
423
+ <span class="ruby-comment cmt"># File kwartz/binding/jstl.rb, line 276</span>
418
424
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">_evaluate_options</span>(<span class="ruby-identifier">options</span>={})
419
425
  <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">options</span>
420
426
  <span class="ruby-keyword kw">end</span>
@@ -423,73 +429,82 @@ directive handler for JSTL
423
429
  </div>
424
430
  </div>
425
431
 
426
- <div id="method-M000060" class="method-detail">
427
- <a name="M000060"></a>
432
+ <div id="method-M000096" class="method-detail">
433
+ <a name="M000096"></a>
428
434
 
429
435
  <div class="method-heading">
430
- <a href="#M000060" class="method-signature">
436
+ <a href="#M000096" class="method-signature">
431
437
  <span class="method-name">_handle_jstl_params</span><span class="method-args">(tagname, param_list, options)</span>
432
438
  </a>
433
439
  </div>
434
440
 
435
441
  <div class="method-description">
436
442
  <p><a class="source-toggle" href="#"
437
- onclick="toggleCode('M000060-source');return false;">[Source]</a></p>
438
- <div class="method-source-code" id="M000060-source">
443
+ onclick="toggleCode('M000096-source');return false;">[Source]</a></p>
444
+ <div class="method-source-code" id="M000096-source">
439
445
  <pre>
440
- <span class="ruby-comment cmt"># File kwartz/binding/jstl.rb, line 218</span>
446
+ <span class="ruby-comment cmt"># File kwartz/binding/jstl.rb, line 224</span>
441
447
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">_handle_jstl_params</span>(<span class="ruby-identifier">tagname</span>, <span class="ruby-identifier">param_list</span>, <span class="ruby-identifier">options</span>)
442
- <span class="ruby-identifier">stag</span>, <span class="ruby-identifier">etag</span> = <span class="ruby-identifier">_handle_jstl_tag</span>(<span class="ruby-identifier">tagname</span>, <span class="ruby-identifier">param_list</span>, <span class="ruby-identifier">options</span>)
443
- <span class="ruby-identifier">lines</span> = [<span class="ruby-identifier">stag</span>]
448
+ <span class="ruby-identifier">stag</span>, <span class="ruby-identifier">etag</span> = <span class="ruby-identifier">_handle_jstl_tag</span>(<span class="ruby-identifier">tagname</span>, <span class="ruby-identifier">param_list</span>, <span class="ruby-identifier">options</span>, <span class="ruby-keyword kw">true</span>)
444
449
  <span class="ruby-identifier">i</span> = <span class="ruby-value">0</span>
445
- <span class="ruby-identifier">options</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">name</span>, <span class="ruby-identifier">value</span><span class="ruby-operator">|</span>
446
- <span class="ruby-identifier">i</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
447
- <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">value</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Symbol</span>)
448
- <span class="ruby-identifier">lines</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot; &lt;c:param name=\&quot;#{name}\&quot; value=\&quot;${#{value}}\&quot;/&gt;&quot;</span>
449
- <span class="ruby-keyword kw">else</span>
450
- <span class="ruby-comment cmt">#lines &lt;&lt; &quot; &lt;c:param name=\&quot;#{name}\&quot; value=\&quot;#{value}\&quot;/&gt;&quot;</span>
451
- <span class="ruby-keyword kw">end</span>
452
- <span class="ruby-keyword kw">end</span>
453
- <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">i</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span>
454
- <span class="ruby-identifier">stag</span>.<span class="ruby-identifier">sub!</span>(<span class="ruby-regexp re">/&gt;\z/</span>, <span class="ruby-value str">'/&gt;'</span>)
450
+ <span class="ruby-identifier">unknown_param_names</span> = <span class="ruby-identifier">options</span>.<span class="ruby-identifier">keys</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">param_list</span>
451
+ <span class="ruby-identifier">lines</span> = []
452
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">unknown_param_names</span>.<span class="ruby-identifier">empty?</span>
453
+ <span class="ruby-identifier">lines</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">stag</span>.<span class="ruby-identifier">sub</span>(<span class="ruby-regexp re">/&gt;\z/</span>, <span class="ruby-value str">'/&gt;'</span>)
455
454
  <span class="ruby-keyword kw">else</span>
455
+ <span class="ruby-identifier">lines</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">stag</span>
456
+ <span class="ruby-identifier">unknown_param_names</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">name</span><span class="ruby-operator">|</span>
457
+ <span class="ruby-identifier">value</span> = <span class="ruby-identifier">options</span>[<span class="ruby-identifier">name</span>]
458
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">value</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Symbol</span>)
459
+ <span class="ruby-identifier">lines</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot; &lt;c:param name=\&quot;#{name}\&quot; value=\&quot;${#{value}}\&quot;/&gt;&quot;</span>
460
+ <span class="ruby-keyword kw">else</span>
461
+ <span class="ruby-identifier">lines</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot; &lt;c:param name=\&quot;#{name}\&quot; value=\&quot;#{value}\&quot;/&gt;&quot;</span>
462
+ <span class="ruby-keyword kw">end</span>
463
+ <span class="ruby-keyword kw">end</span>
456
464
  <span class="ruby-identifier">lines</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">etag</span>
457
465
  <span class="ruby-keyword kw">end</span>
458
- <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">lines</span>
466
+ <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">lines</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">&quot;\n&quot;</span>)
459
467
  <span class="ruby-keyword kw">end</span>
460
468
  </pre>
461
469
  </div>
462
470
  </div>
463
471
  </div>
464
472
 
465
- <div id="method-M000061" class="method-detail">
466
- <a name="M000061"></a>
473
+ <div id="method-M000097" class="method-detail">
474
+ <a name="M000097"></a>
467
475
 
468
476
  <div class="method-heading">
469
- <a href="#M000061" class="method-signature">
470
- <span class="method-name">_handle_jstl_tag</span><span class="method-args">(tagname, param_list, options)</span>
477
+ <a href="#M000097" class="method-signature">
478
+ <span class="method-name">_handle_jstl_tag</span><span class="method-args">(tagname, param_list, options, ignore_unknown_option=false)</span>
471
479
  </a>
472
480
  </div>
473
481
 
474
482
  <div class="method-description">
475
483
  <p><a class="source-toggle" href="#"
476
- onclick="toggleCode('M000061-source');return false;">[Source]</a></p>
477
- <div class="method-source-code" id="M000061-source">
484
+ onclick="toggleCode('M000097-source');return false;">[Source]</a></p>
485
+ <div class="method-source-code" id="M000097-source">
478
486
  <pre>
479
- <span class="ruby-comment cmt"># File kwartz/binding/jstl.rb, line 239</span>
480
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">_handle_jstl_tag</span>(<span class="ruby-identifier">tagname</span>, <span class="ruby-identifier">param_list</span>, <span class="ruby-identifier">options</span>)
481
- <span class="ruby-identifier">sb</span> = <span class="ruby-node">&quot;&lt;c:#{tagname}&quot;</span>
482
- <span class="ruby-identifier">param_list</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">param</span><span class="ruby-operator">|</span>
483
- <span class="ruby-identifier">key</span> = <span class="ruby-keyword kw">nil</span>
484
- <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">options</span>.<span class="ruby-identifier">key?</span>(<span class="ruby-identifier">param</span>.<span class="ruby-identifier">intern</span>) ; <span class="ruby-identifier">key</span> = <span class="ruby-identifier">param</span>.<span class="ruby-identifier">intern</span>
485
- <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">options</span>.<span class="ruby-identifier">key?</span>(<span class="ruby-identifier">param</span>) ; <span class="ruby-identifier">key</span> = <span class="ruby-identifier">param</span>
487
+ <span class="ruby-comment cmt"># File kwartz/binding/jstl.rb, line 247</span>
488
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">_handle_jstl_tag</span>(<span class="ruby-identifier">tagname</span>, <span class="ruby-identifier">param_list</span>, <span class="ruby-identifier">options</span>, <span class="ruby-identifier">ignore_unknown_option</span>=<span class="ruby-keyword kw">false</span>)
489
+ <span class="ruby-identifier">options</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">name</span>, <span class="ruby-identifier">value</span><span class="ruby-operator">|</span>
490
+ <span class="ruby-keyword kw">next</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">name</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">String</span>)
491
+ <span class="ruby-identifier">options</span>[<span class="ruby-identifier">name</span>.<span class="ruby-identifier">to_s</span>] = <span class="ruby-identifier">options</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">name</span>)
492
+ <span class="ruby-keyword kw">end</span>
493
+ <span class="ruby-identifier">option_names</span> = <span class="ruby-identifier">options</span>.<span class="ruby-identifier">keys</span>
494
+ <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">ignore_unknown_option</span>
495
+ <span class="ruby-identifier">unkown_option_names</span> = <span class="ruby-identifier">option_names</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">param_list</span>
496
+ <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">unkown_option_names</span>.<span class="ruby-identifier">empty?</span>
497
+ <span class="ruby-identifier">msg</span> = <span class="ruby-node">&quot;'#{unkown_option_names[0]}': unknown option for '#{tagname}' directive.&quot;</span>
498
+ <span class="ruby-identifier">raise</span> <span class="ruby-identifier">convert_error</span>(<span class="ruby-identifier">msg</span>, <span class="ruby-keyword kw">nil</span>) <span class="ruby-comment cmt"># TODO</span>
486
499
  <span class="ruby-keyword kw">end</span>
487
- <span class="ruby-keyword kw">next</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">key</span> <span class="ruby-operator">==</span> <span class="ruby-keyword kw">nil</span>
488
- <span class="ruby-identifier">value</span> = <span class="ruby-identifier">options</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">key</span>)
500
+ <span class="ruby-keyword kw">end</span>
501
+ <span class="ruby-identifier">sb</span> = <span class="ruby-node">&quot;&lt;c:#{tagname}&quot;</span>
502
+ (<span class="ruby-identifier">param_list</span> <span class="ruby-operator">&amp;</span> <span class="ruby-identifier">option_names</span>).<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">name</span><span class="ruby-operator">|</span>
503
+ <span class="ruby-identifier">value</span> = <span class="ruby-identifier">options</span>[<span class="ruby-identifier">name</span>]
489
504
  <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">value</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Symbol</span>)
490
- <span class="ruby-identifier">sb</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot; #{param}=\&quot;${#{value}}\&quot;&quot;</span>
505
+ <span class="ruby-identifier">sb</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot; #{name}=\&quot;${#{value}}\&quot;&quot;</span>
491
506
  <span class="ruby-keyword kw">else</span>
492
- <span class="ruby-identifier">sb</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot; #{param}=\&quot;#{value}\&quot;&quot;</span>
507
+ <span class="ruby-identifier">sb</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot; #{name}=\&quot;#{value}\&quot;&quot;</span>
493
508
  <span class="ruby-keyword kw">end</span>
494
509
  <span class="ruby-keyword kw">end</span>
495
510
  <span class="ruby-identifier">sb</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;&gt;&quot;</span>
@@ -502,21 +517,21 @@ directive handler for JSTL
502
517
  </div>
503
518
  </div>
504
519
 
505
- <div id="method-M000058" class="method-detail">
506
- <a name="M000058"></a>
520
+ <div id="method-M000094" class="method-detail">
521
+ <a name="M000094"></a>
507
522
 
508
523
  <div class="method-heading">
509
- <a href="#M000058" class="method-signature">
524
+ <a href="#M000094" class="method-signature">
510
525
  <span class="method-name">handle_jstl_forEach</span><span class="method-args">(options)</span>
511
526
  </a>
512
527
  </div>
513
528
 
514
529
  <div class="method-description">
515
530
  <p><a class="source-toggle" href="#"
516
- onclick="toggleCode('M000058-source');return false;">[Source]</a></p>
517
- <div class="method-source-code" id="M000058-source">
531
+ onclick="toggleCode('M000094-source');return false;">[Source]</a></p>
532
+ <div class="method-source-code" id="M000094-source">
518
533
  <pre>
519
- <span class="ruby-comment cmt"># File kwartz/binding/jstl.rb, line 206</span>
534
+ <span class="ruby-comment cmt"># File kwartz/binding/jstl.rb, line 212</span>
520
535
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">handle_jstl_forEach</span>(<span class="ruby-identifier">options</span>)
521
536
  <span class="ruby-identifier">param_list</span> = <span class="ruby-node">%w[var items varStatus begin end step]</span>
522
537
  <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">_handle_jstl_tag</span>(<span class="ruby-value str">'forEach'</span>, <span class="ruby-identifier">param_list</span>, <span class="ruby-identifier">options</span>)
@@ -526,21 +541,21 @@ directive handler for JSTL
526
541
  </div>
527
542
  </div>
528
543
 
529
- <div id="method-M000059" class="method-detail">
530
- <a name="M000059"></a>
544
+ <div id="method-M000095" class="method-detail">
545
+ <a name="M000095"></a>
531
546
 
532
547
  <div class="method-heading">
533
- <a href="#M000059" class="method-signature">
548
+ <a href="#M000095" class="method-signature">
534
549
  <span class="method-name">handle_jstl_forTokens</span><span class="method-args">(options)</span>
535
550
  </a>
536
551
  </div>
537
552
 
538
553
  <div class="method-description">
539
554
  <p><a class="source-toggle" href="#"
540
- onclick="toggleCode('M000059-source');return false;">[Source]</a></p>
541
- <div class="method-source-code" id="M000059-source">
555
+ onclick="toggleCode('M000095-source');return false;">[Source]</a></p>
556
+ <div class="method-source-code" id="M000095-source">
542
557
  <pre>
543
- <span class="ruby-comment cmt"># File kwartz/binding/jstl.rb, line 212</span>
558
+ <span class="ruby-comment cmt"># File kwartz/binding/jstl.rb, line 218</span>
544
559
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">handle_jstl_forTokens</span>(<span class="ruby-identifier">options</span>)
545
560
  <span class="ruby-identifier">param_list</span> = <span class="ruby-node">%w[items delims var varStatus begin end step]</span>
546
561
  <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">_handle_jstl_tag</span>(<span class="ruby-value str">'forTokens'</span>, <span class="ruby-identifier">param_list</span>, <span class="ruby-identifier">options</span>)
@@ -550,21 +565,21 @@ directive handler for JSTL
550
565
  </div>
551
566
  </div>
552
567
 
553
- <div id="method-M000055" class="method-detail">
554
- <a name="M000055"></a>
568
+ <div id="method-M000091" class="method-detail">
569
+ <a name="M000091"></a>
555
570
 
556
571
  <div class="method-heading">
557
- <a href="#M000055" class="method-signature">
572
+ <a href="#M000091" class="method-signature">
558
573
  <span class="method-name">handle_jstl_import</span><span class="method-args">(options)</span>
559
574
  </a>
560
575
  </div>
561
576
 
562
577
  <div class="method-description">
563
578
  <p><a class="source-toggle" href="#"
564
- onclick="toggleCode('M000055-source');return false;">[Source]</a></p>
565
- <div class="method-source-code" id="M000055-source">
579
+ onclick="toggleCode('M000091-source');return false;">[Source]</a></p>
580
+ <div class="method-source-code" id="M000091-source">
566
581
  <pre>
567
- <span class="ruby-comment cmt"># File kwartz/binding/jstl.rb, line 191</span>
582
+ <span class="ruby-comment cmt"># File kwartz/binding/jstl.rb, line 197</span>
568
583
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">handle_jstl_import</span>(<span class="ruby-identifier">options</span>)
569
584
  <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">_handle_jstl_params</span>(<span class="ruby-value str">'import'</span>, <span class="ruby-node">%w[url context charEncoding var scope]</span>, <span class="ruby-identifier">options</span>)
570
585
  <span class="ruby-keyword kw">end</span>
@@ -573,21 +588,21 @@ directive handler for JSTL
573
588
  </div>
574
589
  </div>
575
590
 
576
- <div id="method-M000054" class="method-detail">
577
- <a name="M000054"></a>
591
+ <div id="method-M000090" class="method-detail">
592
+ <a name="M000090"></a>
578
593
 
579
594
  <div class="method-heading">
580
- <a href="#M000054" class="method-signature">
595
+ <a href="#M000090" class="method-signature">
581
596
  <span class="method-name">handle_jstl_redirect</span><span class="method-args">(options)</span>
582
597
  </a>
583
598
  </div>
584
599
 
585
600
  <div class="method-description">
586
601
  <p><a class="source-toggle" href="#"
587
- onclick="toggleCode('M000054-source');return false;">[Source]</a></p>
588
- <div class="method-source-code" id="M000054-source">
602
+ onclick="toggleCode('M000090-source');return false;">[Source]</a></p>
603
+ <div class="method-source-code" id="M000090-source">
589
604
  <pre>
590
- <span class="ruby-comment cmt"># File kwartz/binding/jstl.rb, line 186</span>
605
+ <span class="ruby-comment cmt"># File kwartz/binding/jstl.rb, line 192</span>
591
606
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">handle_jstl_redirect</span>(<span class="ruby-identifier">options</span>)
592
607
  <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">_handle_jstl_params</span>(<span class="ruby-value str">'redirect'</span>, <span class="ruby-node">%w[url context]</span>, <span class="ruby-identifier">options</span>)
593
608
  <span class="ruby-keyword kw">end</span>
@@ -596,21 +611,21 @@ directive handler for JSTL
596
611
  </div>
597
612
  </div>
598
613
 
599
- <div id="method-M000057" class="method-detail">
600
- <a name="M000057"></a>
614
+ <div id="method-M000093" class="method-detail">
615
+ <a name="M000093"></a>
601
616
 
602
617
  <div class="method-heading">
603
- <a href="#M000057" class="method-signature">
618
+ <a href="#M000093" class="method-signature">
604
619
  <span class="method-name">handle_jstl_remove</span><span class="method-args">(options)</span>
605
620
  </a>
606
621
  </div>
607
622
 
608
623
  <div class="method-description">
609
624
  <p><a class="source-toggle" href="#"
610
- onclick="toggleCode('M000057-source');return false;">[Source]</a></p>
611
- <div class="method-source-code" id="M000057-source">
625
+ onclick="toggleCode('M000093-source');return false;">[Source]</a></p>
626
+ <div class="method-source-code" id="M000093-source">
612
627
  <pre>
613
- <span class="ruby-comment cmt"># File kwartz/binding/jstl.rb, line 201</span>
628
+ <span class="ruby-comment cmt"># File kwartz/binding/jstl.rb, line 207</span>
614
629
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">handle_jstl_remove</span>(<span class="ruby-identifier">options</span>)
615
630
  <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">_handle_jstl_params</span>(<span class="ruby-value str">'remove'</span>, <span class="ruby-node">%w[var scope]</span>, <span class="ruby-identifier">options</span>)
616
631
  <span class="ruby-keyword kw">end</span>
@@ -619,21 +634,21 @@ directive handler for JSTL
619
634
  </div>
620
635
  </div>
621
636
 
622
- <div id="method-M000056" class="method-detail">
623
- <a name="M000056"></a>
637
+ <div id="method-M000092" class="method-detail">
638
+ <a name="M000092"></a>
624
639
 
625
640
  <div class="method-heading">
626
- <a href="#M000056" class="method-signature">
641
+ <a href="#M000092" class="method-signature">
627
642
  <span class="method-name">handle_jstl_url</span><span class="method-args">(options)</span>
628
643
  </a>
629
644
  </div>
630
645
 
631
646
  <div class="method-description">
632
647
  <p><a class="source-toggle" href="#"
633
- onclick="toggleCode('M000056-source');return false;">[Source]</a></p>
634
- <div class="method-source-code" id="M000056-source">
648
+ onclick="toggleCode('M000092-source');return false;">[Source]</a></p>
649
+ <div class="method-source-code" id="M000092-source">
635
650
  <pre>
636
- <span class="ruby-comment cmt"># File kwartz/binding/jstl.rb, line 196</span>
651
+ <span class="ruby-comment cmt"># File kwartz/binding/jstl.rb, line 202</span>
637
652
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">handle_jstl_url</span>(<span class="ruby-identifier">options</span>)
638
653
  <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">_handle_jstl_params</span>(<span class="ruby-value str">'url'</span>, <span class="ruby-node">%w[value context var scope]</span>, <span class="ruby-identifier">options</span>)
639
654
  <span class="ruby-keyword kw">end</span>