erubis 2.0.1 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (145) hide show
  1. data/ChangeLog +150 -2
  2. data/LGPL +504 -0
  3. data/README.txt +14 -8
  4. data/benchmark/erubybench.rb +1 -1
  5. data/benchmark/erubybench.rhtml +3 -3
  6. data/bin/erubis +1 -1
  7. data/bin/notext +154 -0
  8. data/contrib/erubis +1036 -374
  9. data/contrib/inline-require +5 -3
  10. data/doc-api/classes/Erubis.html +43 -1
  11. data/doc-api/classes/Erubis/ArrayBufferEnhancer.html +14 -14
  12. data/doc-api/classes/Erubis/ArrayEnhancer.html +14 -14
  13. data/doc-api/classes/Erubis/Basic.html +112 -0
  14. data/doc-api/classes/Erubis/Basic/Converter.html +318 -0
  15. data/doc-api/classes/Erubis/Basic/Engine.html +130 -0
  16. data/doc-api/classes/Erubis/BiPatternEnhancer.html +14 -14
  17. data/doc-api/classes/Erubis/CGenerator.html +386 -0
  18. data/doc-api/classes/Erubis/Context.html +31 -32
  19. data/doc-api/classes/Erubis/Converter.html +231 -0
  20. data/doc-api/classes/Erubis/Ec.html +9 -283
  21. data/doc-api/classes/Erubis/Ejava.html +9 -274
  22. data/doc-api/classes/Erubis/Ejavascript.html +9 -298
  23. data/doc-api/classes/Erubis/Engine.html +68 -508
  24. data/doc-api/classes/Erubis/Eperl.html +9 -259
  25. data/doc-api/classes/Erubis/Ephp.html +9 -239
  26. data/doc-api/classes/Erubis/ErubisError.html +2 -2
  27. data/doc-api/classes/Erubis/Eruby.html +4 -187
  28. data/doc-api/classes/Erubis/EscapeEnhancer.html +9 -11
  29. data/doc-api/classes/Erubis/Escheme.html +9 -272
  30. data/doc-api/classes/Erubis/Evaluator.html +212 -0
  31. data/doc-api/classes/Erubis/Generator.html +410 -0
  32. data/doc-api/classes/Erubis/HeaderFooterEnhancer.html +16 -16
  33. data/doc-api/classes/Erubis/Helper.html +112 -0
  34. data/doc-api/classes/Erubis/Helper/CachedRailsTemplate.html +198 -0
  35. data/doc-api/classes/Erubis/Helper/RailsTemplate.html +366 -0
  36. data/doc-api/classes/Erubis/JavaGenerator.html +359 -0
  37. data/doc-api/classes/Erubis/JavascriptGenerator.html +381 -0
  38. data/doc-api/classes/Erubis/Main.html +27 -25
  39. data/doc-api/classes/Erubis/NoCodeEnhancer.html +249 -0
  40. data/doc-api/classes/Erubis/NoCodeEruby.html +120 -0
  41. data/doc-api/classes/Erubis/NoTextEnhancer.html +8 -8
  42. data/doc-api/classes/Erubis/NotSupportedError.html +119 -0
  43. data/doc-api/classes/Erubis/OptimizedEruby.html +22 -304
  44. data/doc-api/classes/Erubis/OptimizedGenerator.html +439 -0
  45. data/doc-api/classes/Erubis/OptimizedXmlEruby.html +7 -7
  46. data/doc-api/classes/Erubis/PI.html +124 -0
  47. data/doc-api/classes/Erubis/PI/Converter.html +318 -0
  48. data/doc-api/classes/Erubis/PI/Ec.html +166 -0
  49. data/doc-api/classes/Erubis/PI/Ejava.html +166 -0
  50. data/doc-api/classes/Erubis/PI/Ejavascript.html +166 -0
  51. data/doc-api/classes/Erubis/PI/Engine.html +122 -0
  52. data/doc-api/classes/Erubis/PI/Eperl.html +166 -0
  53. data/doc-api/classes/Erubis/PI/Ephp.html +166 -0
  54. data/doc-api/classes/Erubis/PI/Eruby.html +155 -0
  55. data/doc-api/classes/Erubis/PI/Escheme.html +166 -0
  56. data/doc-api/classes/Erubis/PI/TinyEruby.html +305 -0
  57. data/doc-api/classes/Erubis/PercentLineEnhancer.html +7 -7
  58. data/doc-api/classes/Erubis/PerlGenerator.html +344 -0
  59. data/doc-api/classes/Erubis/PhpGenerator.html +350 -0
  60. data/doc-api/classes/Erubis/PrintEnabledEnhancer.html +24 -24
  61. data/doc-api/classes/Erubis/PrintOutEnhancer.html +35 -35
  62. data/doc-api/classes/Erubis/RubyEvaluator.html +190 -0
  63. data/doc-api/classes/Erubis/RubyGenerator.html +327 -0
  64. data/doc-api/classes/Erubis/SchemeGenerator.html +382 -0
  65. data/doc-api/classes/Erubis/SimplifyEnhancer.html +17 -13
  66. data/doc-api/classes/Erubis/StdoutEnhancer.html +14 -14
  67. data/doc-api/classes/Erubis/StringBufferEnhancer.html +14 -14
  68. data/doc-api/classes/Erubis/TinyEruby.html +45 -40
  69. data/doc-api/classes/Erubis/XmlHelper.html +14 -14
  70. data/doc-api/created.rid +1 -1
  71. data/doc-api/files/__/README_txt.html +27 -9
  72. data/doc-api/files/erubis/context_rb.html +107 -0
  73. data/doc-api/files/erubis/converter_rb.html +114 -0
  74. data/doc-api/files/erubis/engine/ec_rb.html +2 -2
  75. data/doc-api/files/erubis/engine/ejava_rb.html +2 -2
  76. data/doc-api/files/erubis/engine/ejavascript_rb.html +2 -2
  77. data/doc-api/files/erubis/engine/enhanced_rb.html +2 -2
  78. data/doc-api/files/erubis/engine/eperl_rb.html +2 -2
  79. data/doc-api/files/erubis/engine/ephp_rb.html +2 -2
  80. data/doc-api/files/erubis/engine/eruby_rb.html +3 -2
  81. data/doc-api/files/erubis/engine/escheme_rb.html +2 -2
  82. data/doc-api/files/erubis/engine/optimized_rb.html +2 -2
  83. data/doc-api/files/erubis/engine_rb.html +6 -3
  84. data/doc-api/files/erubis/enhancer_rb.html +2 -9
  85. data/doc-api/files/erubis/error_rb.html +107 -0
  86. data/doc-api/files/erubis/evaluator_rb.html +115 -0
  87. data/doc-api/files/erubis/generator_rb.html +114 -0
  88. data/doc-api/files/erubis/helper/rails_rb.html +140 -0
  89. data/doc-api/files/erubis/helper_rb.html +1 -1
  90. data/doc-api/files/erubis/local-setting_rb.html +1 -1
  91. data/doc-api/files/erubis/main_rb.html +2 -2
  92. data/doc-api/files/erubis/tiny_rb.html +2 -2
  93. data/doc-api/files/erubis_rb.html +2 -2
  94. data/doc-api/fr_class_index.html +32 -0
  95. data/doc-api/fr_file_index.html +6 -0
  96. data/doc-api/fr_method_index.html +178 -136
  97. data/doc/users-guide.html +538 -199
  98. data/examples/{Makefile → basic/Makefile} +11 -11
  99. data/examples/basic/example.ec +42 -0
  100. data/examples/{example.ejava → basic/example.ejava} +5 -1
  101. data/examples/{example.ejavascript → basic/example.ejs} +0 -0
  102. data/examples/{example.eperl → basic/example.eperl} +2 -2
  103. data/examples/{example.ephp → basic/example.ephp} +0 -0
  104. data/examples/{example.eruby → basic/example.eruby} +0 -0
  105. data/examples/{example.escheme → basic/example.escheme} +0 -0
  106. data/examples/pi/Makefile +54 -0
  107. data/examples/pi/example.ec +42 -0
  108. data/examples/pi/example.ejava +45 -0
  109. data/examples/pi/example.ejs +16 -0
  110. data/examples/pi/example.eperl +16 -0
  111. data/examples/pi/example.ephp +17 -0
  112. data/examples/pi/example.eruby +15 -0
  113. data/examples/pi/example.escheme +26 -0
  114. data/lib/erubis.rb +15 -8
  115. data/lib/erubis/context.rb +54 -0
  116. data/lib/erubis/converter.rb +307 -0
  117. data/lib/erubis/engine.rb +57 -227
  118. data/lib/erubis/engine/ec.rb +31 -20
  119. data/lib/erubis/engine/ejava.rb +33 -21
  120. data/lib/erubis/engine/ejavascript.rb +30 -18
  121. data/lib/erubis/engine/enhanced.rb +7 -2
  122. data/lib/erubis/engine/eperl.rb +33 -19
  123. data/lib/erubis/engine/ephp.rb +32 -14
  124. data/lib/erubis/engine/eruby.rb +34 -7
  125. data/lib/erubis/engine/escheme.rb +34 -15
  126. data/lib/erubis/engine/optimized.rb +25 -11
  127. data/lib/erubis/enhancer.rb +53 -19
  128. data/lib/erubis/error.rb +24 -0
  129. data/lib/erubis/evaluator.rb +71 -0
  130. data/lib/erubis/generator.rb +83 -0
  131. data/lib/erubis/helper.rb +1 -1
  132. data/lib/erubis/helper/rails.rb +159 -0
  133. data/lib/erubis/local-setting.rb +1 -1
  134. data/lib/erubis/main.rb +87 -46
  135. data/lib/erubis/tiny.rb +81 -7
  136. data/test/assert-text-equal.rb +1 -1
  137. data/test/test-engines.rb +8 -9
  138. data/test/test-erubis.rb +196 -18
  139. data/test/{test-bin.rb → test-main.rb} +123 -21
  140. data/test/test-notext.rb +27 -0
  141. data/test/test.rb +5 -3
  142. data/test/testutil.rb +25 -36
  143. metadata +75 -13
  144. data/COPYING +0 -340
  145. data/examples/example.ec +0 -24
