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
@@ -80,7 +80,7 @@
80
80
 
81
81
  <div id="description">
82
82
  <p>
83
- .[abstract] handle directives
83
+ (abstract) handle directives
84
84
  </p>
85
85
 
86
86
  </div>
@@ -92,16 +92,16 @@
92
92
  <h3 class="section-bar">Methods</h3>
93
93
 
94
94
  <div class="name-list">
95
- <a href="#M000180">directive_format</a>&nbsp;&nbsp;
96
- <a href="#M000178">directive_pattern</a>&nbsp;&nbsp;
97
- <a href="#M000182">extract</a>&nbsp;&nbsp;
98
- <a href="#M000184">get_class</a>&nbsp;&nbsp;
99
- <a href="#M000177">get_element_info</a>&nbsp;&nbsp;
100
- <a href="#M000176">get_element_ruleset</a>&nbsp;&nbsp;
101
- <a href="#M000181">handle</a>&nbsp;&nbsp;
102
- <a href="#M000179">mapping_pattern</a>&nbsp;&nbsp;
103
- <a href="#M000175">new</a>&nbsp;&nbsp;
104
- <a href="#M000183">register_class</a>&nbsp;&nbsp;
95
+ <a href="#M000232">directive_format</a>&nbsp;&nbsp;
96
+ <a href="#M000230">directive_pattern</a>&nbsp;&nbsp;
97
+ <a href="#M000234">extract</a>&nbsp;&nbsp;
98
+ <a href="#M000236">get_class</a>&nbsp;&nbsp;
99
+ <a href="#M000229">get_element_info</a>&nbsp;&nbsp;
100
+ <a href="#M000228">get_element_ruleset</a>&nbsp;&nbsp;
101
+ <a href="#M000233">handle</a>&nbsp;&nbsp;
102
+ <a href="#M000231">mapping_pattern</a>&nbsp;&nbsp;
103
+ <a href="#M000227">new</a>&nbsp;&nbsp;
104
+ <a href="#M000235">register_class</a>&nbsp;&nbsp;
105
105
  </div>
106
106
  </div>
107
107
 
@@ -115,6 +115,7 @@
115
115
  <div id="includes-list">
116
116
  <span class="include-name"><a href="Assertion.html">Assertion</a></span>
117
117
  <span class="include-name">ConverterHelper</span>
118
+ <span class="include-name"><a href="StatementHelper.html">StatementHelper</a></span>
118
119
  <span class="include-name"><a href="ElementExpander.html">ElementExpander</a></span>
119
120
  </div>
120
121
  </div>
@@ -160,21 +161,21 @@
160
161
  <div id="methods">
161
162
  <h3 class="section-bar">Public Class methods</h3>
162
163
 
163
- <div id="method-M000184" class="method-detail">
164
- <a name="M000184"></a>
164
+ <div id="method-M000236" class="method-detail">
165
+ <a name="M000236"></a>
165
166
 
166
167
  <div class="method-heading">
167
- <a href="#M000184" class="method-signature">
168
+ <a href="#M000236" class="method-signature">
168
169
  <span class="method-name">get_class</span><span class="method-args">(lang)</span>
169
170
  </a>
170
171
  </div>
171
172
 
172
173
  <div class="method-description">
173
174
  <p><a class="source-toggle" href="#"
174
- onclick="toggleCode('M000184-source');return false;">[Source]</a></p>
175
- <div class="method-source-code" id="M000184-source">
175
+ onclick="toggleCode('M000236-source');return false;">[Source]</a></p>
176
+ <div class="method-source-code" id="M000236-source">
176
177
  <pre>
177
- <span class="ruby-comment cmt"># File kwartz/converter.rb, line 641</span>
178
+ <span class="ruby-comment cmt"># File kwartz/converter.rb, line 799</span>
178
179
  <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">get_class</span>(<span class="ruby-identifier">lang</span>)
179
180
  <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@@class_table</span>[<span class="ruby-identifier">lang</span>]
180
181
  <span class="ruby-keyword kw">end</span>
@@ -183,21 +184,21 @@
183
184
  </div>
184
185
  </div>
185
186
 
186
- <div id="method-M000175" class="method-detail">
187
- <a name="M000175"></a>
187
+ <div id="method-M000227" class="method-detail">
188
+ <a name="M000227"></a>
188
189
 
189
190
  <div class="method-heading">
190
- <a href="#M000175" class="method-signature">
191
+ <a href="#M000227" class="method-signature">
191
192
  <span class="method-name">new</span><span class="method-args">(elem_rulesets=[], properties={})</span>
192
193
  </a>
193
194
  </div>
194
195
 
195
196
  <div class="method-description">
196
197
  <p><a class="source-toggle" href="#"
