Class: MaRuKu::In::Markdown::SpanLevelParser::CharSourceDebug

### Home Classes Methods

### In Files

- lib/maruku/input/charsource.rb

### Parent

Object

### Methods

- ::new
- #method_missing

### Class/Module Index

Quicksearch

- MaRuKu
- MaRuKu::Errors
- MaRuKu::Exception
- MaRuKu::Helpers
- MaRuKu::In
- MaRuKu::In::Markdown
- MaRuKu::In::Markdown::BlockLevelParser
- MaRuKu::In::Markdown::BlockLevelParser::BlockContext
- MaRuKu::In::Markdown::BlockLevelParser::LineSource
- MaRuKu::In::Markdown::SpanExtension
- MaRuKu::In::Markdown::SpanLevelParser
- MaRuKu::In::Markdown::SpanLevelParser::CharSourceDebug
- MaRuKu::In::Markdown::SpanLevelParser::CharSourceManual
- MaRuKu::In::Markdown::SpanLevelParser::CharSourceStrscan
- MaRuKu::In::Markdown::SpanLevelParser::HTMLHelper
- MaRuKu::In::Markdown::SpanLevelParser::SpanContext
- MaRuKu::MDDocument
- MaRuKu::MDElement
- MaRuKu::Out
- MaRuKu::Out::HTML
- MaRuKu::Out::Latex
- MaRuKu::Out::Latex::LatexEntity
- MaRuKu::Out::Markdown
- MaRuKu::Section
- MaRuKu::Strings
- MaRuKu::Tests
- Array
- Hash
- Maruku
- Module
- NilClass
- Object
- String
- Textile2Signature

No matching classes.

# MaRuKu::In::Markdown::SpanLevelParser::CharSourceDebug

A debug scanner that checks the correctness of both by comparing their output

### Public Class Methods

new(s, parent) click to toggle source

    # File lib/maruku/input/charsource.rb, line 277
    def initialize(s, parent)
            @a = CharSourceManual.new(s, parent)
            @b = CharSourceStrscan.new(s, parent)
    end

### Public Instance Methods

method_missing(methodname, *args) click to toggle source

    # File lib/maruku/input/charsource.rb, line 282
            def method_missing(methodname, *args)
                    a_bef = @a.describe
                    b_bef = @b.describe

                    a = @a.send(methodname, *args)
                    b = @b.send(methodname, *args)

    #               if methodname == :describe
    #                       return a
    #               end

                    if a.kind_of? MatchData
                            if a.to_a != b.to_a
                                    puts "called: #{methodname}(#{args})"
                                    puts "Matchdata:\na = #{a.to_a.inspect}\nb = #{b.to_a.inspect}"
                                    puts "AFTER: "+@a.describe
                                    puts "AFTER: "+@b.describe
                                    puts "BEFORE: "+a_bef
                                    puts "BEFORE: "+b_bef
                                    puts caller.join("\n")
                                    exit
                            end
                    else
                            if a!=b
                                    puts "called: #{methodname}(#{args})"
                                    puts "Attenzione!\na = #{a.inspect}\nb = #{b.inspect}"
                                    puts ""+@a.describe
                                    puts ""+@b.describe
                                    puts caller.join("\n")
                                    exit
                            end
                    end

                    if @a.cur_char != @b.cur_char
                            puts "Fuori sincronia dopo #{methodname}(#{args})"
                            puts ""+@a.describe
                            puts ""+@b.describe
                            exit
                    end

                    return a
            end

[Validate]

Generated with the Darkfish Rdoc Generator 2.