@@ -55,8 +55,8 @@
55
55
  <tr class="top-aligned-row">
56
56
  <td><strong>In:</strong></td>
57
57
  <td>
58
- <a href="../../files/erubis/engine_rb.html">
59
- erubis/engine.rb
58
+ <a href="../../files/erubis/error_rb.html">
59
+ erubis/error.rb
60
60
  </a>
61
61
  <br />
62
62
  </td>
@@ -65,8 +65,8 @@
65
65
  <tr class="top-aligned-row">
66
66
  <td><strong>Parent:</strong></td>
67
67
  <td>
68
- <a href="Engine.html">
69
- Engine
68
+ <a href="Basic/Engine.html">
69
+ Basic::Engine
70
70
  </a>
71
71
  </td>
72
72
  </tr>
@@ -90,19 +90,6 @@ engine for Ruby
90
90
 
91
91
  </div>
92
92
 
93
- <div id="method-list">
94
- <h3 class="section-bar">Methods</h3>
95
-
96
- <div class="name-list">
97
- <a href="#M000126">add_expr_debug</a>&nbsp;&nbsp;
98
- <a href="#M000125">add_expr_escaped</a>&nbsp;&nbsp;
99
- <a href="#M000124">add_expr_literal</a>&nbsp;&nbsp;
100
- <a href="#M000123">add_stmt</a>&nbsp;&nbsp;
101
- <a href="#M000122">add_text</a>&nbsp;&nbsp;
102
- <a href="#M000120">escape_text</a>&nbsp;&nbsp;
103
- <a href="#M000121">escaped_expr</a>&nbsp;&nbsp;
104
- </div>
105
- </div>
106
93
 