197
- onclick="toggleCode('M000175-source');return false;">[Source]</a></p>
198
- <div class="method-source-code" id="M000175-source">
198
+ onclick="toggleCode('M000227-source');return false;">[Source]</a></p>
199
+ <div class="method-source-code" id="M000227-source">
199
200
  <pre>
200
- <span class="ruby-comment cmt"># File kwartz/converter.rb, line 448</span>
201
+ <span class="ruby-comment cmt"># File kwartz/converter.rb, line 583</span>
201
202
  <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>={})
202
203
  <span class="ruby-ivar">@elem_rulesets</span> = <span class="ruby-identifier">elem_rulesets</span>
203
204
  <span class="ruby-comment cmt">#@elem_ruleset_table = elem_rulesets.inject({}) { |table, ruleset| table[ruleset.name] = ruleset; table }</span>
@@ -213,21 +214,21 @@
213
214
  </div>
214
215
  </div>
215
216
 
216
- <div id="method-M000183" class="method-detail">
217
- <a name="M000183"></a>
217
+ <div id="method-M000235" class="method-detail">
218
+ <a name="M000235"></a>
218
219
 
219
220
  <div class="method-heading">
220
- <a href="#M000183" class="method-signature">
221
+ <a href="#M000235" class="method-signature">
221
222
  <span class="method-name">register_class</span><span class="method-args">(lang, klass)</span>
222
223
  </a>
223
224
  </div>
224
225
 
225
226
  <div class="method-description">
226
227
  <p><a class="source-toggle" href="#"
227
- onclick="toggleCode('M000183-source');return false;">[Source]</a></p>
228
- <div class="method-source-code" id="M000183-source">
228
+ onclick="toggleCode('M000235-source');return false;">[Source]</a></p>
229
+ <div class="method-source-code" id="M000235-source">
229
230
  <pre>
230
- <span class="ruby-comment cmt"># File kwartz/converter.rb, line 636</span>
231
+ <span class="ruby-comment cmt"># File kwartz/converter.rb, line 794</span>
231
232
  <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">register_class</span>(<span class="ruby-identifier">lang</span>, <span class="ruby-identifier">klass</span>)
232
233
  <span class="ruby-ivar">@@class_table</span>[<span class="ruby-identifier">lang</span>] = <span class="ruby-identifier">klass</span>
233
234
  <span class="ruby-keyword kw">end</span>
@@ -238,21 +239,21 @@
238
239
 
239
240
  <h3 class="section-bar">Public Instance methods</h3>
240
241
 
241
- <div id="method-M000182" class="method-detail">
242
- <a name="M000182"></a>
242
+ <div id="method-M000234" class="method-detail">
243
+ <a name="M000234"></a>
243
244
 
244
245
  <div class="method-heading">
245
- <a href="#M000182" class="method-signature">
246
+ <a href="#M000234" class="method-signature">
246
247
  <span class="method-name">extract</span><span class="method-args">(elem_name, content_only=false)</span>
247
248
  </a>
248
249
  </div>
249
250
 
250
251
  <div class="method-description">
251
252
  <p><a class="source-toggle" href="#"
252
- onclick="toggleCode('M000182-source');return false;">[Source]</a></p>
253
- <div class="method-source-code" id="M000182-source">
253
+ onclick="toggleCode('M000234-source');return false;">[Source]</a></p>
254
+ <div class="method-source-code" id="M000234-source">
254
255
  <pre>
255
- <span class="ruby-comment cmt"># File kwartz/converter.rb, line 623</span>
256
+ <span class="ruby-comment cmt"># File kwartz/converter.rb, line 781</span>
256
257
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">extract</span>(<span class="ruby-identifier">elem_name</span>, <span class="ruby-identifier">content_only</span>=<span class="ruby-keyword kw">false</span>)
257
258
  <span class="ruby-identifier">elem_info</span> = <span class="ruby-ivar">@elem_info_table</span>[<span class="ruby-identifier">elem_name</span>]
258
259
  <span class="ruby-identifier">elem_info</span> <span class="ruby-keyword kw">or</span> <span class="ruby-identifier">raise</span> <span class="ruby-identifier">convert_error</span>(<span class="ruby-node">&quot;element '#{elem_name}' not found.&quot;</span>, <span class="ruby-keyword kw">nil</span>)
@@ -266,58 +267,58 @@
266
267
  </div>
267
268
  </div>
268
269
 
269
- <div id="method-M000177" class="method-detail">
270
- <a name="M000177"></a>
270
+ <div id="method-M000229" class="method-detail">
271
+ <a name="M000229"></a>
271
272
 
272
273
  <div class="method-heading">
273
- <a href="#M000177" class="method-signature">
274
+ <a href="#M000229" class="method-signature">
274
275
  <span class="method-name">get_element_info</span><span class="method-args">(name)</span>
275
276
  </a>
276
277
  </div>
277
278
 
278
279
  <div class="method-description">
