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
data/test/test-converter.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
###
|
2
|
-
### $Rev:
|
3
|
-
### $Release: 3.
|
2
|
+
### $Rev: 123 $
|
3
|
+
### $Release: 3.1.0 $
|
4
4
|
### copyright(c) 2004-2006 kuwata-lab.com all rights reserved
|
5
5
|
###
|
6
6
|
|
@@ -12,15 +12,23 @@ class ConverterTest < Test::Unit::TestCase
|
|
12
12
|
|
13
13
|
## define test methods
|
14
14
|
filename = __FILE__.sub(/\.rb$/, '.yaml')
|
15
|
-
load_yaml_testdata(filename)
|
15
|
+
#load_yaml_testdata(filename)
|
16
|
+
load_yaml_testdata_with_each_lang(filename, :langs=>%w[eruby php])
|
16
17
|
|
17
18
|
|
18
19
|
def _test
|
19
|
-
parser = Kwartz::PresentationLogicParser.get_class('css').new
|
20
|
-
ruleset_list = parser.parse(@plogic)
|
21
|
-
|
22
|
-
|
23
|
-
|
20
|
+
#parser = Kwartz::PresentationLogicParser.get_class('css').new
|
21
|
+
#ruleset_list = parser.parse(@plogic)
|
22
|
+
ruleset_list = []
|
23
|
+
(@properties ||= {}).each do |key, val|
|
24
|
+
if key.is_a?(String)
|
25
|
+
key = key.intern
|
26
|
+
@properties.delete(key)
|
27
|
+
@properties[key] = val
|
28
|
+
end
|
29
|
+
end
|
30
|
+
handler = Kwartz::Handler.get_class(@lang).new(ruleset_list, @properties)
|
31
|
+
converter = Kwartz::TextConverter.new(handler, @properties)
|
24
32
|
stmt_list = converter.convert(@pdata)
|
25
33
|
sb = ''
|
26
34
|
stmt_list.each do |stmt|
|
data/test/test-converter.yaml
CHANGED
@@ -1,76 +1,294 @@
|
|
1
|
-
|
2
|
-
- name:
|
3
|
-
|
1
|
+
###
|
2
|
+
- name: delspan1
|
3
|
+
desc: <span> and id="mark:foo"
|
4
|
+
properties: { delspan : true }
|
5
|
+
pdata*:
|
6
|
+
eruby: |
|
7
|
+
<p>
|
8
|
+
<span id="foo">FOO</span>
|
9
|
+
<span id="mark:bar">BAR</span>
|
10
|
+
<span kw:d="id: baz">BAZ</span>
|
11
|
+
<span kw:d="mark:poo" class="foo">POO</span>
|
12
|
+
</p>
|
13
|
+
|
14
|
+
php: &delspan1_pdata |
|
4
15
|
<p>
|
5
16
|
<span id="foo">FOO</span>
|
6
17
|
<span id="mark:bar">BAR</span>
|
7
|
-
<span
|
8
|
-
<span
|
18
|
+
<span kw:d="id(baz)">BAZ</span>
|
19
|
+
<span kw:d="mark(poo)" class="foo">POO</span>
|
20
|
+
</p>
|
21
|
+
|
22
|
+
jstl: *delspan1_pdata
|
23
|
+
|
24
|
+
eperl: *delspan1_pdata
|
25
|
+
|
26
|
+
expected*:
|
27
|
+
eruby: &delspan2_expected |
|
28
|
+
print("<p>\n")
|
29
|
+
print(" <span id=\"foo\">")
|
30
|
+
print("FOO")
|
31
|
+
print("</span>\n")
|
32
|
+
print()
|
33
|
+
print("BAR")
|
34
|
+
print()
|
35
|
+
print()
|
36
|
+
print("BAZ")
|
37
|
+
print()
|
38
|
+
print(" <span class=\"foo\">")
|
39
|
+
print("POO")
|
40
|
+
print("</span>\n")
|
41
|
+
print("</p>\n")
|
42
|
+
|
43
|
+
php: *delspan2_expected
|
44
|
+
|
45
|
+
jstl: *delspan2_expected
|
46
|
+
|
47
|
+
eperl: *delspan2_expected
|
48
|
+
|
49
|
+
###
|
50
|
+
- name: delspan2
|
51
|
+
desc: <span> and 'attr:' or 'append:'
|
52
|
+
properties: { delspan : true }
|
53
|
+
pdata*:
|
54
|
+
eruby: |
|
55
|
+
<p>
|
56
|
+
<span kw:d="attr: 'class' classname">ATTR</span>
|
57
|
+
<span kw:d="append: ' checked'">APPEND</span>
|
58
|
+
<span kw:d="append: ' checked'" class="foo">APPEND</span>
|
59
|
+
</p>
|
60
|
+
|
61
|
+
php: &delspan2_pdata |
|
62
|
+
<p>
|
63
|
+
<span kw:d="attr('class', $classname)">ATTR</span>
|
64
|
+
<span kw:d="append(' checked')">APPEND</span>
|
65
|
+
<span kw:d="append(' checked')" class="foo">APPEND</span>
|
66
|
+
</p>
|
67
|
+
|
68
|
+
jstl: |
|
69
|
+
<p>
|
70
|
+
<span kw:d="attr('class', classname)">ATTR</span>
|
71
|
+
<span kw:d="append(' checked')">APPEND</span>
|
72
|
+
<span kw:d="append(' checked')" class="foo">APPEND</span>
|
73
|
+
</p>
|
74
|
+
|
75
|
+
eperl: |
|
76
|
+
<p>
|
77
|
+
<span kw:d="attr('class', $classname)">ATTR</span>
|
78
|
+
<span kw:d="append(' checked')">APPEND</span>
|
79
|
+
<span kw:d="append(' checked')" class="foo">APPEND</span>
|
80
|
+
</p>
|
81
|
+
|
82
|
+
expected*:
|
83
|
+
eruby: |
|
84
|
+
print("<p>\n")
|
85
|
+
print(" <span class=\"", <%=classname%>, "\">")
|
86
|
+
print("ATTR")
|
87
|
+
print("</span>\n")
|
88
|
+
print(" <span", <%=' checked'%>, ">")
|
89
|
+
print("APPEND")
|
90
|
+
print("</span>\n")
|
91
|
+
print(" <span class=\"foo\"", <%=' checked'%>, ">")
|
92
|
+
print("APPEND")
|
93
|
+
print("</span>\n")
|
94
|
+
print("</p>\n")
|
95
|
+
|
96
|
+
php: |
|
97
|
+
print("<p>\n")
|
98
|
+
print(" <span class=\"", <%=$classname%>, "\">")
|
99
|
+
print("ATTR")
|
100
|
+
print("</span>\n")
|
101
|
+
print(" <span", <%=' checked'%>, ">")
|
102
|
+
print("APPEND")
|
103
|
+
print("</span>\n")
|
104
|
+
print(" <span class=\"foo\"", <%=' checked'%>, ">")
|
105
|
+
print("APPEND")
|
106
|
+
print("</span>\n")
|
107
|
+
print("</p>\n")
|
108
|
+
|
109
|
+
jstl: |
|
110
|
+
print("<p>\n")
|
111
|
+
print(" <span class=\"", <%=classname%>, "\">")
|
112
|
+
print("ATTR")
|
113
|
+
print("</span>\n")
|
114
|
+
print(" <span", <%=' checked'%>, ">")
|
115
|
+
print("APPEND")
|
116
|
+
print("</span>\n")
|
117
|
+
print(" <span class=\"foo\"", <%=' checked'%>, ">")
|
118
|
+
print("APPEND")
|
119
|
+
print("</span>\n")
|
120
|
+
print("</p>\n")
|
121
|
+
|
122
|
+
eperl: |
|
123
|
+
print("<p>\n")
|
124
|
+
print(" <span class=\"", <%=$classname%>, "\">")
|
125
|
+
print("ATTR")
|
126
|
+
print("</span>\n")
|
127
|
+
print(" <span", <%=' checked'%>, ">")
|
128
|
+
print("APPEND")
|
129
|
+
print("</span>\n")
|
130
|
+
print(" <span class=\"foo\"", <%=' checked'%>, ">")
|
131
|
+
print("APPEND")
|
132
|
+
print("</span>\n")
|
133
|
+
print("</p>\n")
|
134
|
+
|
135
|
+
###
|
136
|
+
- name: delspan3
|
137
|
+
desc: <span> and 'value:'
|
138
|
+
properties: { delspan : true }
|
139
|
+
pdata*:
|
140
|
+
eruby: |
|
141
|
+
<p>
|
142
|
+
<span kw:d="value: expr">EXPR</span>
|
143
|
+
<span kw:d="value: expr" class="foo">EXPR</span>
|
9
144
|
</p>
|
145
|
+
|
146
|
+
php: |
|
10
147
|
<p>
|
11
|
-
<span
|
12
|
-
<span
|
13
|
-
<span title="append: ' checked'" class="foo">APPEND</span>
|
148
|
+
<span kw:d="value($expr)">EXPR</span>
|
149
|
+
<span kw:d="value($expr)" class="foo">EXPR</span>
|
14
150
|
</p>
|
151
|
+
|
152
|
+
jstl: |
|
15
153
|
<p>
|
16
|
-
<span
|
17
|
-
<span
|
154
|
+
<span kw:d="value(expr)">EXPR</span>
|
155
|
+
<span kw:d="value(expr)" class="foo">EXPR</span>
|
18
156
|
</p>
|
157
|
+
|
158
|
+
eperl: |
|
19
159
|
<p>
|
20
|
-
<span
|
21
|
-
<span
|
22
|
-
|
160
|
+
<span kw:d="value($expr)">EXPR</span>
|
161
|
+
<span kw:d="value($expr)" class="foo">EXPR</span>
|
162
|
+
</p>
|
163
|
+
|
164
|
+
expected*:
|
165
|
+
eruby: |
|
166
|
+
print("<p>\n")
|
167
|
+
print(<%=expr%>)
|
168
|
+
print(" <span class=\"foo\">", <%=expr%>, "</span>\n")
|
169
|
+
print("</p>\n")
|
170
|
+
|
171
|
+
php: |
|
172
|
+
print("<p>\n")
|
173
|
+
print(<%=$expr%>)
|
174
|
+
print(" <span class=\"foo\">", <%=$expr%>, "</span>\n")
|
175
|
+
print("</p>\n")
|
176
|
+
|
177
|
+
jstl: |
|
178
|
+
print("<p>\n")
|
179
|
+
print(<%=expr%>)
|
180
|
+
print(" <span class=\"foo\">", <%=expr%>, "</span>\n")
|
181
|
+
print("</p>\n")
|
182
|
+
|
183
|
+
eperl: |
|
184
|
+
print("<p>\n")
|
185
|
+
print(<%=$expr%>)
|
186
|
+
print(" <span class=\"foo\">", <%=$expr%>, "</span>\n")
|
187
|
+
print("</p>\n")
|
188
|
+
|
189
|
+
###
|
190
|
+
- name: delspan4
|
191
|
+
desc: <span> and 'if:', 'elsif:', 'else:'
|
192
|
+
properties: { delspan : true }
|
193
|
+
pdata*:
|
194
|
+
eruby: |
|
195
|
+
<p>
|
196
|
+
<span kw:d="if x > 0">positive</span>
|
197
|
+
<span kw:d="elsif x < 0">negative</span>
|
198
|
+
<span kw:d="else">zero</span>
|
199
|
+
</p>
|
200
|
+
|
201
|
+
php: |
|
202
|
+
<p>
|
203
|
+
<span kw:d="if($x > 0)">positive</span>
|
204
|
+
<span kw:d="elseif($x < 0)">negative</span>
|
205
|
+
<span kw:d="else">zero</span>
|
206
|
+
</p>
|
207
|
+
|
208
|
+
jstl: |
|
209
|
+
<p>
|
210
|
+
<span kw:d="if(x > 0)">positive</span>
|
211
|
+
<span kw:d="elseif(x < 0)">negative</span>
|
212
|
+
<span kw:d="else">zero</span>
|
213
|
+
</p>
|
214
|
+
|
215
|
+
eperl: |
|
216
|
+
<p>
|
217
|
+
<span kw:d="if($x > 0)">positive</span>
|
218
|
+
<span kw:d="elsif($x < 0)">negative</span>
|
219
|
+
<span kw:d="else">zero</span>
|
23
220
|
</p>
|
24
221
|
|
25
222
|
plogic: |
|
223
|
+
expected*:
|
224
|
+
eruby: |
|
225
|
+
print("<p>\n")
|
226
|
+
<%if x > 0 then%>
|
227
|
+
print()
|
228
|
+
print("positive")
|
229
|
+
print()
|
230
|
+
<%elsif x < 0 then%>
|
231
|
+
print()
|
232
|
+
print("negative")
|
233
|
+
print()
|
234
|
+
<%else%>
|
235
|
+
print()
|
236
|
+
print("zero")
|
237
|
+
print()
|
238
|
+
<%end%>
|
239
|
+
print("</p>\n")
|
240
|
+
|
241
|
+
php: |
|
242
|
+
print("<p>\n")
|
243
|
+
<%if ($x > 0) {%>
|
244
|
+
print()
|
245
|
+
print("positive")
|
246
|
+
print()
|
247
|
+
<%} elseif ($x < 0) {%>
|
248
|
+
print()
|
249
|
+
print("negative")
|
250
|
+
print()
|
251
|
+
<%} else {%>
|
252
|
+
print()
|
253
|
+
print("zero")
|
254
|
+
print()
|
255
|
+
<%}%>
|
256
|
+
print("</p>\n")
|
257
|
+
|
258
|
+
jstl: |
|
259
|
+
print("<p>\n")
|
260
|
+
<%<c:choose><c:when test="${x > 0}">%>
|
261
|
+
print()
|
262
|
+
print("positive")
|
263
|
+
print()
|
264
|
+
<%</c:when><c:when test="${x < 0}">%>
|
265
|
+
print()
|
266
|
+
print("negative")
|
267
|
+
print()
|
268
|
+
<%</c:when><c:otherwise>%>
|
269
|
+
print()
|
270
|
+
print("zero")
|
271
|
+
print()
|
272
|
+
<%</c:otherwise></c:choose>%>
|
273
|
+
print("</p>\n")
|
274
|
+
|
275
|
+
eperl: |
|
276
|
+
print("<p>\n")
|
277
|
+
<%if ($x > 0) {%>
|
278
|
+
print()
|
279
|
+
print("positive")
|
280
|
+
print()
|
281
|
+
<%} elsif ($x < 0) {%>
|
282
|
+
print()
|
283
|
+
print("negative")
|
284
|
+
print()
|
285
|
+
<%} else {%>
|
286
|
+
print()
|
287
|
+
print("zero")
|
288
|
+
print()
|
289
|
+
<%}%>
|
290
|
+
print("</p>\n")
|
26
291
|
|
27
|
-
expected: |
|
28
|
-
[ "<p>\n"]
|
29
|
-
[ " <span id=\"foo\">"]
|
30
|
-
[ "FOO"]
|
31
|
-
[ "</span>\n"]
|
32
|
-
[ ]
|
33
|
-
[ "BAR"]
|
34
|
-
[ ]
|
35
|
-
[ ]
|
36
|
-
[ "BAZ"]
|
37
|
-
[ ]
|
38
|
-
[ " <span class=\"foo\">"]
|
39
|
-
[ "POO"]
|
40
|
-
[ "</span>\n"]
|
41
|
-
[ "</p>\n"]
|
42
|
-
[ "<p>\n"]
|
43
|
-
[ " <span class=\"", <%=classname%>, "\">"]
|
44
|
-
[ "ATTR"]
|
45
|
-
[ "</span>\n"]
|
46
|
-
[ " <span", <%=' checked'%>, ">"]
|
47
|
-
[ "APPEND"]
|
48
|
-
[ "</span>\n"]
|
49
|
-
[ " <span class=\"foo\"", <%=' checked'%>, ">"]
|
50
|
-
[ "APPEND"]
|
51
|
-
[ "</span>\n"]
|
52
|
-
[ "</p>\n"]
|
53
|
-
[ "<p>\n"]
|
54
|
-
[ <%=expr%>]
|
55
|
-
[ " <span class=\"foo\">", <%=expr%>, "</span>\n"]
|
56
|
-
[ "</p>\n"]
|
57
|
-
[ "<p>\n"]
|
58
|
-
"if x > 0 then"
|
59
|
-
[ ]
|
60
|
-
[ "positive"]
|
61
|
-
[ ]
|
62
|
-
"elsif x < 0 then"
|
63
|
-
[ ]
|
64
|
-
[ "negative"]
|
65
|
-
[ ]
|
66
|
-
"else"
|
67
|
-
[ ]
|
68
|
-
[ "zero"]
|
69
|
-
[ ]
|
70
|
-
"end"
|
71
|
-
[ "</p>\n"]
|
72
|
-
|
73
|
-
output: |
|
74
292
|
|
75
293
|
###
|
76
294
|
#- name: span2
|
@@ -95,33 +313,46 @@
|
|
95
313
|
# }
|
96
314
|
#
|
97
315
|
# expected: |
|
98
|
-
#
|
99
|
-
#
|
100
|
-
#
|
101
|
-
#
|
102
|
-
#
|
103
|
-
#
|
104
|
-
#
|
105
|
-
#
|
106
|
-
#
|
107
|
-
#
|
108
|
-
#
|
316
|
+
# print("<p>\n")
|
317
|
+
# print()
|
318
|
+
# print(<%=title1%>)
|
319
|
+
# print()
|
320
|
+
# print(" <span class=\"", <%=name%>, "\">")
|
321
|
+
# print(<%=title2%>)
|
322
|
+
# print("</span>\n")
|
323
|
+
# print(" <span", <%=' checked="checked"'%>, ">")
|
324
|
+
# print(<%=title3%>)
|
325
|
+
# print("</span>\n")
|
326
|
+
# print("</p>\n")
|
109
327
|
#
|
110
328
|
#
|
111
329
|
# output: |
|
112
330
|
#
|
113
331
|
|
114
332
|
|
115
|
-
|
333
|
+
###
|
116
334
|
- name: unmatched
|
117
335
|
desc: unmatched text to fetch pattern
|
118
336
|
bug: self found
|
119
|
-
pdata
|
337
|
+
pdata*:
|
338
|
+
eruby: &unmatched_pdata |
|
120
339
|
foo
|
121
340
|
bar
|
122
341
|
baz
|
123
|
-
|
124
|
-
|
125
|
-
|
342
|
+
php: *unmatched_pdata
|
343
|
+
jstl: *unmatched_pdata
|
344
|
+
eperl: *unmatched_pdata
|
345
|
+
|
346
|
+
plogic*:
|
347
|
+
eruby: |
|
348
|
+
php: |
|
349
|
+
jstl: |
|
350
|
+
eperl: |
|
126
351
|
|
352
|
+
expected*:
|
353
|
+
eruby: &unmatched_expected |
|
354
|
+
print("foo\nbar\nbaz\n")
|
355
|
+
php: *unmatched_expected
|
356
|
+
jstl: *unmatched_expected
|
357
|
+
eperl: *unmatched_expected
|
127
358
|
|