Class: CodeRay::Encoders::DebugLint

### Home Classes Methods

### In Files

- lib/coderay/encoders/debug_lint.rb

### Parent

CodeRay::Encoders::Debug

### Methods

- #begin_group
- #begin_line
- #end_group
- #end_line
- #finish
- #setup
- #text_token

### Class/Module Index

Quicksearch

- CodeRay
- CodeRay::Duo
- CodeRay::Encoders
- CodeRay::Encoders::CommentFilter
- CodeRay::Encoders::Count
- CodeRay::Encoders::Debug
- CodeRay::Encoders::DebugLint
- CodeRay::Encoders::Div
- CodeRay::Encoders::Encoder
- CodeRay::Encoders::Filter
- CodeRay::Encoders::HTML
- CodeRay::Encoders::HTML::Output
- CodeRay::Encoders::JSON
- CodeRay::Encoders::LinesOfCode
- CodeRay::Encoders::Lint
- CodeRay::Encoders::Null
- CodeRay::Encoders::Page
- CodeRay::Encoders::Span
- CodeRay::Encoders::Statistic
- CodeRay::Encoders::Terminal
- CodeRay::Encoders::Text
- CodeRay::Encoders::TokenKindFilter
- CodeRay::Encoders::XML
- CodeRay::Encoders::YAML
- CodeRay::FileType
- CodeRay::ForRedCloth
- CodeRay::Plugin
- CodeRay::PluginHost
- CodeRay::Scanners
- CodeRay::Scanners::C
- CodeRay::Scanners::CPlusPlus
- CodeRay::Scanners::CSS
- CodeRay::Scanners::Clojure
- CodeRay::Scanners::Debug
- CodeRay::Scanners::Delphi
- CodeRay::Scanners::Diff
- CodeRay::Scanners::ERB
- CodeRay::Scanners::Go
- CodeRay::Scanners::Groovy
- CodeRay::Scanners::HAML
- CodeRay::Scanners::HTML
- CodeRay::Scanners::JSON
- CodeRay::Scanners::Java
- CodeRay::Scanners::JavaScript
- CodeRay::Scanners::Python
- CodeRay::Scanners::Raydebug
- CodeRay::Scanners::Ruby
- CodeRay::Scanners::SQL
- CodeRay::Scanners::Sass
- CodeRay::Scanners::Scanner
- CodeRay::Scanners::Taskpaper
- CodeRay::Scanners::Text
- CodeRay::Scanners::XML
- CodeRay::Scanners::YAML
- CodeRay::Styles
- CodeRay::Styles::Alpha
- CodeRay::Styles::Style
- CodeRay::Tokens
- CodeRay::TokensProxy
- CodeRay::WordList
- CodeRay::WordList::CaseIgnoring

No matching classes.

# CodeRay::Encoders::DebugLint

# Debug Lint Encoder

Debug encoder with additional checks for:

- empty tokens

- incorrect nesting

It will raise an InvalidTokenStream exception when any of the above occurs.

See also: Encoders::Debug

### Public Instance Methods

begin_group(kind) click to toggle source

    # File lib/coderay/encoders/debug_lint.rb, line 26
    def begin_group kind
      @opened << kind
      super
    end

begin_line(kind) click to toggle source

    # File lib/coderay/encoders/debug_lint.rb, line 37
    def begin_line kind
      @opened << kind
      super
    end

end_group(kind) click to toggle source

    # File lib/coderay/encoders/debug_lint.rb, line 31
    def end_group kind
      raise Lint::IncorrectTokenGroupNesting, 'We are inside %s, not %p (end_group)' % [@opened.reverse.map(&:inspect).join(' < '), kind] if @opened.last != kind
      @opened.pop
      super
    end

end_line(kind) click to toggle source

    # File lib/coderay/encoders/debug_lint.rb, line 42
    def end_line kind
      raise Lint::IncorrectTokenGroupNesting, 'We are inside %s, not %p (end_line)' % [@opened.reverse.map(&:inspect).join(' < '), kind] if @opened.last != kind
      @opened.pop
      super
    end

text_token(text, kind) click to toggle source

    # File lib/coderay/encoders/debug_lint.rb, line 20
    def text_token text, kind
      raise Lint::EmptyToken,       'empty token for %p' % [kind] if text.empty?
      raise Lint::UnknownTokenKind, 'unknown token kind %p (text was %p)' % [kind, text] unless TokenKinds.has_key? kind
      super
    end

### Protected Instance Methods

finish(options) click to toggle source

    # File lib/coderay/encoders/debug_lint.rb, line 55
    def finish options
      raise 'Some tokens still open at end of token stream: %p' % [@opened] unless @opened.empty?
      super
    end

setup(options) click to toggle source

    # File lib/coderay/encoders/debug_lint.rb, line 50
    def setup options
      super
      @opened = []
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.