Changeset 274

Show
Ignore:
Timestamp:
03/17/2008 12:03:39 (8 months ago)
Author:
why
Message:

Further name changes, to get tests all working.

Location:
trunk
Files:
4 modified
4 moved

Legend:

Unmodified
Added
Removed
  • trunk/ext/redcloth_scan/extconf.rb

    r272 r274  
    33$CFLAGS << " -O0 " # do not optimize (takes too much memory and performance gain is negligeable) 
    44 
    5 dir_config("superredcloth_scan") 
     5dir_config("redcloth_scan") 
    66have_library("c", "main") 
    77 
    8 create_makefile("superredcloth_scan") 
     8create_makefile("redcloth_scan") 
  • trunk/ext/redcloth_scan/redcloth.h

    r272 r274  
    1 #ifndef superredcloth_h 
    2 #define superredcloth_h 
     1#ifndef redcloth_h 
     2#define redcloth_h 
    33 
    44/* variable defs */ 
    5 #ifndef superredcloth_scan_c 
     5#ifndef redcloth_scan_c 
    66extern VALUE super_ParseError, super_RedCloth; 
    77extern int SYM_html_escape_entities; 
     
    1111void rb_str_cat_escaped(VALUE str, char *ts, char *te, unsigned int opts); 
    1212void rb_str_cat_escaped_for_preformatted(VALUE str, char *ts, char *te, unsigned int opts); 
    13 VALUE superredcloth_inline(VALUE, char *, char *, VALUE); 
    14 VALUE superredcloth_inline2(VALUE, VALUE, VALUE); 
    15 VALUE superredcloth_transform(VALUE, char *, char *, VALUE); 
    16 VALUE superredcloth_transform2(VALUE, VALUE); 
     13VALUE redcloth_inline(VALUE, char *, char *, VALUE); 
     14VALUE redcloth_inline2(VALUE, VALUE, VALUE); 
     15VALUE redcloth_transform(VALUE, char *, char *, VALUE); 
     16VALUE redcloth_transform2(VALUE, VALUE); 
    1717void red_inc(VALUE, VALUE); 
    1818VALUE red_block(VALUE, VALUE, ID, VALUE); 
     
    5050  } \ 
    5151  if (p > reg && reg >= ts) { \ 
    52     VALUE str = superredcloth_transform(rb_formatter, reg, p, refs); \ 
     52    VALUE str = redcloth_transform(rb_formatter, reg, p, refs); \ 
    5353    rb_hash_aset(regs, ID2SYM(rb_intern(#T)), str); \ 
    5454  /*  printf("TRANSFORM(" #T ") '%s' (p:'%d' reg:'%d')\n", RSTRING(str)->ptr, p, reg);*/  \ 
  • trunk/ext/redcloth_scan/redcloth_common.rl

    r272 r274  
    11%%{ 
    22 
    3   machine superredcloth_common; 
     3  machine redcloth_common; 
    44 
    55  action A { reg = p; } 
  • trunk/ext/redcloth_scan/redcloth_inline.rl

    r272 r274  
    11/* 
    2  * superredcloth_inline.rl 
     2 * redcloth_inline.rl 
    33 * 
    44 * $Author: why $ 
     
    88 */ 
    99#include <ruby.h> 
    10 #include "superredcloth.h" 
     10#include "redcloth.h" 
    1111 
    1212%%{ 
    1313 
    14   machine superredcloth_inline; 
    15   include superredcloth_common "ext/superredcloth_scan/superredcloth_common.rl"; 
     14  machine redcloth_inline; 
     15  include redcloth_common "ext/redcloth_scan/redcloth_common.rl"; 
    1616 
    1717  # common 
     
    135135{ 
    136136  VALUE txt = rb_hash_aref(regs, ref); 
    137   if (!NIL_P(txt)) rb_hash_aset(regs, ref, superredcloth_inline2(rb_formatter, txt, refs)); 
     137  if (!NIL_P(txt)) rb_hash_aset(regs, ref, redcloth_inline2(rb_formatter, txt, refs)); 
    138138  return rb_funcall(rb_formatter, meth, 1, regs); 
    139139} 
     
    166166  if ((RSTRING(block)->len > 0) && !NIL_P(btype)) 
    167167  { 
    168     rb_hash_aset(regs, ID2SYM(rb_intern("text")), superredcloth_inline2(rb_formatter, block, refs)); 
     168    rb_hash_aset(regs, ID2SYM(rb_intern("text")), redcloth_inline2(rb_formatter, block, refs)); 
    169169    block = rb_funcall(rb_formatter, rb_intern(RSTRING(btype)->ptr), 1, regs); 
    170170  } 
     
    195195 
    196196VALUE 
    197 superredcloth_inline(rb_formatter, p, pe, refs) 
     197redcloth_inline(rb_formatter, p, pe, refs) 
    198198  VALUE rb_formatter; 
    199199  char *p, *pe; 
     
    303303 
    304304VALUE 
    305 superredcloth_inline2(formatter, str, refs) 
     305redcloth_inline2(formatter, str, refs) 
    306306  VALUE formatter, str, refs; 
    307307{ 
    308308  StringValue(str); 
    309   return superredcloth_inline(formatter, RSTRING(str)->ptr, RSTRING(str)->ptr + RSTRING(str)->len + 1, refs); 
    310 } 
     309  return redcloth_inline(formatter, RSTRING(str)->ptr, RSTRING(str)->ptr + RSTRING(str)->len + 1, refs); 
     310} 
  • trunk/ext/redcloth_scan/redcloth_scan.rl

    r272 r274  
    11/* 
    2  * superredcloth_scan.rl 
     2 * redcloth_scan.rl 
    33 * 
    44 * $Author: why $ 
     
    77 * Copyright (C) 2007 why the lucky stiff 
    88 */ 
    9 #define superredcloth_scan_c 
     9#define redcloth_scan_c 
    1010 
    1111#include <ruby.h> 
    12 #include "superredcloth.h" 
     12#include "redcloth.h" 
    1313 
    1414VALUE super_ParseError, super_RedCloth, super_HTML, super_LATEX; 
     
    1717%%{ 
    1818 
    19   machine superredcloth_scan; 
    20   include superredcloth_common "ext/superredcloth_scan/superredcloth_common.rl"; 
     19  machine redcloth_scan; 
     20  include redcloth_common "ext/redcloth_scan/redcloth_common.rl"; 
    2121 
    2222  action extend { extend = rb_hash_aref(regs, ID2SYM(rb_intern("type"))); } 
     
    174174 
    175175VALUE 
    176 superredcloth_transform(rb_formatter, p, pe, refs) 
     176redcloth_transform(rb_formatter, p, pe, refs) 
    177177  VALUE rb_formatter; 
    178178  char *p, *pe; 
     
    210210 
    211211  if ( NIL_P(refs) && rb_funcall(refs_found, rb_intern("empty?"), 0) == Qfalse ) { 
    212     return superredcloth_transform(rb_formatter, orig_p, orig_pe, refs_found); 
     212    return redcloth_transform(rb_formatter, orig_p, orig_pe, refs_found); 
    213213  } else { 
    214214    rb_funcall(rb_formatter, rb_intern("after_transform"), 1, html); 
     
    218218 
    219219VALUE 
    220 superredcloth_transform2(formatter, str) 
     220redcloth_transform2(formatter, str) 
    221221  VALUE formatter, str; 
    222222{ 
    223223  rb_str_cat2(str, "\n"); 
    224224  StringValue(str); 
    225   return superredcloth_transform(formatter, RSTRING(str)->ptr, RSTRING(str)->ptr + RSTRING(str)->len + 1, Qnil); 
     225  return redcloth_transform(formatter, RSTRING(str)->ptr, RSTRING(str)->ptr + RSTRING(str)->len + 1, Qnil); 
    226226} 
    227227 
    228228static VALUE 
    229 superredcloth_to_html(self) 
     229redcloth_to_html(self) 
    230230  VALUE self; 
    231231{ 
     
    233233  int len = 0; 
    234234 
    235   return superredcloth_transform2(super_HTML, self); 
     235  return redcloth_transform2(super_HTML, self); 
    236236} 
    237237 
    238238static VALUE 
    239 superredcloth_to_latex(self) 
     239redcloth_to_latex(self) 
    240240  VALUE self; 
    241241{ 
     
    243243  int len = 0; 
    244244 
    245   return superredcloth_transform2(super_LATEX, self); 
     245  return redcloth_transform2(super_LATEX, self); 
    246246} 
    247247 
    248248static VALUE 
    249 superredcloth_to(self, formatter) 
     249redcloth_to(self, formatter) 
    250250  VALUE self, formatter; 
    251251{ 
     
    253253  int len = 0; 
    254254 
    255   return superredcloth_transform2(formatter, self); 
    256 } 
    257  
    258 void Init_superredcloth_scan() 
    259 { 
    260   super_RedCloth = rb_define_class("SuperRedCloth", rb_cString); 
    261   rb_define_method(super_RedCloth, "to_html", superredcloth_to_html, 0); 
    262   rb_define_method(super_RedCloth, "to_latex", superredcloth_to_latex, 0); 
    263   rb_define_method(super_RedCloth, "to", superredcloth_to, 1); 
     255  return redcloth_transform2(formatter, self); 
     256} 
     257 
     258void Init_redcloth_scan() 
     259{ 
     260  super_RedCloth = rb_define_class("RedCloth", rb_cString); 
     261  rb_define_method(super_RedCloth, "to_html", redcloth_to_html, 0); 
     262  rb_define_method(super_RedCloth, "to_latex", redcloth_to_latex, 0); 
     263  rb_define_method(super_RedCloth, "to", redcloth_to, 1); 
    264264  super_ParseError = rb_define_class_under(super_RedCloth, "ParseError", rb_eException); 
    265265  super_HTML  = rb_define_module_under(super_RedCloth, "HTML"); 
  • trunk/lib/redcloth/html.rb

    r272 r274  
    1 class << SuperRedCloth::HTML 
     1class << RedCloth::HTML 
    22  def options 
    33    {:html_escape_entities => true} 
  • trunk/lib/redcloth/latex.rb

    r272 r274  
    1 class << SuperRedCloth::LATEX 
     1class << RedCloth::LATEX 
    22  def options 
    33    {:html_escape_entities => false} 
  • trunk/test/helper.rb

    r272 r274  
    11require 'test/unit' 
    22$:.unshift File.dirname(__FILE__) + "/../lib" 
    3 require 'superredcloth' 
     3require 'redcloth' 
    44require 'yaml' 
    55 
    66def red(formatter, str) 
    7   SuperRedCloth.new(str).send("to_#{formatter}") 
     7  RedCloth.new(str).send("to_#{formatter}") 
    88end 
    99