279
280
  <p><a class="source-toggle" href="#"
280
- onclick="toggleCode('M000177-source');return false;">[Source]</a></p>
281
- <div class="method-source-code" id="M000177-source">
281
+ onclick="toggleCode('M000229-source');return false;">[Source]</a></p>
282
+ <div class="method-source-code" id="M000229-source">
282
283
  <pre>
283
- <span class="ruby-comment cmt"># File kwartz/converter.rb, line 467</span>
284
+ <span class="ruby-comment cmt"># File kwartz/converter.rb, line 602</span>
284
285
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get_element_info</span>(<span class="ruby-identifier">name</span>) <span class="ruby-comment cmt"># for ElementExpander module</span>
285
- <span class="ruby-ivar">@elem_info_table</span>[<span class="ruby-identifier">name</span>]
286
+ <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@elem_info_table</span>[<span class="ruby-identifier">name</span>]
286
287
  <span class="ruby-keyword kw">end</span>
287
288
  </pre>
288
289
  </div>
289
290
  </div>
290
291
  </div>
291
292
 
292
- <div id="method-M000176" class="method-detail">
293
- <a name="M000176"></a>
293
+ <div id="method-M000228" class="method-detail">
294
+ <a name="M000228"></a>
294
295
 
295
296
  <div class="method-heading">
296
- <a href="#M000176" class="method-signature">
297
+ <a href="#M000228" class="method-signature">
297
298
  <span class="method-name">get_element_ruleset</span><span class="method-args">(name)</span>
298
299
  </a>
299
300
  </div>
300
301
 
301
302
  <div class="method-description">
302
303
  <p><a class="source-toggle" href="#"
303
- onclick="toggleCode('M000176-source');return false;">[Source]</a></p>
304
- <div class="method-source-code" id="M000176-source">
304
+ onclick="toggleCode('M000228-source');return false;">[Source]</a></p>
305
+ <div class="method-source-code" id="M000228-source">
305
306
  <pre>
306
- <span class="ruby-comment cmt"># File kwartz/converter.rb, line 462</span>
307
+ <span class="ruby-comment cmt"># File kwartz/converter.rb, line 597</span>
307
308
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">get_element_ruleset</span>(<span class="ruby-identifier">name</span>) <span class="ruby-comment cmt"># for ElementExpander module and Converter class</span>
308
- <span class="ruby-ivar">@elem_ruleset_table</span>[<span class="ruby-identifier">name</span>]
309
+ <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@elem_ruleset_table</span>[<span class="ruby-identifier">name</span>]
309
310
  <span class="ruby-keyword kw">end</span>
310
311
  </pre>
311
312
  </div>
312
313
  </div>
313
314
  </div>
314
315
 
315
- <div id="method-M000181" class="method-detail">
316
- <a name="M000181"></a>
316
+ <div id="method-M000233" class="method-detail">
317
+ <a name="M000233"></a>
317
318
 
318
319
  <div class="method-heading">
319
- <a href="#M000181" class="method-signature">
320
- <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>
320
+ <a href="#M000233" class="method-signature">
321
+ <span class="method-name">handle</span><span class="method-args">(stmt_list, handler_arg)</span>
321
322
  </a>
322
323
  </div>
323
324
 
@@ -332,36 +333,39 @@ return true if directive name is one of &#8216;stag&#8217;,
332
333
  &#8216;value&#8217;, else return false.
333
334
  </p>
334
335
  <p><a class="source-toggle" href="#"
335
- onclick="toggleCode('M000181-source');return false;">[Source]</a></p>
336
- <div class="method-source-code" id="M000181-source">
336
+ onclick="toggleCode('M000233-source');return false;">[Source]</a></p>
337
+ <div class="method-source-code" id="M000233-source">
337
338
  <pre>
338
- <span class="ruby-comment cmt"># File kwartz/converter.rb, line 503</span>
339
- <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>)
340
- <span class="ruby-identifier">d_name</span> = <span class="ruby-identifier">directive_name</span>
341
- <span class="ruby-identifier">d_arg</span> = <span class="ruby-identifier">directive_arg</span>
342
- <span class="ruby-identifier">d_str</span> = <span class="ruby-identifier">directive_str</span>
339
+ <span class="ruby-comment cmt"># File kwartz/converter.rb, line 657</span>
340
+ <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>)
341
+ <span class="ruby-identifier">arg</span> = <span class="ruby-identifier">handler_arg</span>
342
+ <span class="ruby-identifier">d_name</span> = <span class="ruby-identifier">arg</span>.<span class="ruby-identifier">directive_name</span>
343
+ <span class="ruby-identifier">d_arg</span> = <span class="ruby-identifier">arg</span>.<span class="ruby-identifier">directive_arg</span>
344
+ <span class="ruby-identifier">d_str</span> = <span class="ruby-identifier">arg</span>.<span class="ruby-identifier">directive_str</span>
343
345
 
