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::AttributeList
- MaRuKu::Errors
- MaRuKu::Exception
- MaRuKu::HTMLElement
- MaRuKu::HTMLFragment
- 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::MDHTMLElement
- MaRuKu::MDLine
- MaRuKu::NokogiriHTMLFragment
- MaRuKu::Out
- MaRuKu::Out::EntityTable
- MaRuKu::Out::HTML
- MaRuKu::Out::HTML::HTMLElement
- MaRuKu::Out::Latex
- MaRuKu::Out::Latex::MDDocumentExtensions
- MaRuKu::Out::Markdown
- MaRuKu::REXMLHTMLFragment
- MaRuKu::Section
- MaRuKu::Strings
- Maruku
- Maruku::In
- Maruku::In::Markdown
- Maruku::In::Markdown::FencedCode
- 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 235
    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 240
    def method_missing(methodname, *args)
      a_bef = @a.describe
      b_bef = @b.describe

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

      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.