107
94
  </div>
108
95
 
@@ -112,7 +99,8 @@ engine for Ruby
112
99
  <h3 class="section-bar">Included Modules</h3>
113
100
 
114
101
  <div id="includes-list">
115
- <span class="include-name"><a href="ArrayBufferEnhancer.html">ArrayBufferEnhancer</a></span>
102
+ <span class="include-name"><a href="RubyEvaluator.html">RubyEvaluator</a></span>
103
+ <span class="include-name"><a href="RubyGenerator.html">RubyGenerator</a></span>
116
104
  </div>
117
105
  </div>
118
106
 
@@ -126,177 +114,6 @@ engine for Ruby
126
114
 
127
115
 
128
116
  <!-- if method_list -->
129
- <div id="methods">
130
- <h3 class="section-bar">Public Instance methods</h3>
131
-
132
- <div id="method-M000126" class="method-detail">
133
- <a name="M000126"></a>
134
-
135
- <div class="method-heading">
136
- <a href="#M000126" class="method-signature">
137
- <span class="method-name">add_expr_debug</span><span class="method-args">(src, code)</span>
138
- </a>
139
- </div>
140
-
141
- <div class="method-description">
142
- <p><a class="source-toggle" href="#"
143
- onclick="toggleCode('M000126-source');return false;">[Source]</a></p>
144
- <div class="method-source-code" id="M000126-source">
145
- <pre>
146
- <span class="ruby-comment cmt"># File erubis/engine/eruby.rb, line 58</span>
147
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_expr_debug</span>(<span class="ruby-identifier">src</span>, <span class="ruby-identifier">code</span>)
148
- <span class="ruby-identifier">code</span>.<span class="ruby-identifier">strip!</span>
149
- <span class="ruby-identifier">s</span> = (<span class="ruby-identifier">code</span>.<span class="ruby-identifier">dump</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/\A&quot;(.*)&quot;\z/</span>) <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">$1</span>
150
- <span class="ruby-identifier">src</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">' $stderr.puts(&quot;*** debug: '</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">s</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">'=#{('</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">code</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">').inspect}&quot;);'</span>
151
- <span class="ruby-keyword kw">end</span>
152
- </pre>
153
- </div>
154
- </div>
155
- </div>
156
-
157
- <div id="method-M000125" class="method-detail">
158
- <a name="M000125"></a>
159
-
160
- <div class="method-heading">
161
- <a href="#M000125" class="method-signature">
162
- <span class="method-name">add_expr_escaped</span><span class="method-args">(src, code)</span>
163
- </a>
164
- </div>
165
-
166
- <div class="method-description">
167
- <p><a class="source-toggle" href="#"
168
- onclick="toggleCode('M000125-source');return false;">[Source]</a></p>
169
- <div class="method-source-code" id="M000125-source">
170
- <pre>
171
- <span class="ruby-comment cmt"># File erubis/engine/eruby.rb, line 54</span>
172
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_expr_escaped</span>(<span class="ruby-identifier">src</span>, <span class="ruby-identifier">code</span>)
173
- <span class="ruby-identifier">src</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">' _buf &lt;&lt; '</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">escaped_expr</span>(<span class="ruby-identifier">code</span>) <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">';'</span>
174
- <span class="ruby-keyword kw">end</span>
175
- </pre>
176
- </div>
177
- </div>
178
- </div>
179
-
180
- <div id="method-M000124" class="method-detail">
181
- <a name="M000124"></a>
182
-
183
- <div class="method-heading">
184
- <a href="#M000124" class="method-signature">
185
- <span class="method-name">add_expr_literal</span><span class="method-args">(src, code)</span>
186
- </a>
187
- </div>
188
-
189
- <div class="method-description">
190
- <p><a class="source-toggle" href="#"
191
- onclick="toggleCode('M000124-source');return false;">[Source]</a></p>
192
- <div class="method-source-code" id="M000124-source">
193
- <pre>
194
- <span class="ruby-comment cmt"># File erubis/engine/eruby.rb, line 50</span>
195
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_expr_literal</span>(<span class="ruby-identifier">src</span>, <span class="ruby-identifier">code</span>)
196
- <span class="ruby-identifier">src</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">' _buf &lt;&lt; ('</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">code</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">').to_s;'</span>
197
- <span class="ruby-keyword kw">end</span>
198
- </pre>
199
- </div>
200
- </div>
201
- </div>
202
-
203
- <div id="method-M000123" class="method-detail">
204
- <a name="M000123"></a>
205
-
206
- <div class="method-heading">
207
- <a href="#M000123" class="method-signature">
208
- <span class="method-name">add_stmt</span><span class="method-args">(src, code)</span>
209
- </a>
210
- </div>
211
-
212
- <div class="method-description">
213
- <p><a class="source-toggle" href="#"
214
- onclick="toggleCode('M000123-source');return false;">[Source]</a></p>
215
- <div class="method-source-code" id="M000123-source">
216
- <pre>
217
- <span class="ruby-comment cmt"># File erubis/engine/eruby.rb, line 44</span>
218
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_stmt</span>(<span class="ruby-identifier">src</span>, <span class="ruby-identifier">code</span>)
219
- <span class="ruby-comment cmt">#src &lt;&lt; code &lt;&lt; ';'</span>
220
- <span class="ruby-identifier">src</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">code</span>
221
- <span class="ruby-identifier">src</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">';'</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">code</span>[<span class="ruby-value">-1</span>] <span class="ruby-operator">==</span> <span class="ruby-value">?\n</span>
222
- <span class="ruby-keyword kw">end</span>
223
- </pre>
224
- </div>
225
- </div>
226
- </div>
227
-
228
- <div id="method-M000122" class="method-detail">
229
- <a name="M000122"></a>
230
-
231
- <div class="method-heading">
232
- <a href="#M000122" class="method-signature">
233
- <span class="method-name">add_text</span><span class="method-args">(src, text)</span>
234
- </a>
235
- </div>
236
-
237
- <div class="method-description">
238
- <p><a class="source-toggle" href="#"
239
- onclick="toggleCode('M000122-source');return false;">[Source]</a></p>
240
- <div class="method-source-code" id="M000122-source">
241
- <pre>
242
- <span class="ruby-comment cmt"># File erubis/engine/eruby.rb, line 40</span>
243
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_text</span>(<span class="ruby-identifier">src</span>, <span class="ruby-identifier">text</span>)
244
- <span class="ruby-identifier">src</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot; _buf &lt;&lt; '&quot;</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">escape_text</span>(<span class="ruby-identifier">text</span>) <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;';&quot;</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">text</span>.<span class="ruby-identifier">empty?</span>
245
- <span class="ruby-keyword kw">end</span>
246
- </pre>
247
- </div>
248
- </div>
249
- </div>
250
-
251
- <div id="method-M000120" class="method-detail">
252
- <a name="M000120"></a>
253
-
254
- <div class="method-heading">
255
- <a href="#M000120" class="method-signature">
256
- <span class="method-name">escape_text</span><span class="method-args">(text)</span>
257
- </a>
258
- </div>
259
-
260
- <div class="method-description">
261
- <p><a class="source-toggle" href="#"
262
- onclick="toggleCode('M000120-source');return false;">[Source]</a></p>
263
- <div class="method-source-code" id="M000120-source">
264
- <pre>
265
- <span class="ruby-comment cmt"># File erubis/engine/eruby.rb, line 25</span>
266
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">escape_text</span>(<span class="ruby-identifier">text</span>)
267
- <span class="ruby-identifier">text</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp re">/['\\]/</span>, <span class="ruby-value str">'\\\\\&amp;'</span>) <span class="ruby-comment cmt"># &quot;'&quot; =&gt; &quot;\\'&quot;, '\\' =&gt; '\\\\'</span>
268
- <span class="ruby-keyword kw">end</span>
269
- </pre>
270
- </div>
271
- </div>
272
- </div>
273
-
274
- <div id="method-M000121" class="method-detail">
275
- <a name="M000121"></a>
276
-
277
- <div class="method-heading">
278
- <a href="#M000121" class="method-signature">
279
- <span class="method-name">escaped_expr</span><span class="method-args">(code)</span>
280
- </a>
281
- </div>
282
-
283
- <div class="method-description">
284
- <p><a class="source-toggle" href="#"
285
- onclick="toggleCode('M000121-source');return false;">[Source]</a></p>
286
- <div class="method-source-code" id="M000121-source">
287
- <pre>
288
- <span class="ruby-comment cmt"># File erubis/engine/eruby.rb, line 29</span>
289
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">escaped_expr</span>(<span class="ruby-identifier">code</span>)
290
- <span class="ruby-ivar">@escape</span> <span class="ruby-operator">||=</span> <span class="ruby-value str">&quot;Erubis::XmlHelper.escape_xml&quot;</span>
291
- <span class="ruby-keyword kw">return</span> <span class="ruby-node">&quot;#{@escape}(#{code})&quot;</span>
292
- <span class="ruby-keyword kw">end</span>
293
- </pre>
294
- </div>
295
- </div>
296
- </div>
297
-
298
-
299
- </div>
300
117
 
