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
@@ -0,0 +1,113 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
+
<head>
|
8
|
+
<title>Class: Kwartz::PIErubisHandler</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
+
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
12
|
+
<script type="text/javascript">
|
13
|
+
// <![CDATA[
|
14
|
+
|
15
|
+
function popupCode( url ) {
|
16
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
+
}
|
18
|
+
|
19
|
+
function toggleCode( id ) {
|
20
|
+
if ( document.getElementById )
|
21
|
+
elem = document.getElementById( id );
|
22
|
+
else if ( document.all )
|
23
|
+
elem = eval( "document.all." + id );
|
24
|
+
else
|
25
|
+
return false;
|
26
|
+
|
27
|
+
elemStyle = elem.style;
|
28
|
+
|
29
|
+
if ( elemStyle.display != "block" ) {
|
30
|
+
elemStyle.display = "block"
|
31
|
+
} else {
|
32
|
+
elemStyle.display = "none"
|
33
|
+
}
|
34
|
+
|
35
|
+
return true;
|
36
|
+
}
|
37
|
+
|
38
|
+
// Make codeblocks hidden by default
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
+
|
41
|
+
// ]]>
|
42
|
+
</script>
|
43
|
+
|
44
|
+
</head>
|
45
|
+
<body>
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
<div id="classHeader">
|
50
|
+
<table class="header-table">
|
51
|
+
<tr class="top-aligned-row">
|
52
|
+
<td><strong>Class</strong></td>
|
53
|
+
<td class="class-name-in-header">Kwartz::PIErubisHandler</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../../files/kwartz/binding/pierubis_rb.html">
|
59
|
+
kwartz/binding/pierubis.rb
|
60
|
+
</a>
|
61
|
+
<br />
|
62
|
+
</td>
|
63
|
+
</tr>
|
64
|
+
|
65
|
+
<tr class="top-aligned-row">
|
66
|
+
<td><strong>Parent:</strong></td>
|
67
|
+
<td>
|
68
|
+
<a href="RubyHandler.html">
|
69
|
+
RubyHandler
|
70
|
+
</a>
|
71
|
+
</td>
|
72
|
+
</tr>
|
73
|
+
</table>
|
74
|
+
</div>
|
75
|
+
<!-- banner header -->
|
76
|
+
|
77
|
+
<div id="bodyContent">
|
78
|
+
|
79
|
+
|
80
|
+
|
81
|
+
<div id="contextContent">
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
</div>
|
86
|
+
|
87
|
+
|
88
|
+
</div>
|
89
|
+
|
90
|
+
|
91
|
+
<!-- if includes -->
|
92
|
+
|
93
|
+
<div id="section">
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
+
|
102
|
+
<!-- if method_list -->
|
103
|
+
|
104
|
+
|
105
|
+
</div>
|
106
|
+
|
107
|
+
|
108
|
+
<div id="validator-badges">
|
109
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
110
|
+
</div>
|
111
|
+
|
112
|
+
</body>
|
113
|
+
</html>
|
@@ -0,0 +1,200 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
+
<head>
|
8
|
+
<title>Class: Kwartz::PIErubisTranslator</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
+
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
12
|
+
<script type="text/javascript">
|
13
|
+
// <![CDATA[
|
14
|
+
|
15
|
+
function popupCode( url ) {
|
16
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
+
}
|
18
|
+
|
19
|
+
function toggleCode( id ) {
|
20
|
+
if ( document.getElementById )
|
21
|
+
elem = document.getElementById( id );
|
22
|
+
else if ( document.all )
|
23
|
+
elem = eval( "document.all." + id );
|
24
|
+
else
|
25
|
+
return false;
|
26
|
+
|
27
|
+
elemStyle = elem.style;
|
28
|
+
|
29
|
+
if ( elemStyle.display != "block" ) {
|
30
|
+
elemStyle.display = "block"
|
31
|
+
} else {
|
32
|
+
elemStyle.display = "none"
|
33
|
+
}
|
34
|
+
|
35
|
+
return true;
|
36
|
+
}
|
37
|
+
|
38
|
+
// Make codeblocks hidden by default
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
+
|
41
|
+
// ]]>
|
42
|
+
</script>
|
43
|
+
|
44
|
+
</head>
|
45
|
+
<body>
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
<div id="classHeader">
|
50
|
+
<table class="header-table">
|
51
|
+
<tr class="top-aligned-row">
|
52
|
+
<td><strong>Class</strong></td>
|
53
|
+
<td class="class-name-in-header">Kwartz::PIErubisTranslator</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../../files/kwartz/binding/pierubis_rb.html">
|
59
|
+
kwartz/binding/pierubis.rb
|
60
|
+
</a>
|
61
|
+
<br />
|
62
|
+
</td>
|
63
|
+
</tr>
|
64
|
+
|
65
|
+
<tr class="top-aligned-row">
|
66
|
+
<td><strong>Parent:</strong></td>
|
67
|
+
<td>
|
68
|
+
<a href="BaseTranslator.html">
|
69
|
+
BaseTranslator
|
70
|
+
</a>
|
71
|
+
</td>
|
72
|
+
</tr>
|
73
|
+
</table>
|
74
|
+
</div>
|
75
|
+
<!-- banner header -->
|
76
|
+
|
77
|
+
<div id="bodyContent">
|
78
|
+
|
79
|
+
|
80
|
+
|
81
|
+
<div id="contextContent">
|
82
|
+
|
83
|
+
<div id="description">
|
84
|
+
<p>
|
85
|
+
translator for Erubis
|
86
|
+
</p>
|
87
|
+
|
88
|
+
</div>
|
89
|
+
|
90
|
+
|
91
|
+
</div>
|
92
|
+
|
93
|
+
<div id="method-list">
|
94
|
+
<h3 class="section-bar">Methods</h3>
|
95
|
+
|
96
|
+
<div class="name-list">
|
97
|
+
<a href="#M000160">new</a>
|
98
|
+
<a href="#M000161">translate_native_expr</a>
|
99
|
+
</div>
|
100
|
+
</div>
|
101
|
+
|
102
|
+
</div>
|
103
|
+
|
104
|
+
|
105
|
+
<!-- if includes -->
|
106
|
+
|
107
|
+
<div id="section">
|
108
|
+
|
109
|
+
|
110
|
+
<div id="constants-list">
|
111
|
+
<h3 class="section-bar">Constants</h3>
|
112
|
+
|
113
|
+
<div class="name-list">
|
114
|
+
<table summary="Constants">
|
115
|
+
<tr class="top-aligned-row context-row">
|
116
|
+
<td class="context-item-name">PIERUBIS_EMBED_PATTERNS</td>
|
117
|
+
<td>=</td>
|
118
|
+
<td class="context-item-value">[ '<?rb ', ' ?>', # statement '@!{', '}@', # expression '@{', '}@', # escaped expression ]</td>
|
119
|
+
</tr>
|
120
|
+
</table>
|
121
|
+
</div>
|
122
|
+
</div>
|
123
|
+
|
124
|
+
|
125
|
+
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
<!-- if method_list -->
|
130
|
+
<div id="methods">
|
131
|
+
<h3 class="section-bar">Public Class methods</h3>
|
132
|
+
|
133
|
+
<div id="method-M000160" class="method-detail">
|
134
|
+
<a name="M000160"></a>
|
135
|
+
|
136
|
+
<div class="method-heading">
|
137
|
+
<a href="#M000160" class="method-signature">
|
138
|
+
<span class="method-name">new</span><span class="method-args">(properties={})</span>
|
139
|
+
</a>
|
140
|
+
</div>
|
141
|
+
|
142
|
+
<div class="method-description">
|
143
|
+
<p><a class="source-toggle" href="#"
|
144
|
+
onclick="toggleCode('M000160-source');return false;">[Source]</a></p>
|
145
|
+
<div class="method-source-code" id="M000160-source">
|
146
|
+
<pre>
|
147
|
+
<span class="ruby-comment cmt"># File kwartz/binding/pierubis.rb, line 36</span>
|
148
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">properties</span>={})
|
149
|
+
<span class="ruby-keyword kw">super</span>(<span class="ruby-constant">PIERUBIS_EMBED_PATTERNS</span>, <span class="ruby-identifier">properties</span>)
|
150
|
+
<span class="ruby-comment cmt">#@escape = true if @escape == nil</span>
|
151
|
+
<span class="ruby-keyword kw">end</span>
|
152
|
+
</pre>
|
153
|
+
</div>
|
154
|
+
</div>
|
155
|
+
</div>
|
156
|
+
|
157
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
158
|
+
|
159
|
+
<div id="method-M000161" class="method-detail">
|
160
|
+
<a name="M000161"></a>
|
161
|
+
|
162
|
+
<div class="method-heading">
|
163
|
+
<a href="#M000161" class="method-signature">
|
164
|
+
<span class="method-name">translate_native_expr</span><span class="method-args">(expr)</span>
|
165
|
+
</a>
|
166
|
+
</div>
|
167
|
+
|
168
|
+
<div class="method-description">
|
169
|
+
<p><a class="source-toggle" href="#"
|
170
|
+
onclick="toggleCode('M000161-source');return false;">[Source]</a></p>
|
171
|
+
<div class="method-source-code" id="M000161-source">
|
172
|
+
<pre>
|
173
|
+
<span class="ruby-comment cmt"># File kwartz/binding/pierubis.rb, line 42</span>
|
174
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">translate_native_expr</span>(<span class="ruby-identifier">expr</span>)
|
175
|
+
<span class="ruby-identifier">assert</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">expr</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">NativeExpression</span>)
|
176
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">expr</span>.<span class="ruby-identifier">code</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-value">?}</span>) <span class="ruby-operator">||</span> <span class="ruby-identifier">expr</span>.<span class="ruby-identifier">code</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-value">?></span>)
|
177
|
+
<span class="ruby-ivar">@expr_l</span>, <span class="ruby-ivar">@expr_r</span>, <span class="ruby-ivar">@escape_l</span>, <span class="ruby-ivar">@escape_r</span> = <span class="ruby-value str">'<%='</span>, <span class="ruby-value str">'%>'</span>, <span class="ruby-value str">'<%=='</span>, <span class="ruby-value str">'%>'</span>
|
178
|
+
<span class="ruby-keyword kw">else</span>
|
179
|
+
<span class="ruby-ivar">@expr_l</span>, <span class="ruby-ivar">@expr_r</span>, <span class="ruby-ivar">@escape_l</span>, <span class="ruby-ivar">@escape_r</span> = <span class="ruby-value str">'@!{'</span>, <span class="ruby-value str">'}@'</span>, <span class="ruby-value str">'@{'</span>, <span class="ruby-value str">'}@'</span>
|
180
|
+
<span class="ruby-keyword kw">end</span>
|
181
|
+
<span class="ruby-keyword kw">super</span>(<span class="ruby-identifier">expr</span>)
|
182
|
+
<span class="ruby-keyword kw">end</span>
|
183
|
+
</pre>
|
184
|
+
</div>
|
185
|
+
</div>
|
186
|
+
</div>
|
187
|
+
|
188
|
+
|
189
|
+
</div>
|
190
|
+
|
191
|
+
|
192
|
+
</div>
|
193
|
+
|
194
|
+
|
195
|
+
<div id="validator-badges">
|
196
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
197
|
+
</div>
|
198
|
+
|
199
|
+
</body>
|
200
|
+
</html>
|
@@ -88,7 +88,7 @@
|
|
88
88
|
<h3 class="section-bar">Methods</h3>
|
89
89
|
|
90
90
|
<div class="name-list">
|
91
|
-
<a href="#
|
91
|
+
<a href="#M000226">new</a>
|
92
92
|
</div>
|
93
93
|
</div>
|
94
94
|
|
@@ -110,19 +110,19 @@
|
|
110
110
|
<div id="methods">
|
111
111
|
<h3 class="section-bar">Public Class methods</h3>
|
112
112
|
|
113
|
-
<div id="method-
|
114
|
-
<a name="
|
113
|
+
<div id="method-M000226" class="method-detail">
|
114
|
+
<a name="M000226"></a>
|
115
115
|
|
116
116
|
<div class="method-heading">
|
117
|
-
<a href="#
|
117
|
+
<a href="#M000226" class="method-signature">
|
118
118
|
<span class="method-name">new</span><span class="method-args">(message, filename, linenum, column)</span>
|
119
119
|
</a>
|
120
120
|
</div>
|
121
121
|
|
122
122
|
<div class="method-description">
|
123
123
|
<p><a class="source-toggle" href="#"
|
124
|
-
onclick="toggleCode('
|
125
|
-
<div class="method-source-code" id="
|
124
|
+
onclick="toggleCode('M000226-source');return false;">[Source]</a></p>
|
125
|
+
<div class="method-source-code" id="M000226-source">
|
126
126
|
<pre>
|
127
127
|
<span class="ruby-comment cmt"># File kwartz/parser.rb, line 48</span>
|
128
128
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">message</span>, <span class="ruby-identifier">filename</span>, <span class="ruby-identifier">linenum</span>, <span class="ruby-identifier">column</span>)
|
@@ -94,10 +94,10 @@ directive handler for PHP
|
|
94
94
|
<h3 class="section-bar">Methods</h3>
|
95
95
|
|
96
96
|
<div class="name-list">
|
97
|
-
<a href="#
|
98
|
-
<a href="#
|
99
|
-
<a href="#
|
100
|
-
<a href="#
|
97
|
+
<a href="#M000061">directive_format</a>
|
98
|
+
<a href="#M000059">directive_pattern</a>
|
99
|
+
<a href="#M000062">handle</a>
|
100
|
+
<a href="#M000060">mapping_pattern</a>
|
101
101
|
</div>
|
102
102
|
</div>
|
103
103
|
|
@@ -142,19 +142,19 @@ directive handler for PHP
|
|
142
142
|
<div id="methods">
|
143
143
|
<h3 class="section-bar">Public Instance methods</h3>
|
144
144
|
|
145
|
-
<div id="method-
|
146
|
-
<a name="
|
145
|
+
<div id="method-M000061" class="method-detail">
|
146
|
+
<a name="M000061"></a>
|
147
147
|
|
148
148
|
<div class="method-heading">
|
149
|
-
<a href="#
|
149
|
+
<a href="#M000061" class="method-signature">
|
150
150
|
<span class="method-name">directive_format</span><span class="method-args">()</span>
|
151
151
|
</a>
|
152
152
|
</div>
|
153
153
|
|
154
154
|
<div class="method-description">
|
155
155
|
<p><a class="source-toggle" href="#"
|
156
|
-
onclick="toggleCode('
|
157
|
-
<div class="method-source-code" id="
|
156
|
+
onclick="toggleCode('M000061-source');return false;">[Source]</a></p>
|
157
|
+
<div class="method-source-code" id="M000061-source">
|
158
158
|
<pre>
|
159
159
|
<span class="ruby-comment cmt"># File kwartz/binding/php.rb, line 39</span>
|
160
160
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">directive_format</span>
|
@@ -165,19 +165,19 @@ directive handler for PHP
|
|
165
165
|
</div>
|
166
166
|
</div>
|
167
167
|
|
168
|
-
<div id="method-
|
169
|
-
<a name="
|
168
|
+
<div id="method-M000059" class="method-detail">
|
169
|
+
<a name="M000059"></a>
|
170
170
|
|
171
171
|
<div class="method-heading">
|
172
|
-
<a href="#
|
172
|
+
<a href="#M000059" class="method-signature">
|
173
173
|
<span class="method-name">directive_pattern</span><span class="method-args">()</span>
|
174
174
|
</a>
|
175
175
|
</div>
|
176
176
|
|
177
177
|
<div class="method-description">
|
178
178
|
<p><a class="source-toggle" href="#"
|
179
|
-
onclick="toggleCode('
|
180
|
-
<div class="method-source-code" id="
|
179
|
+
onclick="toggleCode('M000059-source');return false;">[Source]</a></p>
|
180
|
+
<div class="method-source-code" id="M000059-source">
|
181
181
|
<pre>
|
182
182
|
<span class="ruby-comment cmt"># File kwartz/binding/php.rb, line 25</span>
|
183
183
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">directive_pattern</span>
|
@@ -188,100 +188,119 @@ directive handler for PHP
|
|
188
188
|
</div>
|
189
189
|
</div>
|
190
190
|
|
191
|
-
<div id="method-
|
192
|
-
<a name="
|
191
|
+
<div id="method-M000062" class="method-detail">
|
192
|
+
<a name="M000062"></a>
|
193
193
|
|
194
194
|
<div class="method-heading">
|
195
|
-
<a href="#
|
196
|
-
<span class="method-name">handle</span><span class="method-args">(
|
195
|
+
<a href="#M000062" class="method-signature">
|
196
|
+
<span class="method-name">handle</span><span class="method-args">(stmt_list, handler_arg)</span>
|
197
197
|
</a>
|
198
198
|
</div>
|
199
199
|
|
200
200
|
<div class="method-description">
|
201
201
|
<p><a class="source-toggle" href="#"
|
202
|
-
onclick="toggleCode('
|
203
|
-
<div class="method-source-code" id="
|
202
|
+
onclick="toggleCode('M000062-source');return false;">[Source]</a></p>
|
203
|
+
<div class="method-source-code" id="M000062-source">
|
204
204
|
<pre>
|
205
205
|
<span class="ruby-comment cmt"># File kwartz/binding/php.rb, line 44</span>
|
206
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">handle</span>(<span class="ruby-identifier">
|
206
|
+
<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>)
|
207
207
|
<span class="ruby-identifier">ret</span> = <span class="ruby-keyword kw">super</span>
|
208
208
|
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">ret</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">ret</span>
|
209
209
|
|
210
|
-
<span class="ruby-identifier">
|
211
|
-
<span class="ruby-identifier">
|
212
|
-
<span class="ruby-identifier">
|
210
|
+
<span class="ruby-identifier">arg</span> = <span class="ruby-identifier">handler_arg</span>
|
211
|
+
<span class="ruby-identifier">d_name</span> = <span class="ruby-identifier">arg</span>.<span class="ruby-identifier">directive_name</span>
|
212
|
+
<span class="ruby-identifier">d_arg</span> = <span class="ruby-identifier">arg</span>.<span class="ruby-identifier">directive_arg</span>
|
213
|
+
<span class="ruby-identifier">d_str</span> = <span class="ruby-identifier">arg</span>.<span class="ruby-identifier">directive_str</span>
|
213
214
|
|
214
|
-
<span class="ruby-keyword kw">case</span> <span class="ruby-identifier">
|
215
|
+
<span class="ruby-keyword kw">case</span> <span class="ruby-identifier">d_name</span>
|
215
216
|
|
216
217
|
<span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:foreach</span>, <span class="ruby-identifier">:Foreach</span>, <span class="ruby-identifier">:FOREACH</span>, <span class="ruby-identifier">:list</span>, <span class="ruby-identifier">:List</span>, <span class="ruby-identifier">:LIST</span>
|
217
218
|
<span class="ruby-identifier">is_foreach</span> = <span class="ruby-identifier">d_name</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:foreach</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">d_name</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:Foreach</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">d_name</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:FOREACH</span>
|
218
219
|
<span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">d_arg</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/\A.*\s+as\s+(\$\w+)(?:\s*=>\s*\$\w+)?\z/</span>
|
219
|
-
<span class="ruby-identifier">raise</span> <span class="ruby-identifier">convert_error</span>(<span class="ruby-node">"'#{d_str}': invalid argument."</span>, <span class="ruby-identifier">stag_info</span>.<span class="ruby-identifier">linenum</span>)
|
220
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-identifier">convert_error</span>(<span class="ruby-node">"'#{d_str}': invalid argument."</span>, <span class="ruby-identifier">arg</span>.<span class="ruby-identifier">stag_info</span>.<span class="ruby-identifier">linenum</span>)
|
220
221
|
<span class="ruby-keyword kw">end</span>
|
221
222
|
<span class="ruby-identifier">loopvar</span> = <span class="ruby-identifier">$1</span>
|
222
223
|
<span class="ruby-identifier">counter</span> = <span class="ruby-identifier">d_name</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:foreach</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">d_name</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:list</span> <span class="ruby-operator">?</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-operator">:</span> <span class="ruby-node">"#{loopvar}_ctr"</span>
|
223
224
|
<span class="ruby-identifier">toggle</span> = <span class="ruby-identifier">d_name</span> <span class="ruby-operator">!=</span> <span class="ruby-identifier">:FOREACH</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">d_name</span> <span class="ruby-operator">!=</span> <span class="ruby-identifier">:LIST</span> <span class="ruby-operator">?</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-operator">:</span> <span class="ruby-node">"#{loopvar}_tgl"</span>
|
224
|
-
<span class="ruby-identifier">
|
225
|
-
<span class="ruby-identifier">
|
226
|
-
<span class="ruby-identifier">
|
227
|
-
<span class="ruby-identifier">
|
228
|
-
<span class="ruby-identifier">
|
229
|
-
<span class="ruby-
|
230
|
-
|
231
|
-
<span class="ruby-
|
232
|
-
|
233
|
-
<span class="ruby-
|
234
|
-
|
235
|
-
|
236
|
-
<span class="ruby-
|
237
|
-
<span class="ruby-
|
238
|
-
<span class="ruby-
|
239
|
-
<span class="ruby-
|
240
|
-
<span class="ruby-
|
241
|
-
<span class="ruby-
|
242
|
-
<span class="ruby-
|
243
|
-
<span class="ruby-
|
225
|
+
<span class="ruby-identifier">code</span> = []
|
226
|
+
<span class="ruby-identifier">code</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"#{counter} = 0;"</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">counter</span>
|
227
|
+
<span class="ruby-identifier">code</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"foreach (#{d_arg}) {"</span>
|
228
|
+
<span class="ruby-identifier">code</span> <span class="ruby-operator"><<</span> <span class="ruby-node">" #{counter}++;"</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">counter</span>
|
229
|
+
<span class="ruby-identifier">code</span> <span class="ruby-operator"><<</span> <span class="ruby-node">" #{toggle} = #{counter}%2==0 ? #{@even} : #{@odd};"</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">toggle</span>
|
230
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">is_foreach</span>
|
231
|
+
<span class="ruby-identifier">wrap_element_with_native_stmt</span>(<span class="ruby-identifier">stmt_list</span>, <span class="ruby-identifier">arg</span>, <span class="ruby-identifier">code</span>, <span class="ruby-value str">"}"</span>, <span class="ruby-identifier">:foeach</span>)
|
232
|
+
<span class="ruby-keyword kw">else</span>
|
233
|
+
<span class="ruby-identifier">wrap_content_with_native_stmt</span>(<span class="ruby-identifier">stmt_list</span>, <span class="ruby-identifier">arg</span>, <span class="ruby-identifier">code</span>, <span class="ruby-value str">"}"</span>, <span class="ruby-identifier">:foeach</span>)
|
234
|
+
<span class="ruby-keyword kw">end</span>
|
235
|
+
<span class="ruby-comment cmt">#stmt_list << stag_stmt(arg) if !is_foreach</span>
|
236
|
+
<span class="ruby-comment cmt">#stmt_list << NativeStatement.new("#{counter} = 0;") if counter</span>
|
237
|
+
<span class="ruby-comment cmt">#stmt_list << NativeStatement.new("foreach (#{d_arg}) {", :foreach)</span>
|
238
|
+
<span class="ruby-comment cmt">#stmt_list << NativeStatement.new(" #{counter}++;") if counter</span>
|
239
|
+
<span class="ruby-comment cmt">#stmt_list << NativeStatement.new(" #{toggle} = #{counter}%2==0 ? #{self.even} : #{self.odd};") if toggle</span>
|
240
|
+
<span class="ruby-comment cmt">#stmt_list << stag_stmt(arg) if is_foreach</span>
|
241
|
+
<span class="ruby-comment cmt">#stmt_list.concat(arg.cont_stmts)</span>
|
242
|
+
<span class="ruby-comment cmt">#stmt_list << etag_stmt(arg) if is_foreach</span>
|
243
|
+
<span class="ruby-comment cmt">#stmt_list << NativeStatement.new("}", :foreach)</span>
|
244
|
+
<span class="ruby-comment cmt">#stmt_list << etag_stmt(arg) if !is_foreach</span>
|
245
|
+
|
246
|
+
<span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:while</span>
|
247
|
+
<span class="ruby-identifier">wrap_element_with_native_stmt</span>(<span class="ruby-identifier">stmt_list</span>, <span class="ruby-identifier">arg</span>, <span class="ruby-node">"while (#{d_arg}) {"</span>, <span class="ruby-value str">"}"</span>, <span class="ruby-identifier">:while</span>)
|
248
|
+
<span class="ruby-comment cmt">#stmt_list << NativeStatement.new("while (#{d_arg}) {", :while)</span>
|
249
|
+
<span class="ruby-comment cmt">#stmt_list << stag_stmt</span>
|
250
|
+
<span class="ruby-comment cmt">#stmt_list.concat(cont_stmts)</span>
|
251
|
+
<span class="ruby-comment cmt">#stmt_list << etag_stmt</span>
|
252
|
+
<span class="ruby-comment cmt">#stmt_list << NativeStatement.new("}", :while)</span>
|
253
|
+
|
254
|
+
<span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:loop</span>
|
255
|
+
<span class="ruby-identifier">error_if_empty_tag</span>(<span class="ruby-identifier">arg</span>)
|
256
|
+
<span class="ruby-identifier">wrap_content_with_native_stmt</span>(<span class="ruby-identifier">stmt_list</span>, <span class="ruby-identifier">arg</span>, <span class="ruby-node">"while (#{d_arg}) {"</span>, <span class="ruby-value str">"}"</span>, <span class="ruby-identifier">:while</span>)
|
257
|
+
<span class="ruby-comment cmt">#stmt_list << stag_stmt</span>
|
258
|
+
<span class="ruby-comment cmt">#stmt_list << NativeStatement.new("while (#{d_arg}) {", :while)</span>
|
259
|
+
<span class="ruby-comment cmt">#stmt_list.concat(cont_stmts)</span>
|
260
|
+
<span class="ruby-comment cmt">#stmt_list << NativeStatement.new("}", :while)</span>
|
261
|
+
<span class="ruby-comment cmt">#stmt_list << etag_stmt</span>
|
244
262
|
|
245
263
|
<span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:set</span>
|
246
|
-
<span class="ruby-identifier">
|
247
|
-
<span class="ruby-
|
248
|
-
<span class="ruby-
|
249
|
-
<span class="ruby-
|
264
|
+
<span class="ruby-identifier">wrap_element_with_native_stmt</span>(<span class="ruby-identifier">stmt_list</span>, <span class="ruby-identifier">arg</span>, <span class="ruby-node">"#{d_arg};"</span>, <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">:set</span>)
|
265
|
+
<span class="ruby-comment cmt">#stmt_list << NativeStatement.new("#{d_arg};", :set)</span>
|
266
|
+
<span class="ruby-comment cmt">#stmt_list << stag_stmt</span>
|
267
|
+
<span class="ruby-comment cmt">#stmt_list.concat(cont_stmts)</span>
|
268
|
+
<span class="ruby-comment cmt">#stmt_list << etag_stmt</span>
|
250
269
|
|
251
270
|
<span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:if</span>
|
252
|
-
<span class="ruby-identifier">
|
253
|
-
<span class="ruby-
|
254
|
-
<span class="ruby-
|
255
|
-
<span class="ruby-
|
256
|
-
<span class="ruby-
|
271
|
+
<span class="ruby-identifier">wrap_element_with_native_stmt</span>(<span class="ruby-identifier">stmt_list</span>, <span class="ruby-identifier">arg</span>, <span class="ruby-node">"if (#{d_arg}) {"</span>, <span class="ruby-value str">"}"</span>, <span class="ruby-identifier">:if</span>)
|
272
|
+
<span class="ruby-comment cmt">#stmt_list << NativeStatement.new("if (#{d_arg}) {", :if)</span>
|
273
|
+
<span class="ruby-comment cmt">#stmt_list << stag_stmt</span>
|
274
|
+
<span class="ruby-comment cmt">#stmt_list.concat(cont_stmts)</span>
|
275
|
+
<span class="ruby-comment cmt">#stmt_list << etag_stmt</span>
|
276
|
+
<span class="ruby-comment cmt">#stmt_list << NativeStatement.new("}", :if)</span>
|
257
277
|
|
258
278
|
<span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:elseif</span>, <span class="ruby-identifier">:else</span>
|
259
|
-
<span class="ruby-
|
260
|
-
|
261
|
-
<span class="ruby-
|
262
|
-
<span class="ruby-identifier">
|
263
|
-
<span class="ruby-
|
264
|
-
|
265
|
-
|
266
|
-
<span class="ruby-
|
267
|
-
|
268
|
-
|
269
|
-
<span class="ruby-keyword kw">end</span>
|
270
|
-
<span class="ruby-identifier">stmt_list</span> <span class="ruby-operator"><<</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>)
|
271
|
-
<span class="ruby-identifier">stmt_list</span>.<span class="ruby-identifier">concat</span>(<span class="ruby-identifier">cont_stmts</span>)
|
272
|
-
<span class="ruby-identifier">stmt_list</span> <span class="ruby-operator"><<</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>)
|
273
|
-
<span class="ruby-identifier">stmt_list</span> <span class="ruby-operator"><<</span> <span class="ruby-constant">NativeStatement</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value str">"}"</span>, <span class="ruby-identifier">kind</span>)
|
279
|
+
<span class="ruby-identifier">error_when_last_stmt_is_not_if</span>(<span class="ruby-identifier">stmt_list</span>, <span class="ruby-identifier">arg</span>)
|
280
|
+
<span class="ruby-identifier">stmt_list</span>.<span class="ruby-identifier">pop</span> <span class="ruby-comment cmt"># delete '}'</span>
|
281
|
+
<span class="ruby-identifier">kind</span> = <span class="ruby-identifier">d_name</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:else</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">:else</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">:elseif</span>
|
282
|
+
<span class="ruby-identifier">code</span> = <span class="ruby-identifier">d_name</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:else</span> <span class="ruby-operator">?</span> <span class="ruby-value str">"} else {"</span> <span class="ruby-operator">:</span> <span class="ruby-node">"} elseif (#{d_arg}) {"</span>
|
283
|
+
<span class="ruby-identifier">wrap_element_with_native_stmt</span>(<span class="ruby-identifier">stmt_list</span>, <span class="ruby-identifier">arg</span>, <span class="ruby-identifier">code</span>, <span class="ruby-value str">"}"</span>, <span class="ruby-identifier">kind</span>)
|
284
|
+
<span class="ruby-comment cmt">#stmt_list << NativeStatement.new(code, kind)</span>
|
285
|
+
<span class="ruby-comment cmt">#stmt_list << stag_stmt</span>
|
286
|
+
<span class="ruby-comment cmt">#stmt_list.concat(cont_stmts)</span>
|
287
|
+
<span class="ruby-comment cmt">#stmt_list << etag_stmt</span>
|
288
|
+
<span class="ruby-comment cmt">#stmt_list << NativeStatement.new("}", kind)</span>
|
274
289
|
|
275
290
|
<span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:default</span>, <span class="ruby-identifier">:Default</span>, <span class="ruby-identifier">:DEFAULT</span>
|
276
|
-
<span class="ruby-identifier">error_if_empty_tag</span>(<span class="ruby-identifier">
|
277
|
-
<span class="ruby-identifier">
|
278
|
-
<span class="ruby-identifier">stmt_list</span> <span class="ruby-operator"><<</span> <span class="ruby-constant">NativeStatement</span>.<span class="ruby-identifier">new_without_newline</span>(<span class="ruby-node">"if (#{d_arg}) {"</span>, <span class="ruby-identifier">:if</span>)
|
291
|
+
<span class="ruby-identifier">error_if_empty_tag</span>(<span class="ruby-identifier">arg</span>)
|
292
|
+
<span class="ruby-identifier">expr_code</span> = <span class="ruby-identifier">d_arg</span>
|
279
293
|
<span class="ruby-identifier">flag_escape</span> = <span class="ruby-identifier">d_name</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:default</span> <span class="ruby-operator">?</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-operator">:</span> (<span class="ruby-identifier">d_name</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:Default</span>)
|
280
|
-
<span class="ruby-identifier">
|
281
|
-
|
282
|
-
<span class="ruby-
|
283
|
-
<span class="ruby-
|
284
|
-
<span class="ruby-
|
294
|
+
<span class="ruby-identifier">add_native_expr_with_default</span>(<span class="ruby-identifier">stmt_list</span>, <span class="ruby-identifier">arg</span>, <span class="ruby-identifier">expr_code</span>, <span class="ruby-identifier">flag_escape</span>,
|
295
|
+
<span class="ruby-node">"if (#{d_arg}) {"</span>, <span class="ruby-value str">"} else {"</span>, <span class="ruby-value str">"}"</span>)
|
296
|
+
<span class="ruby-comment cmt">#stmt_list << stag_stmt(arg)</span>
|
297
|
+
<span class="ruby-comment cmt">#stmt_list << NativeStatement.new_without_newline("if (#{d_arg}) {", :if)</span>
|
298
|
+
<span class="ruby-comment cmt">#flag_escape = d_name == :default ? nil : (d_name == :Default)</span>
|
299
|
+
<span class="ruby-comment cmt">#stmt_list << PrintStatement.new([ NativeExpression.new(d_arg, flag_escape) ])</span>
|
300
|
+
<span class="ruby-comment cmt">#stmt_list << NativeStatement.new_without_newline("} else {", :else)</span>
|
301
|
+
<span class="ruby-comment cmt">#stmt_list.concat(arg.cont_stmts)</span>
|
302
|
+
<span class="ruby-comment cmt">#stmt_list << NativeStatement.new_without_newline("}", :else)</span>
|
303
|
+
<span class="ruby-comment cmt">#stmt_list << etag_stmt(arg)</span>
|
285
304
|
|
286
305
|
<span class="ruby-keyword kw">else</span>
|
287
306
|
<span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span>
|
@@ -295,19 +314,19 @@ directive handler for PHP
|
|
295
314
|
</div>
|
296
315
|
</div>
|
297
316
|
|
298
|
-
<div id="method-
|
299
|
-
<a name="
|
317
|
+
<div id="method-M000060" class="method-detail">
|
318
|
+
<a name="M000060"></a>
|
300
319
|
|
301
320
|
<div class="method-heading">
|
302
|
-
<a href="#
|
321
|
+
<a href="#M000060" class="method-signature">
|
303
322
|
<span class="method-name">mapping_pattern</span><span class="method-args">()</span>
|
304
323
|
</a>
|
305
324
|
</div>
|
306
325
|
|
307
326
|
<div class="method-description">
|
308
327
|
<p><a class="source-toggle" href="#"
|
309
|
-
onclick="toggleCode('
|
310
|
-
<div class="method-source-code" id="
|
328
|
+
onclick="toggleCode('M000060-source');return false;">[Source]</a></p>
|
329
|
+
<div class="method-source-code" id="M000060-source">
|
311
330
|
<pre>
|
312
331
|
<span class="ruby-comment cmt"># File kwartz/binding/php.rb, line 32</span>
|
313
332
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">mapping_pattern</span>
|