kwartz 3.0.0 → 3.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog +36 -1
- data/LGPL +504 -0
- data/README.txt +16 -2
- data/bin/kwartz +1 -1
- data/doc-api/classes/Kwartz.html +47 -1
- data/doc-api/classes/Kwartz/Assertion.html +6 -6
- data/doc-api/classes/Kwartz/AssertionError.html +6 -6
- data/doc-api/classes/Kwartz/AttrInfo.html +42 -42
- data/doc-api/classes/Kwartz/BaseError.html +12 -12
- data/doc-api/classes/Kwartz/BaseTranslator.html +210 -43
- data/doc-api/classes/Kwartz/CharacterType.html +24 -24
- data/doc-api/classes/Kwartz/CommandOptionError.html +7 -7
- data/doc-api/classes/Kwartz/CommandOptions.html +49 -49
- data/doc-api/classes/Kwartz/Config.html +6 -1
- data/doc-api/classes/Kwartz/ConvertError.html +14 -14
- data/doc-api/classes/Kwartz/Converter.html +31 -30
- data/doc-api/classes/Kwartz/CssStyleParser.html +79 -57
- data/doc-api/classes/Kwartz/Defun.html +313 -0
- data/doc-api/classes/Kwartz/DocumentRuleset.html +58 -58
- data/doc-api/classes/Kwartz/ElementExpander.html +32 -32
- data/doc-api/classes/Kwartz/ElementInfo.html +29 -29
- data/doc-api/classes/Kwartz/ElementRuleset.html +126 -96
- data/doc-api/classes/Kwartz/EperlHandler.html +108 -84
- data/doc-api/classes/Kwartz/EperlTranslator.html +7 -7
- data/doc-api/classes/Kwartz/ErubisHandler.html +2 -2
- data/doc-api/classes/Kwartz/ErubisTranslator.html +8 -8
- data/doc-api/classes/Kwartz/ErubyHandler.html +2 -220
- data/doc-api/classes/Kwartz/ErubyTranslator.html +7 -7
- data/doc-api/classes/Kwartz/ExpandStatement.html +20 -20
- data/doc-api/classes/Kwartz/Handler.html +122 -117
- data/doc-api/classes/Kwartz/HandlerArgument.html +215 -0
- data/doc-api/classes/Kwartz/Helper.html +112 -0
- data/doc-api/classes/Kwartz/Helper/ActionViewHelper.html +221 -0
- data/doc-api/classes/Kwartz/Helper/RailsTemplate.html +630 -0
- data/doc-api/classes/Kwartz/JstlHandler.html +208 -193
- data/doc-api/classes/Kwartz/JstlTranslator.html +15 -15
- data/doc-api/classes/Kwartz/KwartzError.html +6 -6
- data/doc-api/classes/Kwartz/Main.html +39 -23
- data/doc-api/classes/Kwartz/NativeExpression.html +18 -18
- data/doc-api/classes/Kwartz/NativeStatement.html +25 -25
- data/doc-api/classes/Kwartz/Node.html +6 -6
- data/doc-api/classes/Kwartz/PIErubisHandler.html +113 -0
- data/doc-api/classes/Kwartz/PIErubisTranslator.html +200 -0
- data/doc-api/classes/Kwartz/ParseError.html +6 -6
- data/doc-api/classes/Kwartz/PhpHandler.html +102 -83
- data/doc-api/classes/Kwartz/PhpTranslator.html +14 -14
- data/doc-api/classes/Kwartz/PresentationLogicParser.html +136 -128
- data/doc-api/classes/Kwartz/PrintStatement.html +19 -19
- data/doc-api/classes/Kwartz/RailsHandler.html +121 -118
- data/doc-api/classes/Kwartz/RailsTranslator.html +7 -7
- data/doc-api/classes/Kwartz/RubyHandler.html +349 -0
- data/doc-api/classes/Kwartz/RubyStyleParser.html +85 -85
- data/doc-api/classes/Kwartz/RubyTranslator.html +218 -0
- data/doc-api/classes/Kwartz/StatementHelper.html +479 -0
- data/doc-api/classes/Kwartz/StrutsTranslator.html +12 -12
- data/doc-api/classes/Kwartz/TagInfo.html +28 -28
- data/doc-api/classes/Kwartz/TextConverter.html +28 -28
- data/doc-api/classes/Kwartz/Translator.html +42 -42
- data/doc-api/classes/Kwartz/Util.html +284 -0
- data/doc-api/created.rid +1 -1
- data/doc-api/files/__/README_txt.html +30 -3
- data/doc-api/files/kwartz/assert_rb.html +1 -1
- data/doc-api/files/kwartz/binding/eperl_rb.html +2 -2
- data/doc-api/files/kwartz/binding/erubis_rb.html +3 -3
- data/doc-api/files/kwartz/binding/eruby_rb.html +3 -2
- data/doc-api/files/kwartz/binding/jstl_rb.html +2 -2
- data/doc-api/files/kwartz/binding/php_rb.html +2 -2
- data/doc-api/files/kwartz/binding/pierubis_rb.html +116 -0
- data/doc-api/files/kwartz/binding/rails_rb.html +2 -2
- data/doc-api/files/kwartz/binding/ruby_rb.html +115 -0
- data/doc-api/files/kwartz/binding/struts_rb.html +1 -1
- data/doc-api/files/kwartz/config_rb.html +2 -2
- data/doc-api/files/kwartz/converter_rb.html +3 -2
- data/doc-api/files/kwartz/defun_rb.html +116 -0
- data/doc-api/files/kwartz/error_rb.html +1 -1
- data/doc-api/files/kwartz/helper/rails_rb.html +123 -0
- data/doc-api/files/kwartz/main_rb.html +5 -2
- data/doc-api/files/kwartz/node_rb.html +2 -2
- data/doc-api/files/kwartz/parser_rb.html +2 -2
- data/doc-api/files/kwartz/translator_rb.html +2 -2
- data/doc-api/files/kwartz/util/assert-text-equal_rb.html +1 -1
- data/doc-api/files/kwartz/util/testcase-helper_rb.html +2 -2
- data/doc-api/files/kwartz/util_rb.html +107 -0
- data/doc-api/files/kwartz_rb.html +3 -2
- data/doc-api/fr_class_index.html +11 -0
- data/doc-api/fr_file_index.html +5 -0
- data/doc-api/fr_method_index.html +242 -190
- data/doc/p-pattern.html +94 -94
- data/doc/reference.html +847 -612
- data/doc/users-guide.html +744 -241
- data/examples/rails1/README +2 -2
- data/examples/rails1/application_helper.rb +2 -27
- data/examples/rails1/link_to.plogic +5 -5
- data/examples/rails1/list.plogic +2 -2
- data/examples/rails2/app/controllers/application.rb +14 -0
- data/examples/rails2/app/controllers/groups_controller.rb +47 -0
- data/examples/rails2/app/controllers/members_controller.rb +56 -0
- data/examples/rails2/app/helpers/application_helper.rb +6 -0
- data/examples/rails2/app/helpers/groups_helper.rb +2 -0
- data/examples/rails2/app/helpers/members_helper.rb +2 -0
- data/examples/rails2/app/models/group.rb +2 -0
- data/examples/rails2/app/models/member.rb +3 -0
- data/examples/rails2/app/views/groups/_form.html +30 -0
- data/examples/rails2/app/views/groups/_form.plogic +11 -0
- data/examples/rails2/app/views/groups/_link.plogic +19 -0
- data/examples/rails2/app/views/groups/_read.plogic +7 -0
- data/examples/rails2/app/views/groups/edit.cfg.yaml +2 -0
- data/examples/rails2/app/views/groups/edit.html +26 -0
- data/examples/rails2/app/views/groups/edit.plogic +9 -0
- data/examples/rails2/app/views/groups/list.html +48 -0
- data/examples/rails2/app/views/groups/list.plogic +32 -0
- data/examples/rails2/app/views/groups/new.cfg.yaml +2 -0
- data/examples/rails2/app/views/groups/new.html +27 -0
- data/examples/rails2/app/views/groups/new.plogic +9 -0
- data/examples/rails2/app/views/groups/show.html +27 -0
- data/examples/rails2/app/views/groups/show.plogic +2 -0
- data/examples/rails2/app/views/layouts/groups.html +23 -0
- data/examples/rails2/app/views/layouts/groups.plogic +11 -0
- data/examples/rails2/app/views/layouts/members.html +23 -0
- data/examples/rails2/app/views/layouts/members.plogic +11 -0
- data/examples/rails2/app/views/layouts/members2.html +24 -0
- data/examples/rails2/app/views/layouts/members2.plogic +11 -0
- data/examples/rails2/app/views/members/_form.plogic +27 -0
- data/examples/rails2/app/views/members/_link.plogic +19 -0
- data/examples/rails2/app/views/members/_read.plogic +29 -0
- data/examples/rails2/app/views/members/edit.cfg.yaml +6 -0
- data/examples/rails2/app/views/members/edit.html +27 -0
- data/examples/rails2/app/views/members/edit.plogic +10 -0
- data/examples/rails2/app/views/members/list.html +53 -0
- data/examples/rails2/app/views/members/list.plogic +32 -0
- data/examples/rails2/app/views/members/new.html +61 -0
- data/examples/rails2/app/views/members/new.plogic +17 -0
- data/examples/rails2/app/views/members/show.html +41 -0
- data/examples/rails2/app/views/members/show.plogic +3 -0
- data/examples/rails2/db/create-tables.mysql.sql +27 -0
- data/examples/rails2/db/create-tables.pgsql.sql +27 -0
- data/examples/rails2/db/insert-data.sql +21 -0
- data/examples/rails2/db/tabledef.yaml +51 -0
- data/kwartz.gemspec +4 -4
- data/lib/kwartz.rb +10 -2
- data/lib/kwartz/assert.rb +1 -1
- data/lib/kwartz/binding/eperl.rb +85 -61
- data/lib/kwartz/binding/erubis.rb +6 -8
- data/lib/kwartz/binding/eruby.rb +5 -120
- data/lib/kwartz/binding/jstl.rb +116 -101
- data/lib/kwartz/binding/php.rb +79 -60
- data/lib/kwartz/binding/pierubis.rb +58 -0
- data/lib/kwartz/binding/rails.rb +45 -42
- data/lib/kwartz/binding/ruby.rb +193 -0
- data/lib/kwartz/binding/struts.rb +1 -1
- data/lib/kwartz/config.rb +4 -3
- data/lib/kwartz/converter.rb +231 -68
- data/lib/kwartz/defun.rb +126 -0
- data/lib/kwartz/error.rb +1 -1
- data/lib/kwartz/helper/rails.rb +437 -0
- data/lib/kwartz/main.rb +30 -38
- data/lib/kwartz/node.rb +46 -31
- data/lib/kwartz/parser.rb +43 -15
- data/lib/kwartz/translator.rb +104 -6
- data/lib/kwartz/util.rb +113 -0
- data/lib/kwartz/util/assert-text-equal.rb +1 -1
- data/lib/kwartz/util/testcase-helper.rb +26 -8
- data/test/test-compile.rb +3 -3
- data/test/test-compile.yaml +135 -5
- data/test/test-converter.rb +16 -8
- data/test/test-converter.yaml +307 -76
- data/test/test-directives.rb +1 -1
- data/test/test-directives.yaml +964 -979
- data/test/test-main.rb +61 -146
- data/test/test-main.yaml +235 -0
- data/test/test-parser.rb +10 -12
- data/test/test-parser.yaml +484 -326
- data/test/test-rails.rb +1 -1
- data/test/test-rails.yaml +37 -37
- data/test/test-ruleset.rb +1 -1
- data/test/test-ruleset.yaml +34 -40
- data/test/test.rb +1 -1
- metadata +82 -3
- data/COPYING +0 -340
@@ -80,7 +80,7 @@
|
|
80
80
|
|
81
81
|
<div id="description">
|
82
82
|
<p>
|
83
|
-
|
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="#
|
96
|
-
<a href="#
|
97
|
-
<a href="#
|
98
|
-
<a href="#
|
99
|
-
<a href="#
|
100
|
-
<a href="#
|
101
|
-
<a href="#
|
102
|
-
<a href="#
|
103
|
-
<a href="#
|
104
|
-
<a href="#
|
95
|
+
<a href="#M000232">directive_format</a>
|
96
|
+
<a href="#M000230">directive_pattern</a>
|
97
|
+
<a href="#M000234">extract</a>
|
98
|
+
<a href="#M000236">get_class</a>
|
99
|
+
<a href="#M000229">get_element_info</a>
|
100
|
+
<a href="#M000228">get_element_ruleset</a>
|
101
|
+
<a href="#M000233">handle</a>
|
102
|
+
<a href="#M000231">mapping_pattern</a>
|
103
|
+
<a href="#M000227">new</a>
|
104
|
+
<a href="#M000235">register_class</a>
|
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-
|
164
|
-
<a name="
|
164
|
+
<div id="method-M000236" class="method-detail">
|
165
|
+
<a name="M000236"></a>
|
165
166
|
|
166
167
|
<div class="method-heading">
|
167
|
-
<a href="#
|
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('
|
175
|
-
<div class="method-source-code" id="
|
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
|
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-
|
187
|
-
<a name="
|
187
|
+
<div id="method-M000227" class="method-detail">
|
188
|
+
<a name="M000227"></a>
|
188
189
|
|
189
190
|
<div class="method-heading">
|
190
|
-
<a href="#
|
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('
|
198
|
-
<div class="method-source-code" id="
|
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
|
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-
|
217
|
-
<a name="
|
217
|
+
<div id="method-M000235" class="method-detail">
|
218
|
+
<a name="M000235"></a>
|
218
219
|
|
219
220
|
<div class="method-heading">
|
220
|
-
<a href="#
|
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('
|
228
|
-
<div class="method-source-code" id="
|
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
|
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-
|
242
|
-
<a name="
|
242
|
+
<div id="method-M000234" class="method-detail">
|
243
|
+
<a name="M000234"></a>
|
243
244
|
|
244
245
|
<div class="method-heading">
|
245
|
-
<a href="#
|
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('
|
253
|
-
<div class="method-source-code" id="
|
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
|
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">"element '#{elem_name}' not found."</span>, <span class="ruby-keyword kw">nil</span>)
|
@@ -266,58 +267,58 @@
|
|
266
267
|
</div>
|
267
268
|
</div>
|
268
269
|
|
269
|
-
<div id="method-
|
270
|
-
<a name="
|
270
|
+
<div id="method-M000229" class="method-detail">
|
271
|
+
<a name="M000229"></a>
|
271
272
|
|
272
273
|
<div class="method-heading">
|
273
|
-
<a href="#
|
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('
|
281
|
-
<div class="method-source-code" id="
|
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
|
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-
|
293
|
-
<a name="
|
293
|
+
<div id="method-M000228" class="method-detail">
|
294
|
+
<a name="M000228"></a>
|
294
295
|
|
295
296
|
<div class="method-heading">
|
296
|
-
<a href="#
|
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('
|
304
|
-
<div class="method-source-code" id="
|
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
|
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-
|
316
|
-
<a name="
|
316
|
+
<div id="method-M000233" class="method-detail">
|
317
|
+
<a name="M000233"></a>
|
317
318
|
|
318
319
|
<div class="method-heading">
|
319
|
-
<a href="#
|
320
|
-
<span class="method-name">handle</span><span class="method-args">(
|
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 ‘stag’,
|
|
332
333
|
‘value’, else return false.
|
333
334
|
</p>
|
334
335
|
<p><a class="source-toggle" href="#"
|
335
|
-
onclick="toggleCode('
|
336
|
-
<div class="method-source-code" id="
|
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
|
339
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">handle</span>(<span class="ruby-identifier">
|
340
|
-
<span class="ruby-identifier">
|
341
|
-
<span class="ruby-identifier">
|
342
|
-
<span class="ruby-identifier">
|
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">
|
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"><<</span> <span class="ruby-identifier">
|
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"><<</span> <span class="ruby-identifier">
|
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"><<</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"><<</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">
|
357
|
-
<span class="ruby-identifier">raise</span> <span class="ruby-identifier">convert_error</span>(<span class="ruby-node">"'#{d_str}': invalid marking name."</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">"'#{d_str}': invalid marking name."</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">
|
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">
|
367
|
+
<span class="ruby-identifier">msg</span> = <span class="ruby-node">"'#{d_str}': id '#{name}' is already used at line #{previous_linenum}."</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 ‘stag’,
|
|
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">
|
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"><<</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"><<</span> <span class="ruby-identifier">
|
380
|
+
<span class="ruby-identifier">stmt_list</span> <span class="ruby-operator"><<</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"><<</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">
|
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"><<</span> <span class="ruby-identifier">
|
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"><<</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"><<</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"><<</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"><<</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"><<</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">
|
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">
|
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">
|
399
|
-
<span class="ruby-
|
400
|
-
<span class="ruby-identifier">
|
401
|
-
<span class="ruby-identifier">stmt_list</span> <span class="ruby-operator"><<</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"><<</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"><<</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"><<</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">"'#{d_str}': invalid attr pattern."</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">"'#{d_str}': invalid attr pattern."</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"><<</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"><<</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 ‘stag’,
|
|
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">
|
423
|
-
<span class="ruby-identifier">stmt_list</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">
|
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"><<</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 << 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">"'#{d_str}': element '#{name}' not found."</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">"'#{d_str}': element '#{name}' not found."</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"><<</span> <span class="ruby-identifier">
|
433
|
+
<span class="ruby-identifier">stmt_list</span> <span class="ruby-operator"><<</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)\(["']?(\w+)["']?\)\z/</span>
|
@@ -438,15 +441,17 @@ return true if directive name is one of ‘stag’,
|
|
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">
|
442
|
-
<span class="ruby-identifier">stmt_list</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">
|
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"><<</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 << 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">
|
449
|
+
<span class="ruby-identifier">msg</span> = <span class="ruby-node">"'#{d_str}': element '#{name}' not found."</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"><<</span> <span class="ruby-identifier">
|
453
|
+
<span class="ruby-identifier">stmt_list</span> <span class="ruby-operator"><<</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 ‘stag’,
|
|
461
466
|
|
462
467
|
<h3 class="section-bar">Protected Instance methods</h3>
|
463
468
|
|
464
|
-
<div id="method-
|
465
|
-
<a name="
|
469
|
+
<div id="method-M000232" class="method-detail">
|
470
|
+
<a name="M000232"></a>
|
466
471
|
|
467
472
|
<div class="method-heading">
|
468
|
-
<a href="#
|
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
|
-
|
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('
|
479
|
-
<div class="method-source-code" id="
|
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
|
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 ‘stag’,
|
|
488
493
|
</div>
|
489
494
|
</div>
|
490
495
|
|
491
|
-
<div id="method-
|
492
|
-
<a name="
|
496
|
+
<div id="method-M000230" class="method-detail">
|
497
|
+
<a name="M000230"></a>
|
493
498
|
|
494
499
|
<div class="method-heading">
|
495
|
-
<a href="#
|
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
|
-
|
507
|
+
(abstract) directive pattern, which is used to detect directives.
|
503
508
|
</p>
|
504
509
|
<p><a class="source-toggle" href="#"
|
505
|
-
onclick="toggleCode('
|
506
|
-
<div class="method-source-code" id="
|
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
|
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 ‘stag’,
|
|
515
520
|
</div>
|
516
521
|
</div>
|
517
522
|
|
518
|
-
<div id="method-
|
519
|
-
<a name="
|
523
|
+
<div id="method-M000231" class="method-detail">
|
524
|
+
<a name="M000231"></a>
|
520
525
|
|
521
526
|
<div class="method-heading">
|
522
|
-
<a href="#
|
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
|
-
|
534
|
+
(abstract) mapping pattern, which is used to parse ‘attr’
|
530
535
|
directive.
|
531
536
|
</p>
|
532
537
|
<p><a class="source-toggle" href="#"
|
533
|
-
onclick="toggleCode('
|
534
|
-
<div class="method-source-code" id="
|
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
|
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>
|