301
118
 
302
119
  </div>
@@ -98,7 +98,7 @@ this is language-indenedent.
98
98
  <h3 class="section-bar">Methods</h3>
99
99
 
100
100
  <div class="name-list">
101
- <a href="#M000016">add_expr</a>&nbsp;&nbsp;
101
+ <a href="#M000085">add_expr</a>&nbsp;&nbsp;
102
102
  </div>
103
103
  </div>
104
104
 
@@ -120,29 +120,27 @@ this is language-indenedent.
120
120
  <div id="methods">
121
121
  <h3 class="section-bar">Public Instance methods</h3>
122
122
 
123
- <div id="method-M000016" class="method-detail">
124
- <a name="M000016"></a>
123
+ <div id="method-M000085" class="method-detail">
124
+ <a name="M000085"></a>
125
125
 
126
126
  <div class="method-heading">
127
- <a href="#M000016" class="method-signature">
127
+ <a href="#M000085" class="method-signature">
128
128
  <span class="method-name">add_expr</span><span class="method-args">(src, code, indicator)</span>
129
129
  </a>
130
130
  </div>
131
131
 
132
132
  <div class="method-description">
133
133
  <p><a class="source-toggle" href="#"
134
- onclick="toggleCode('M000016-source');return false;">[Source]</a></p>
135
- <div class="method-source-code" id="M000016-source">
134
+ onclick="toggleCode('M000085-source');return false;">[Source]</a></p>
135
+ <div class="method-source-code" id="M000085-source">
136
136
  <pre>