344
- <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">directive_name</span>
346
+ <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">d_name</span>
345
347
 
346
348
  <span class="ruby-keyword kw">when</span> <span class="ruby-keyword kw">nil</span>
347
- <span class="ruby-identifier">assert</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-operator">!</span><span class="ruby-identifier">attr_info</span>.<span class="ruby-identifier">empty?</span> <span class="ruby-operator">||</span> <span class="ruby-operator">!</span><span class="ruby-identifier">append_exprs</span>.<span class="ruby-identifier">empty?</span>
348
- <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>)
349
- <span class="ruby-identifier">stmt_list</span>.<span class="ruby-identifier">concat</span>(<span class="ruby-identifier">cont_stmts</span>)
350
- <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">etag_info</span> <span class="ruby-comment cmt"># when empty-tag</span>
349
+ <span class="ruby-identifier">assert</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-operator">!</span><span class="ruby-identifier">arg</span>.<span class="ruby-identifier">attr_info</span>.<span class="ruby-identifier">empty?</span> <span class="ruby-operator">||</span> <span class="ruby-operator">!</span><span class="ruby-identifier">arg</span>.<span class="ruby-identifier">append_exprs</span>.<span class="ruby-identifier">empty?</span>
350
+ <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>)
351
+ <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>)
352
+ <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>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">arg</span>.<span class="ruby-identifier">etag_info</span> <span class="ruby-comment cmt"># when empty-tag</span>
351
353
 
352
354
  <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:dummy</span>
353
355
  <span class="ruby-comment cmt"># nothing</span>
354
356
 
355
357
  <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:id</span>, <span class="ruby-identifier">:mark</span>
356
- <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">directive_arg</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/\A(\w+)\z/</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">directive_arg</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/\A'(\w+)'\z/</span>
357
- <span class="ruby-identifier">raise</span> <span class="ruby-identifier">convert_error</span>(<span class="ruby-node">&quot;'#{d_str}': invalid marking name.&quot;</span>, <span class="ruby-identifier">stag_info</span>.<span class="ruby-identifier">linenum</span>)
358
+ <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+)\z/</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">d_arg</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/\A'(\w+)'\z/</span>
359
+ <span class="ruby-identifier">raise</span> <span class="ruby-identifier">convert_error</span>(<span class="ruby-node">&quot;'#{d_str}': invalid marking name.&quot;</span>, <span class="ruby-identifier">arg</span>.<span class="ruby-identifier">stag_info</span>.<span class="ruby-identifier">linenum</span>)
358
360
  <span class="ruby-keyword kw">end</span>
359
361
  <span class="ruby-identifier">name</span> = <span class="ruby-identifier">$1</span>
360
- <span class="ruby-identifier">elem_info</span> = <span class="ruby-constant">ElementInfo</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">name</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>)
362
+ <span class="ruby-identifier">elem_info</span> = <span class="ruby-constant">ElementInfo</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">arg</span>.<span class="ruby-identifier">stag_info</span>, <span class="ruby-identifier">arg</span>.<span class="ruby-identifier">etag_info</span>, <span class="ruby-identifier">arg</span>.<span class="ruby-identifier">cont_stmts</span>,
363
+ <span class="ruby-identifier">arg</span>.<span class="ruby-identifier">attr_info</span>, <span class="ruby-identifier">arg</span>.<span class="ruby-identifier">append_exprs</span>)
361
364
  <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@elem_info_table</span>[<span class="ruby-identifier">name</span>]
362
365
  <span class="ruby-comment cmt">#unless Config::ALLOW_DUPLICATE_ID</span>
363
366
  <span class="ruby-identifier">previous_linenum</span> = <span class="ruby-ivar">@elem_info_table</span>[<span class="ruby-identifier">name</span>].<span class="ruby-identifier">stag_info</span>.<span class="ruby-identifier">linenum</span>
364
- <span class="ruby-identifier">raise</span> <span class="ruby-identifier">convert_error</span>(<span class="ruby-node">&quot;'#{d_str}': id '#{name}' is already used at line #{previous_linenum}.&quot;</span>, <span class="ruby-identifier">stag_info</span>.<span class="ruby-identifier">linenum</span>)
367
+ <span class="ruby-identifier">msg</span> = <span class="ruby-node">&quot;'#{d_str}': id '#{name}' is already used at line #{previous_linenum}.&quot;</span>
368
+ <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>)
365
369
  <span class="ruby-comment cmt">#end</span>
366
370
  <span class="ruby-keyword kw">else</span>
367
371
  <span class="ruby-ivar">@elem_info_table</span>[<span class="ruby-identifier">name</span>] = <span class="ruby-identifier">elem_info</span>
