Class: Textpow::DebugProcessor

### Home Classes Methods

### In Files

- lib/textpow/debug_processor.rb

### Parent

Object

### Methods

- ::new
- #close_tag
- #end_parsing
- #new_line
- #open_tag
- #pprint
- #start_parsing

### Class/Module Index

Quicksearch

- Textpow
- Textpow::DebugProcessor
- Textpow::ParsingError
- Textpow::RecordingProcessor
- Textpow::ScoreManager
- Textpow::SyntaxNode
- Textpow::SyntaxProxy

No matching classes.

# Textpow::DebugProcessor

### Public Class Methods

new() click to toggle source

    # File lib/textpow/debug_processor.rb, line 3
    def initialize
      @line_number = 0
      @printable_line = ""
    end

### Public Instance Methods

close_tag(name, position) click to toggle source

    # File lib/textpow/debug_processor.rb, line 18
    def close_tag name, position
      STDERR.puts pprint( "", "}#{name}", position + @line_marks.size)
    end

end_parsing(name) click to toggle source

    # File lib/textpow/debug_processor.rb, line 32
    def end_parsing name
      STDERR.puts "}#{name}"
    end

new_line(line) click to toggle source

    # File lib/textpow/debug_processor.rb, line 22
    def new_line line
      @line_number += 1
      @line_marks = "[#{@line_number.to_s.rjust( 4, '0' )}] "
      STDERR.puts "#{@line_marks}#{line}"
    end

open_tag(name, position) click to toggle source

    # File lib/textpow/debug_processor.rb, line 14
    def open_tag name, position
      STDERR.puts pprint( "", "{#{name}", position + @line_marks.size)
    end

pprint(line, string, position = 0) click to toggle source

    # File lib/textpow/debug_processor.rb, line 8
    def pprint line, string, position = 0
      line.replace line.ljust( position + string.size, " ")
      line[position,string.size] = string
      line
    end

start_parsing(name) click to toggle source

    # File lib/textpow/debug_processor.rb, line 28
    def start_parsing name
      STDERR.puts "{#{name}"
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.