137
- <span class="ruby-comment cmt"># File erubis/enhancer.rb, line 41</span>
137
+ <span class="ruby-comment cmt"># File erubis/enhancer.rb, line 38</span>
138
138
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_expr</span>(<span class="ruby-identifier">src</span>, <span class="ruby-identifier">code</span>, <span class="ruby-identifier">indicator</span>)
139
139
  <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">indicator</span>
140
140
  <span class="ruby-keyword kw">when</span> <span class="ruby-value str">'='</span>
141
- <span class="ruby-identifier">add_expr_escaped</span>(<span class="ruby-identifier">src</span>, <span class="ruby-identifier">code</span>)
142
- <span class="ruby-comment cmt">#add_expr_literal(src, code)</span>
141
+ <span class="ruby-ivar">@escape</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">add_expr_literal</span>(<span class="ruby-identifier">src</span>, <span class="ruby-identifier">code</span>) <span class="ruby-operator">:</span> <span class="ruby-identifier">add_expr_escaped</span>(<span class="ruby-identifier">src</span>, <span class="ruby-identifier">code</span>)
143
142
  <span class="ruby-keyword kw">when</span> <span class="ruby-value str">'=='</span>
144
- <span class="ruby-identifier">add_expr_literal</span>(<span class="ruby-identifier">src</span>, <span class="ruby-identifier">code</span>)
145
- <span class="ruby-comment cmt">#add_expr_escaped(src, code)</span>
143
+ <span class="ruby-ivar">@escape</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">add_expr_escaped</span>(<span class="ruby-identifier">src</span>, <span class="ruby-identifier">code</span>) <span class="ruby-operator">:</span> <span class="ruby-identifier">add_expr_literal</span>(<span class="ruby-identifier">src</span>, <span class="ruby-identifier">code</span>)
146
144
  <span class="ruby-keyword kw">when</span> <span class="ruby-value str">'==='</span>
147
145
  <span class="ruby-identifier">add_expr_debug</span>(<span class="ruby-identifier">src</span>, <span class="ruby-identifier">code</span>)
148
146
  <span class="ruby-keyword kw">end</span>
@@ -65,8 +65,8 @@
65
65
  <tr class="top-aligned-row">
66
66
  <td><strong>Parent:</strong></td>
67
67
  <td>
68
- <a href="Engine.html">
69
- Engine
68
+ <a href="Basic/Engine.html">
69
+ Basic::Engine
70
70
  </a>