@@ -370,47 +374,46 @@ return true if directive name is one of &#8216;stag&#8217;,
370
374
  <span class="ruby-identifier">expand_element_info</span>(<span class="ruby-identifier">elem_info</span>, <span class="ruby-identifier">stmt_list</span>)
371
375
 
372
376
  <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:stag</span>, <span class="ruby-identifier">:Stag</span>, <span class="ruby-identifier">:STAG</span>
373
- <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>)
377
+ <span class="ruby-identifier">error_if_empty_tag</span>(<span class="ruby-identifier">arg</span>)
374
378
  <span class="ruby-identifier">flag_escape</span> = <span class="ruby-identifier">d_name</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:stag</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">:Stag</span>)
375
379
  <span class="ruby-identifier">expr</span> = <span class="ruby-constant">NativeExpression</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">d_arg</span>, <span class="ruby-identifier">flag_escape</span>)
376
- <span class="ruby-identifier">stmt_list</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">build_print_expr_stmt</span>(<span class="ruby-identifier">expr</span>, <span class="ruby-identifier">stag_info</span>, <span class="ruby-keyword kw">nil</span>)
377
- <span class="ruby-identifier">stmt_list</span>.<span class="ruby-identifier">concat</span>(<span class="ruby-identifier">cont_stmts</span>)
378
- <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>)
380
+ <span class="ruby-identifier">stmt_list</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">build_print_expr_stmt</span>(<span class="ruby-identifier">expr</span>, <span class="ruby-identifier">arg</span>.<span class="ruby-identifier">stag_info</span>, <span class="ruby-keyword kw">nil</span>)
381
+ <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>)
382
+ <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>)
379
383
 
380
384
  <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:etag</span>, <span class="ruby-identifier">:Etag</span>, <span class="ruby-identifier">:ETAG</span>
381
- <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>)
385
+ <span class="ruby-identifier">error_if_empty_tag</span>(<span class="ruby-identifier">arg</span>)
382
386
  <span class="ruby-identifier">flag_escape</span> = <span class="ruby-identifier">d_name</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:etag</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">:Etag</span>)
383
387
  <span class="ruby-identifier">expr</span> = <span class="ruby-constant">NativeExpression</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">d_arg</span>, <span class="ruby-identifier">flag_escape</span>)
384
- <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>)
385
- <span class="ruby-identifier">stmt_list</span>.<span class="ruby-identifier">concat</span>(<span class="ruby-identifier">cont_stmts</span>)
386
- <span class="ruby-identifier">stmt_list</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">build_print_expr_stmt</span>(<span class="ruby-identifier">expr</span>, <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">etag_info</span>)
388
+ <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>)
389
+ <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>)
390
+ <span class="ruby-identifier">stmt_list</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">build_print_expr_stmt</span>(<span class="ruby-identifier">expr</span>, <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">arg</span>.<span class="ruby-identifier">etag_info</span>)
387
391
 
388
392
  <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:elem</span>, <span class="ruby-identifier">:Elem</span>, <span class="ruby-identifier">:ELEM</span>
389
393
  <span class="ruby-identifier">flag_escape</span> = <span class="ruby-identifier">d_name</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:elem</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">:Elem</span>)
390
394
  <span class="ruby-identifier">expr</span> = <span class="ruby-constant">NativeExpression</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">d_arg</span>, <span class="ruby-identifier">flag_escape</span>)
391
- <span class="ruby-identifier">stmt_list</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">build_print_expr_stmt</span>(<span class="ruby-identifier">expr</span>, <span class="ruby-identifier">stag_info</span>, <span class="ruby-identifier">etag_info</span>)
395
+ <span class="ruby-identifier">stmt_list</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">build_print_expr_stmt</span>(<span class="ruby-identifier">expr</span>, <span class="ruby-identifier">arg</span>.<span class="ruby-identifier">stag_info</span>, <span class="ruby-identifier">arg</span>.<span class="ruby-identifier">etag_info</span>)
392
396
 
393
397
  <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:cont</span>, <span class="ruby-identifier">:Cont</span>, <span class="ruby-identifier">:CONT</span>, <span class="ruby-identifier">:value</span>, <span class="ruby-identifier">:Value</span>, <span class="ruby-identifier">:VALUE</span>
