Changeset 1171
- Timestamp:
- 2008-09-19 20:21:28 (4 months ago)
- Files:
-
- trunk/lib/parser/lib/parser.rb (modified) (1 diff)
- trunk/lib/parser/lib/rules/zafu.rb (modified) (1 diff)
- trunk/lib/parser/test/parser/zafu.yml (modified) (2 diffs)
- trunk/test/helpers/zena_parser/ajax.yml (modified) (1 diff)
- trunk/test/helpers/zena_parser/basic.yml (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/lib/parser/lib/parser.rb
r1085 r1171 124 124 # Hook called when replacing part of an included template with '<r:with part='main'>...</r:with>' 125 125 def replace_with(obj) 126 @method = 'void' # (replacer's method is always 'with')126 # keep @method (obj's method is always 'with') 127 127 @blocks = obj.blocks.empty? ? @blocks : obj.blocks 128 128 @params = obj.params.empty? ? @params : obj.params trunk/lib/parser/lib/rules/zafu.rb
r1124 r1171 295 295 if $1 != @end_tag 296 296 # error bad closing rtag 297 store "<span class='parser_error'>#{$&.gsub('<', '<').gsub('>','>')} </span>"297 store "<span class='parser_error'>#{$&.gsub('<', '<').gsub('>','>')} should be </#{@end_tag}></span>" 298 298 end 299 299 leave trunk/lib/parser/test/parser/zafu.yml
r1155 r1171 53 53 very_messy: 54 54 src: "this <r: blah> </r:truc> whak" 55 res: "this <r: blah> <span class='parser_error'></r:truc> </span> whak"55 res: "this <r: blah> <span class='parser_error'></r:truc> should be </r:void></span> whak" 56 56 57 57 bad_closing_tag: 58 58 src: "this <r:test>looks </r:truc> ok" 59 res: "this [test]looks <span class='parser_error'></r:truc> </span>[/test] ok"59 res: "this [test]looks <span class='parser_error'></r:truc> should be </r:test></span>[/test] ok" 60 60 61 61 do_tag: … … 142 142 res: "named_with_do: [test {> :name=>'branding'}]<p id='branding'>...</p>[/test]" 143 143 144 include_named_keep_method: 145 src: "IKM: <r:include template='/named/with/do'><r:with part='branding'>blah</r:with></r:include>" 146 res: "IKM: named_with_do: [test {= :part=>'branding'} {> :name=>'branding'}]<p id='branding'>blah</p>[/test]" 147 144 148 include_set_method: 145 src: "I KD: <r:include template='/named/with/do'><r:with part='branding' method='hello'>blah</r:with></r:include>"146 res: "I KD: named_with_do: <p id='branding'>hello world!</p>"149 src: "ISM: <r:include template='/named/with/do'><r:with part='branding' method='hello'>blah</r:with></r:include>" 150 res: "ISM: named_with_do: <p id='branding'>hello world!</p>" 147 151 148 152 include_part: trunk/test/helpers/zena_parser/ajax.yml
r1154 r1171 199 199 src: "<r:pages><li do='each'><span do='swap' attr='d_status' states='todo,done,alert'/></li></r:pages>" 200 200 tem: "/<li id='list1_<%= var1.zip %>'><span>.*var1.can_write?.*tag_to_remote.*else.*var1.version.dyn\[\"status\"\]/" 201 202 update_target: 203 src: "UT: <div id='foo' do='block'>...</div> <r:link update='foo'/>" 204 tem: "/UT: <div id='foo'>...</div><%= tag_to_remote.*dom_id=foo.*</a>/" 205 206 include_update_target: 207 src: "IUT: <r:include template='/update/target'><r:with part='foo'><r:show attr='name'/></r:with></r:include>" 208 tem: "/IUT: UT: <div id='foo'><%= @node.name %></div><%= tag_to_remote.*dom_id=foo.*</a>" 209 trunk/test/helpers/zena_parser/basic.yml
r1168 r1171 777 777 778 778 include_with: 779 src: "include_with: <r:include template='/name/title'><h1 do='with' part='title' do='show'attr='id'/>"779 src: "include_with: <r:include template='/name/title'><h1 do='with' part='title' attr='id'/>" 780 780 res: "include_with: title: <h1 id='lala'>22</h1>" 781 781
