Changeset 260
- Timestamp:
- 03/10/2008 14:07:59 (8 months ago)
- Location:
- branches/superredcloth/ext/superredcloth_scan
- Files:
-
- 2 modified
-
superredcloth.h (modified) (1 diff)
-
superredcloth_scan.rl (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/superredcloth/ext/superredcloth_scan/superredcloth.h
r258 r260 35 35 regs = rb_hash_new() 36 36 #define ADD_EXTENDED_BLOCK() rb_str_append(html, red_block(rb_formatter, regs, block, refs)); CLEAR(block); 37 #define END_EXTENDED() extend = Qnil; regs = rb_hash_new(); 37 38 #define ADD_BLOCKCODE() rb_str_append(html, red_blockcode(rb_formatter, regs, block)); CLEAR(block); regs = rb_hash_new() 38 39 #define ADD_EXTENDED_BLOCKCODE() rb_str_append(html, red_blockcode(rb_formatter, regs, block)); CLEAR(block); -
branches/superredcloth/ext/superredcloth_scan/superredcloth_scan.rl
r258 r260 33 33 btype = ( "p" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "div" ) ; 34 34 block_start = ( btype >A %{ STORE(type) } A C :> "." ( "." %extend | "" ) " "+ ) ; 35 next_block_start = ( btype A C :> "." );35 next_block_start = ( btype A C :> "."+ " " ) >A @{ p = reg - 1; } ; 36 36 double_return = CRLF{2,} ; 37 37 block_end = ( double_return | EOF ); 38 extended_block_end = double_return . next_block_start >A @{ p = reg - 1; } ;39 38 ftype = ( "fn" >A %{ STORE(type) } digit+ >A %{ STORE(id) } ) ; 40 39 footnote_start = ( ftype A C :> dotspace ) ; … … 75 74 pre_block := |* 76 75 EOF { ADD_BLOCKCODE(); fgoto main; }; 77 extended_block_end { ADD_BLOCKCODE(); fgoto main; };78 76 double_return { if (NIL_P(extend)) { ADD_BLOCKCODE(); fgoto main; } else { ADD_EXTENDED_BLOCKCODE(); } }; 77 next_block_start { END_EXTENDED(); fgoto main; }; 79 78 default => esc_pre; 80 79 *|; … … 87 86 notextile_block := |* 88 87 EOF { DONE(block); fgoto main; }; 89 extended_block_end { DONE(block); fgoto main; };90 88 double_return { if (NIL_P(extend)) { DONE(block); fgoto main; } else { DONE(block); } }; 89 next_block_start { END_EXTENDED(); fgoto main; }; 91 90 default => cat; 92 91 *|; … … 99 98 bc := |* 100 99 EOF { ADD_BLOCKCODE(); INLINE(html, bc_close); plain_block = rb_str_new2("p"); fgoto main; }; 101 extended_block_end { ADD_BLOCKCODE(); INLINE(html, bc_close); plain_block = rb_str_new2("p"); fgoto main; };102 100 double_return { if (NIL_P(extend)) { ADD_BLOCKCODE(); INLINE(html, bc_close); plain_block = rb_str_new2("p"); fgoto main; } else { ADD_EXTENDED_BLOCKCODE(); } }; 101 next_block_start { INLINE(html, bc_close); plain_block = rb_str_new2("p"); END_EXTENDED(); fgoto main; }; 103 102 default => esc_pre; 104 103 *|; … … 106 105 bq := |* 107 106 EOF { ADD_BLOCK(); INLINE(html, bq_close); fgoto main; }; 108 extended_block_end { ADD_BLOCK(); INLINE(html, bq_close); fgoto main; };109 107 double_return { if (NIL_P(extend)) { ADD_BLOCK(); INLINE(html, bq_close); fgoto main; } else { ADD_EXTENDED_BLOCK(); } }; 110 108 default => cat; 109 next_block_start { INLINE(html, bq_close); END_EXTENDED(); fgoto main; }; 111 110 *|; 112 111 113 112 block := |* 114 113 EOF { ADD_BLOCK(); fgoto main; }; 115 extended_block_end { ADD_BLOCK(); fgoto main; };116 114 double_return { if (NIL_P(extend)) { ADD_BLOCK(); fgoto main; } else { ADD_EXTENDED_BLOCK(); } }; 115 next_block_start { END_EXTENDED(); fgoto main; }; 117 116 default => cat; 118 117 *|;