394
- <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>)
395
- <span class="ruby-identifier">stag_info</span>.<span class="ruby-identifier">tail_space</span> = <span class="ruby-identifier">etag_info</span>.<span class="ruby-identifier">head_space</span> = <span class="ruby-keyword kw">nil</span> <span class="ruby-comment cmt"># delete spaces</span>
396
- <span class="ruby-identifier">args</span> = <span class="ruby-identifier">build_print_args</span>(<span class="ruby-identifier">stag_info</span>, <span class="ruby-identifier">attr_info</span>, <span class="ruby-identifier">append_exprs</span>)
398
+ <span class="ruby-identifier">error_if_empty_tag</span>(<span class="ruby-identifier">arg</span>)
399
+ <span class="ruby-identifier">arg</span>.<span class="ruby-identifier">stag_info</span>.<span class="ruby-identifier">tail_space</span> = <span class="ruby-identifier">arg</span>.<span class="ruby-identifier">etag_info</span>.<span class="ruby-identifier">head_space</span> = <span class="ruby-keyword kw">nil</span> <span class="ruby-comment cmt"># delete spaces</span>
400
+ <span class="ruby-identifier">pargs</span> = <span class="ruby-identifier">build_print_args</span>(<span class="ruby-identifier">arg</span>.<span class="ruby-identifier">stag_info</span>, <span class="ruby-identifier">arg</span>.<span class="ruby-identifier">attr_info</span>, <span class="ruby-identifier">arg</span>.<span class="ruby-identifier">append_exprs</span>)
397
401
  <span class="ruby-identifier">flag_escape</span> = (<span class="ruby-identifier">d_name</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:cont</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">d_name</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:value</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">:Cont</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">d_name</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:Value</span>)
398
- <span class="ruby-identifier">args</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">NativeExpression</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">d_arg</span>, <span class="ruby-identifier">flag_escape</span>)
399
- <span class="ruby-comment cmt">#args &lt;&lt; etag_info.tag_text</span>
400
- <span class="ruby-identifier">args</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">etag_info</span>.<span class="ruby-identifier">tag_text</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">etag_info</span>.<span class="ruby-identifier">tagname</span>
401
- <span class="ruby-identifier">stmt_list</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">PrintStatement</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">args</span>)
402
+ <span class="ruby-identifier">pargs</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">NativeExpression</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">d_arg</span>, <span class="ruby-identifier">flag_escape</span>)
403
+ <span class="ruby-identifier">pargs</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">arg</span>.<span class="ruby-identifier">etag_info</span>.<span class="ruby-identifier">tag_text</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">arg</span>.<span class="ruby-identifier">etag_info</span>.<span class="ruby-identifier">tagname</span>
404
+ <span class="ruby-identifier">stmt_list</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">PrintStatement</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">pargs</span>)
402
405
 
403
406
  <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:attr</span>, <span class="ruby-identifier">:Attr</span>, <span class="ruby-identifier">:ATTR</span>
404
407
  <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">d_arg</span> <span class="ruby-operator">=~</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">mapping_pattern</span>() <span class="ruby-comment cmt"># ex. /\A'([-:\w]+)'\s+(.*)\z/</span>
405
- <span class="ruby-identifier">raise</span> <span class="ruby-identifier">convert_error</span>(<span class="ruby-node">&quot;'#{d_str}': invalid attr pattern.&quot;</span>, <span class="ruby-identifier">stag_info</span>.<span class="ruby-identifier">linenum</span>)
408
+ <span class="ruby-identifier">raise</span> <span class="ruby-identifier">convert_error</span>(<span class="ruby-node">&quot;'#{d_str}': invalid attr pattern.&quot;</span>, <span class="ruby-identifier">arg</span>.<span class="ruby-identifier">stag_info</span>.<span class="ruby-identifier">linenum</span>)
406
409
  <span class="ruby-keyword kw">end</span>
407
410
  <span class="ruby-identifier">aname</span> = <span class="ruby-identifier">$1</span>; <span class="ruby-identifier">avalue</span> = <span class="ruby-identifier">$2</span>
408
411
  <span class="ruby-identifier">flag_escape</span> = <span class="ruby-identifier">d_name</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:attr</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">:Attr</span>)
409
- <span class="ruby-identifier">attr_info</span>[<span class="ruby-identifier">aname</span>] = <span class="ruby-constant">NativeExpression</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">avalue</span>, <span class="ruby-identifier">flag_escape</span>)
412
+ <span class="ruby-identifier">arg</span>.<span class="ruby-identifier">attr_info</span>[<span class="ruby-identifier">aname</span>] = <span class="ruby-constant">NativeExpression</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">avalue</span>, <span class="ruby-identifier">flag_escape</span>)
410
413
 
411
414
  <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:append</span>, <span class="ruby-identifier">:Append</span>, <span class="ruby-identifier">:APPEND</span>
412
415
  <span class="ruby-identifier">flag_escape</span> = <span class="ruby-identifier">d_name</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:append</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">:Append</span>)
413
- <span class="ruby-identifier">append_exprs</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">NativeExpression</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">d_arg</span>, <span class="ruby-identifier">flag_escape</span>)
416
+ <span class="ruby-identifier">arg</span>.<span class="ruby-identifier">append_exprs</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">NativeExpression</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">d_arg</span>, <span class="ruby-identifier">flag_escape</span>)
414
417
 
415
418
  <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:replace_element_with_element</span>, <span class="ruby-identifier">:replace_element_with_content</span>,