71
71
  </td>
72
72
  </tr>
@@ -90,292 +90,29 @@ engine for Scheme
90
90
 
91
91
  </div>
92
92
 
93
- <div id="method-list">
94
- <h3 class="section-bar">Methods</h3>
95
-
96
- <div class="name-list">
97
- <a href="#M000135">add_expr_debug</a>&nbsp;&nbsp;
98
- <a href="#M000134">add_expr_escaped</a>&nbsp;&nbsp;
99
- <a href="#M000133">add_expr_literal</a>&nbsp;&nbsp;
100
- <a href="#M000136">add_postamble</a>&nbsp;&nbsp;
101
- <a href="#M000128">add_preamble</a>&nbsp;&nbsp;
102
- <a href="#M000132">add_stmt</a>&nbsp;&nbsp;
103
- <a href="#M000131">add_text</a>&nbsp;&nbsp;
104
- <a href="#M000129">escape_text</a>&nbsp;&nbsp;
105
- <a href="#M000130">escaped_expr</a>&nbsp;&nbsp;
106
- <a href="#M000127">new</a>&nbsp;&nbsp;
107
- </div>
108
- </div>
109
93
 
110
94
  </div>
111
95
 
112
96
 
113
97
  <!-- if includes -->
98
+ <div id="includes">
99
+ <h3 class="section-bar">Included Modules</h3>
114
100
 
