Example #1
0
        public Config(Writer writer, Format fmt, GetConfig get_new_config)
        {
            m_fmt = fmt;

            m_get_new_config = get_new_config ?? no_new_config;

            file = new VectFormatter(writer);
            file.seperator          = fmt.line_spacing > 0 ? "" : " ";
            file.seperator_spacing  = fmt.line_spacing;
            file.footer_spacing     = 1;

            top_vect = new_vect(writer, fmt.format_vect, "#(", "TV");
            vect     = new_vect(writer, fmt.format_vect, "#(", "V");
            vect_cdr = new_vect(writer, fmt.format_vect, " . #(", "-V");

            cons      = new_cons(writer, fmt.do_abbrev, true, "C");
            top_cons  = new_cons(writer, fmt.do_abbrev, true, "TC");
            vect_cons = new_cons(writer, fmt.do_abbrev, fmt.format_vect, "VC");
            head_cons = new_cons(writer, fmt.do_abbrev, fmt.format_head, "HC");

            vect_cons_cdr = new_cons_cdr(writer, fmt.format_vect, fmt.dot_cdr, fmt.dot_nil, "-VC");
            head_cons_cdr = new_cons_cdr(writer, fmt.format_head, fmt.dot_cdr, fmt.dot_nil, "-HC");
            appl_cons_cdr = new_cons_cdr(writer, fmt.format_appl, fmt.dot_cdr, fmt.dot_nil, "-AC");
            data_cons_cdr = new_cons_cdr(writer, fmt.format_data, fmt.dot_cdr, fmt.dot_nil, "-DC");

            atom = new AtomFormatter(writer);

            atom_cdr = new AtomFormatter(writer);
            atom_cdr.header = " . ";
        }
Example #2
0
        ConsFormatter new_cons_cdr(Writer writer, bool format, bool dot_cdr, bool dot_nil, string db)
        {
            ConsFormatter f = new ConsFormatter(writer);

            f.header_spacing = format ? 1 : 0;

            string delimiter = format ? "" : " ";

            if (dot_cdr) {
                f.header = debug_str(db) + delimiter + ". (";
                f.footer = ")";
            } else {
                f.header = debug_str(db) + delimiter;
            }

            if (dot_nil) {
                f.nil_cdr = debug_str(db) + " . ()";
            }

            return f;
        }
Example #3
0
 internal ConsWriter(ConsFormatter formatter, Config config, bool is_abbrev_body)
 {
     m_formatter = formatter;
     m_config = config;
     m_is_abbrev_body = is_abbrev_body;
 }
Example #4
0
        ConsFormatter new_cons(Writer writer, bool do_abbrev, bool do_indent, string db)
        {
            ConsFormatter f = new ConsFormatter(writer);

            f.do_abbrev = do_abbrev;
            f.do_indent = do_indent;
            f.header    = debug_str(db) + "(";
            f.footer    = ")";

            return f;
        }
Example #5
0
 internal ConsWriter(ConsFormatter formatter, Config config)
     : this(formatter, config, false)
 {
 }