416
419
  <span class="ruby-identifier">:replace_content_with_element</span>, <span class="ruby-identifier">:replace_content_with_content</span>
@@ -419,15 +422,15 @@ return true if directive name is one of &#8216;stag&#8217;,
419
422
  <span class="ruby-identifier">with_content</span> = <span class="ruby-identifier">arr</span>[<span class="ruby-value">3</span>] <span class="ruby-operator">==</span> <span class="ruby-value str">'content'</span>
420
423
  <span class="ruby-identifier">name</span> = <span class="ruby-identifier">d_arg</span>
421
424
  <span class="ruby-comment cmt">#</span>
422
- <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>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">replace_cont</span>
423
- <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">replace_cont</span>
425
+ <span class="ruby-identifier">error_if_empty_tag</span>(<span class="ruby-identifier">arg</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">replace_cont</span>
426
+ <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>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">replace_cont</span>
424
427
  <span class="ruby-comment cmt">#stmt_list &lt;&lt; ExpandStatement.new(:element, name)</span>
425
428
  <span class="ruby-identifier">elem_info</span> = <span class="ruby-ivar">@elem_info_table</span>[<span class="ruby-identifier">name</span>]
426
429
  <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">elem_info</span>
427
- <span class="ruby-identifier">raise</span> <span class="ruby-identifier">convert_error</span>(<span class="ruby-node">&quot;'#{d_str}': element '#{name}' not found.&quot;</span>, <span class="ruby-identifier">stag_info</span>.<span class="ruby-identifier">linenum</span>)
430
+ <span class="ruby-identifier">raise</span> <span class="ruby-identifier">convert_error</span>(<span class="ruby-node">&quot;'#{d_str}': element '#{name}' not found.&quot;</span>, <span class="ruby-identifier">arg</span>.<span class="ruby-identifier">stag_info</span>.<span class="ruby-identifier">linenum</span>)
428
431
  <span class="ruby-keyword kw">end</span>
429
432
  <span class="ruby-identifier">expand_element_info</span>(<span class="ruby-identifier">elem_info</span>, <span class="ruby-identifier">stmt_list</span>, <span class="ruby-identifier">with_content</span>)
430
- <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">replace_cont</span>
433
+ <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>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">replace_cont</span>
431
434
 
432
435
  <span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:replace_element_with</span>, <span class="ruby-identifier">:replace_content_with</span>, <span class="ruby-identifier">:replace</span>, <span class="ruby-identifier">:placeholder</span>
433
436
  <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_?(element|content)\([&quot;']?(\w+)[&quot;']?\)\z/</span>
@@ -438,15 +441,17 @@ return true if directive name is one of &#8216;stag&#8217;,
438
441
  <span class="ruby-identifier">replace_cont</span> = <span class="ruby-identifier">d_name</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:replace_content_with</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">d_name</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:placeholder</span>
439
442
  <span class="ruby-identifier">with_content</span> = <span class="ruby-identifier">kind</span> <span class="ruby-operator">==</span> <span class="ruby-value str">'content'</span>
440
443
  <span class="ruby-comment cmt">#</span>
441
- <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>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">replace_cont</span>
442
- <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">replace_cont</span>
444
+ <span class="ruby-identifier">error_if_empty_tag</span>(<span class="ruby-identifier">arg</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">replace_cont</span>
445
+ <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>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">replace_cont</span>
443
446
  <span class="ruby-comment cmt">#stmt_list &lt;&lt; ExpandStatement.new(:element, name)</span>
444
447
  <span class="ruby-identifier">elem_info</span> = <span class="ruby-ivar">@elem_info_table</span>[<span class="ruby-identifier">name</span>]
445
448
  <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">elem_info</span>
446
- <span class="ruby-identifier">raise</span> <span class="ruby-identifier">convert_error</span>(<span class="ruby-node">&quot;'#{d_str}': element '#{name}' not found.&quot;</span>, <span class="ruby-identifier">stag_info</span>.<span class="ruby-identifier">linenum</span>)
449
+ <span class="ruby-identifier">msg</span> = <span class="ruby-node">&quot;'#{d_str}': element '#{name}' not found.&quot;</span>
450
+ <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>)
447
451
  <span class="ruby-keyword kw">end</span>
448
452
  <span class="ruby-identifier">expand_element_info</span>(<span class="ruby-identifier">elem_info</span>, <span class="ruby-identifier">stmt_list</span>, <span class="ruby-identifier">with_content</span>)
449
- <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">replace_cont</span>
453
+ <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>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">replace_cont</span>
454
+
450
455
  <span class="ruby-keyword kw">else</span>
451
456
  <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span>
452
457
  <span class="ruby-keyword kw">end</span> <span class="ruby-comment cmt">#case</span>
@@ -461,24 +466,24 @@ return true if directive name is one of &#8216;stag&#8217;,
461
466
 
462
467
  <h3 class="section-bar">Protected Instance methods</h3>
463
468
 
464
- <div id="method-M000180" class="method-detail">
465
- <a name="M000180"></a>
469
+ <div id="method-M000232" class="method-detail">
470
+ <a name="M000232"></a>
466
471
 
467
472
  <div class="method-heading">
468
- <a href="#M000180" class="method-signature">
473
+ <a href="#M000232" class="method-signature">
469
474
  <span class="method-name">directive_format</span><span class="method-args">()</span>
470
475
  </a>
471
476
  </div>
472
477
 
473
478
  <div class="method-description">
474
479
  <p>
475
- .[abstract] directive format, which is used at has_directive?() method
480
+ (abstract) directive format, which is used at has_directive?() method
476
481
  </p>
477
482
  <p><a class="source-toggle" href="#"
478
- onclick="toggleCode('M000180-source');return false;">[Source]</a></p>
479
- <div class="method-source-code" id="M000180-source">
483
+ onclick="toggleCode('M000232-source');return false;">[Source]</a></p>
484
+ <div class="method-source-code" id="M000232-source">
480
485
  <pre>
481
- <span class="ruby-comment cmt"># File kwartz/converter.rb, line 490</span>
486
+ <span class="ruby-comment cmt"># File kwartz/converter.rb, line 644</span>
482
487
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">directive_format</span>
483
488
  <span class="ruby-identifier">not_implemented</span>
484
489
  <span class="ruby-comment cmt">#return '%s: %s'</span>
@@ -488,24 +493,24 @@ return true if directive name is one of &#8216;stag&#8217;,
488
493
  </div>
489
494
  </div>
490
495
 
491
- <div id="method-M000178" class="method-detail">
492
- <a name="M000178"></a>
496
+ <div id="method-M000230" class="method-detail">
497
+ <a name="M000230"></a>
493
498
 
494
499
  <div class="method-heading">
495
- <a href="#M000178" class="method-signature">
500
+ <a href="#M000230" class="method-signature">
496
501
  <span class="method-name">directive_pattern</span><span class="method-args">()</span>
497
502
  </a>
498
503
  </div>
499
504
 
500
505
  <div class="method-description">
501
506
  <p>
502
- .[abstract] directive pattern, which is used to detect directives.
507
+ (abstract) directive pattern, which is used to detect directives.
503
508
  </p>
504
509
  <p><a class="source-toggle" href="#"
505
- onclick="toggleCode('M000178-source');return false;">[Source]</a></p>
506
- <div class="method-source-code" id="M000178-source">
510
+ onclick="toggleCode('M000230-source');return false;">[Source]</a></p>
511
+ <div class="method-source-code" id="M000230-source">
507
512
  <pre>
508
- <span class="ruby-comment cmt"># File kwartz/converter.rb, line 476</span>
513
+ <span class="ruby-comment cmt"># File kwartz/converter.rb, line 630</span>
509
514
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">directive_pattern</span>
510
515
  <span class="ruby-identifier">not_implemented</span>
511
516
  <span class="ruby-comment cmt">#return /\A(\w+):\s*(.*)/</span>
@@ -515,25 +520,25 @@ return true if directive name is one of &#8216;stag&#8217;,
515
520
  </div>
516
521
  </div>
517
522
 
518
- <div id="method-M000179" class="method-detail">
519
- <a name="M000179"></a>
523
+ <div id="method-M000231" class="method-detail">
524
+ <a name="M000231"></a>
520
525
 
521
526
  <div class="method-heading">
522
- <a href="#M000179" class="method-signature">
527
+ <a href="#M000231" class="method-signature">
523
528
  <span class="method-name">mapping_pattern</span><span class="method-args">()</span>
524
529
  </a>
525
530
  </div>
526
531
 
527
532
  <div class="method-description">
528
533
  <p>
529
- .[abstract] mapping pattern, which is used to parse &#8216;attr&#8217;
534
+ (abstract) mapping pattern, which is used to parse &#8216;attr&#8217;
530
535
  directive.
531
536
  </p>
532
537
  <p><a class="source-toggle" href="#"
533
- onclick="toggleCode('M000179-source');return false;">[Source]</a></p>
534
- <div class="method-source-code" id="M000179-source">
538
+ onclick="toggleCode('M000231-source');return false;">[Source]</a></p>
539
+ <div class="method-source-code" id="M000231-source">
535
540
  <pre>
536
- <span class="ruby-comment cmt"># File kwartz/converter.rb, line 483</span>
541
+ <span class="ruby-comment cmt"># File kwartz/converter.rb, line 637</span>
537
542
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">mapping_pattern</span>
538
543
  <span class="ruby-identifier">not_implemented</span>
539
544
  <span class="ruby-comment cmt">#return /\A'([-:\w]+)'\s+(.*)/</span>