115
- <div id="section">
116
-
117
-
118
-
119
-
120
-
121
-
122
-
123
-
124
- <!-- if method_list -->
125
- <div id="methods">
126
- <h3 class="section-bar">Public Class methods</h3>
127
-
128
- <div id="method-M000127" class="method-detail">
129
- <a name="M000127"></a>
130
-
131
- <div class="method-heading">
132
- <a href="#M000127" class="method-signature">
133
- <span class="method-name">new</span><span class="method-args">(input, properties={})</span>
134
- </a>
135
- </div>
136
-
137
- <div class="method-description">
138
- <p><a class="source-toggle" href="#"
139
- onclick="toggleCode('M000127-source');return false;">[Source]</a></p>
140
- <div class="method-source-code" id="M000127-source">
141
- <pre>
142
- <span class="ruby-comment cmt"># File erubis/engine/escheme.rb, line 25</span>
143
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">input</span>, <span class="ruby-identifier">properties</span>={})
144
- <span class="ruby-ivar">@func</span> = <span class="ruby-identifier">properties</span>[<span class="ruby-identifier">:func</span>] <span class="ruby-operator">||</span> <span class="ruby-value str">'_add'</span> <span class="ruby-comment cmt"># or 'display'</span>
145
- <span class="ruby-keyword kw">super</span>
146
- <span class="ruby-keyword kw">end</span>
147
- </pre>
148
- </div>
149
- </div>
150
- </div>
151
-
152
- <h3 class="section-bar">Public Instance methods</h3>
153
-
154
- <div id="method-M000135" class="method-detail">
155
- <a name="M000135"></a>
156
-
157
- <div class="method-heading">
158
- <a href="#M000135" class="method-signature">
159
- <span class="method-name">add_expr_debug</span><span class="method-args">(src, code)</span>
160
- </a>
161
- </div>
162
-
163
- <div class="method-description">
164
- <p><a class="source-toggle" href="#"
165
- onclick="toggleCode('M000135-source');return false;">[Source]</a></p>
166
- <div class="method-source-code" id="M000135-source">
167
- <pre>
168
- <span class="ruby-comment cmt"># File erubis/engine/escheme.rb, line 72</span>
169
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_expr_debug</span>(<span class="ruby-identifier">src</span>, <span class="ruby-identifier">code</span>)
170
- <span class="ruby-identifier">s</span> = (<span class="ruby-identifier">code</span>.<span class="ruby-identifier">strip!</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">code</span>).<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp re">/\&quot;/</span>, <span class="ruby-value str">'\\&quot;'</span>)
171
- <span class="ruby-identifier">src</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;(display \&quot;*** debug: #{s}=\&quot;)(display #{code.strip})(display \&quot;\\n\&quot;)&quot;</span>
172
- <span class="ruby-keyword kw">end</span>
173
- </pre>
174
- </div>
175
- </div>
176
- </div>
177
-
178
- <div id="method-M000134" class="method-detail">
179
- <a name="M000134"></a>
180
-
181
- <div class="method-heading">
182
- <a href="#M000134" class="method-signature">
183
- <span class="method-name">add_expr_escaped</span><span class="method-args">(src, code)</span>
184
- </a>
185
- </div>
186
-
187
- <div class="method-description">
188
- <p><a class="source-toggle" href="#"
189
- onclick="toggleCode('M000134-source');return false;">[Source]</a></p>
190
- <div class="method-source-code" id="M000134-source">
191
- <pre>
192
- <span class="ruby-comment cmt"># File erubis/engine/escheme.rb, line 68</span>
193
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_expr_escaped</span>(<span class="ruby-identifier">src</span>, <span class="ruby-identifier">code</span>)
194
- <span class="ruby-identifier">src</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;(#{@func} &quot;</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">escaped_expr</span>(<span class="ruby-identifier">code</span>) <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">')'</span>
195
- <span class="ruby-keyword kw">end</span>
196
- </pre>
197
- </div>
198
- </div>
199
- </div>
200
-
201
- <div id="method-M000133" class="method-detail">
202
- <a name="M000133"></a>
203
-
204
- <div class="method-heading">
205
- <a href="#M000133" class="method-signature">
206
- <span class="method-name">add_expr_literal</span><span class="method-args">(src, code)</span>
207
- </a>
208
- </div>
209
-
210
- <div class="method-description">
211
- <p><a class="source-toggle" href="#"
212
- onclick="toggleCode('M000133-source');return false;">[Source]</a></p>
213
- <div class="method-source-code" id="M000133-source">
214
- <pre>
215
- <span class="ruby-comment cmt"># File erubis/engine/escheme.rb, line 64</span>
216
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_expr_literal</span>(<span class="ruby-identifier">src</span>, <span class="ruby-identifier">code</span>)
217
- <span class="ruby-identifier">src</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;(#{@func} &quot;</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">code</span>.<span class="ruby-identifier">strip</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">')'</span>
218
- <span class="ruby-keyword kw">end</span>
219
- </pre>
220
- </div>
221
- </div>
222
- </div>
223
-
224
- <div id="method-M000136" class="method-detail">
225
- <a name="M000136"></a>
226
-
227
- <div class="method-heading">
228
- <a href="#M000136" class="method-signature">
229
- <span class="method-name">add_postamble</span><span class="method-args">(src)</span>
230
- </a>
231
- </div>
232
-
233
- <div class="method-description">
234
- <p><a class="source-toggle" href="#"
235
- onclick="toggleCode('M000136-source');return false;">[Source]</a></p>
236
- <div class="method-source-code" id="M000136-source">
237
- <pre>
238
- <span class="ruby-comment cmt"># File erubis/engine/escheme.rb, line 77</span>
239
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_postamble</span>(<span class="ruby-identifier">src</span>)
240
- <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@func</span> <span class="ruby-operator">==</span> <span class="ruby-value str">'_add'</span>
241
- <span class="ruby-identifier">src</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;\n&quot;</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">src</span>[<span class="ruby-value">-1</span>] <span class="ruby-operator">==</span> <span class="ruby-value">?\n</span>
242
- <span class="ruby-identifier">src</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot; (reverse _buf))\n&quot;</span>
243
- <span class="ruby-keyword kw">end</span>
244
- </pre>
245
- </div>
246
- </div>
247
- </div>
248
-
249
- <div id="method-M000128" class="method-detail">
250
- <a name="M000128"></a>
251
-
252
- <div class="method-heading">
253
- <a href="#M000128" class="method-signature">
254
- <span class="method-name">add_preamble</span><span class="method-args">(src)</span>
255
- </a>
256
- </div>
257
-
258
- <div class="method-description">
259
- <p><a class="source-toggle" href="#"
260
- onclick="toggleCode('M000128-source');return false;">[Source]</a></p>
261
- <div class="method-source-code" id="M000128-source">
262
- <pre>
263
- <span class="ruby-comment cmt"># File erubis/engine/escheme.rb, line 30</span>
264
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_preamble</span>(<span class="ruby-identifier">src</span>)
265
- <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@func</span> <span class="ruby-operator">==</span> <span class="ruby-value str">'_add'</span>
266
- <span class="ruby-identifier">src</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;(let ((_buf '())) &quot;</span> <span class="ruby-operator">+</span> \
267
- <span class="ruby-value str">&quot;(define (_add x) (set! _buf (cons x _buf))) &quot;</span>
268
- <span class="ruby-comment cmt">#src &lt;&lt; &quot;(let* ((_buf '())&quot; + # &quot; (_add (lambda (x) (set! _buf (cons x _buf))))) &quot;</span>
269
- <span class="ruby-keyword kw">end</span>
270
- </pre>
271
- </div>
272
- </div>
273
- </div>
274
-
275
- <div id="method-M000132" class="method-detail">
276
- <a name="M000132"></a>
277
-
278
- <div class="method-heading">
279
- <a href="#M000132" class="method-signature">
280
- <span class="method-name">add_stmt</span><span class="method-args">(src, code)</span>
281
- </a>
282
- </div>
283
-
284
- <div class="method-description">
285
- <p><a class="source-toggle" href="#"
286
- onclick="toggleCode('M000132-source');return false;">[Source]</a></p>
287
- <div class="method-source-code" id="M000132-source">
288
- <pre>
289
- <span class="ruby-comment cmt"># File erubis/engine/escheme.rb, line 60</span>
290
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_stmt</span>(<span class="ruby-identifier">src</span>, <span class="ruby-identifier">code</span>)
291
- <span class="ruby-identifier">src</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">code</span>
292
- <span class="ruby-keyword kw">end</span>
293
- </pre>
294
- </div>
295
- </div>
101
+ <div id="includes-list">
102
+ <span class="include-name"><a href="SchemeGenerator.html">SchemeGenerator</a></span>
296
103
  </div>
104
+ </div>
297
105
 
298
- <div id="method-M000131" class="method-detail">
299
- <a name="M000131"></a>
106
+ <div id="section">
300
107
 
301
- <div class="method-heading">
302
- <a href="#M000131" class="method-signature">
303
- <span class="method-name">add_text</span><span class="method-args">(src, text)</span>
304
- </a>
305
- </div>
306
-
307
- <div class="method-description">
308
- <p><a class="source-toggle" href="#"
309
- onclick="toggleCode('M000131-source');return false;">[Source]</a></p>
310
- <div class="method-source-code" id="M000131-source">
311
- <pre>
312
- <span class="ruby-comment cmt"># File erubis/engine/escheme.rb, line 49</span>
313
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_text</span>(<span class="ruby-identifier">src</span>, <span class="ruby-identifier">text</span>)
314
- <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">text</span>.<span class="ruby-identifier">empty?</span>
315
- <span class="ruby-identifier">t</span> = <span class="ruby-identifier">escape_text</span>(<span class="ruby-identifier">text</span>)
316
- <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">t</span>[<span class="ruby-value">-1</span>] <span class="ruby-operator">==</span> <span class="ruby-value">?\n</span>
317
- <span class="ruby-identifier">t</span>[<span class="ruby-value">-1</span>, <span class="ruby-value">1</span>] = <span class="ruby-value str">''</span>
318
- <span class="ruby-identifier">src</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;(#{@func} \&quot;&quot;</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">t</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;\\n\&quot;)\n&quot;</span>
319
- <span class="ruby-keyword kw">else</span>
320
- <span class="ruby-identifier">src</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;(#{@func} \&quot;&quot;</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">t</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">'&quot;)'</span>
321
- <span class="ruby-keyword kw">end</span>
322
- <span class="ruby-keyword kw">end</span>
323
- </pre>
324
- </div>
325
- </div>
326
- </div>
327
108
 
328
- <div id="method-M000129" class="method-detail">
329
- <a name="M000129"></a>
330
109
 
331
- <div class="method-heading">
332
- <a href="#M000129" class="method-signature">
333
- <span class="method-name">escape_text</span><span class="method-args">(text)</span>
334
- </a>
335
- </div>
336
-
337
- <div class="method-description">
338
- <p><a class="source-toggle" href="#"
339
- onclick="toggleCode('M000129-source');return false;">[Source]</a></p>
340
- <div class="method-source-code" id="M000129-source">
341
- <pre>
342
- <span class="ruby-comment cmt"># File erubis/engine/escheme.rb, line 38</span>
343
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">escape_text</span>(<span class="ruby-identifier">text</span>)
344
- <span class="ruby-ivar">@table_</span> <span class="ruby-operator">||=</span> { <span class="ruby-value str">'&quot;'</span>=<span class="ruby-operator">&gt;</span><span class="ruby-value str">'\\&quot;'</span>, <span class="ruby-value str">'\\'</span>=<span class="ruby-operator">&gt;</span><span class="ruby-value str">'\\\\'</span> }
345
- <span class="ruby-identifier">text</span>.<span class="ruby-identifier">gsub!</span>(<span class="ruby-regexp re">/[&quot;\\]/</span>) { <span class="ruby-operator">|</span><span class="ruby-identifier">m</span><span class="ruby-operator">|</span> <span class="ruby-ivar">@table_</span>[<span class="ruby-identifier">m</span>] }
346
- <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">text</span>
347
- <span class="ruby-keyword kw">end</span>
348
- </pre>
349
- </div>
350
- </div>
351
- </div>
352
110
 
353
- <div id="method-M000130" class="method-detail">
354
- <a name="M000130"></a>
355
111
 
356
- <div class="method-heading">
357
- <a href="#M000130" class="method-signature">
358
- <span class="method-name">escaped_expr</span><span class="method-args">(code)</span>
359
- </a>
360
- </div>
361
112
 
362
- <div class="method-description">
363
- <p><a class="source-toggle" href="#"
364
- onclick="toggleCode('M000130-source');return false;">[Source]</a></p>
365
- <div class="method-source-code" id="M000130-source">
366
- <pre>
367
- <span class="ruby-comment cmt"># File erubis/engine/escheme.rb, line 44</span>
368
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">escaped_expr</span>(<span class="ruby-identifier">code</span>)
369
- <span class="ruby-ivar">@escape</span> <span class="ruby-operator">||=</span> <span class="ruby-value str">'escape'</span>
370
- <span class="ruby-keyword kw">return</span> <span class="ruby-node">&quot;(#{@escape} #{code.strip})&quot;</span>
371
- <span class="ruby-keyword kw">end</span>
372
- </pre>
373
- </div>
374
- </div>
375
- </div>
376
113
 
377
114
 
378
- </div>
115
+ <!-- if method_list -->
379
116
 
380
117
 
381
118
  </div>