Class: Rouge::Lexers::IRBLexer

Inherits:
ConsoleLexer show all
Defined in:
lib/rouge/lexers/irb.rb

Constant Summary

Constants included from Token::Tokens

Token::Tokens::Num, Token::Tokens::Str

Instance Attribute Summary

Attributes inherited from Rouge::Lexer

#options

Instance Method Summary collapse

Methods inherited from ConsoleLexer

#comment_regex, #end_chars, #initialize, #line_regex, #process_line, #prompt_prefix_regex, #stream_tokens

Methods inherited from Rouge::Lexer

aliases, all, #as_bool, #as_lexer, #as_list, #as_string, #as_token, assert_utf8!, #bool_option, debug_enabled?, demo, demo_file, desc, detect?, disable_debug!, enable_debug!, filenames, find, find_fancy, guess, guess_by_filename, guess_by_mimetype, guess_by_source, guesses, #hash_option, #initialize, lex, #lex, #lexer_option, #list_option, mimetypes, option, option_docs, #reset!, #stream_tokens, #string_option, tag, #tag, title, #token_option

Methods included from Token::Tokens

token

Constructor Details

This class inherits a constructor from Rouge::Lexers::ConsoleLexer

Instance Method Details

#allow_comments?Boolean

Returns:

  • (Boolean)


28
29
30
# File 'lib/rouge/lexers/irb.rb', line 28

def allow_comments?
  true
end

#lang_lexerObject



20
21
22
# File 'lib/rouge/lexers/irb.rb', line 20

def lang_lexer
  @lang_lexer ||= Ruby.new(@options)
end

#output_lexerObject



16
17
18
# File 'lib/rouge/lexers/irb.rb', line 16

def output_lexer
  @output_lexer ||= IRBOutputLexer.new(@options)
end

#prompt_regexObject



24
25
26
# File 'lib/rouge/lexers/irb.rb', line 24

def prompt_regex
  /^.*?(irb|pry).*?[>"*]/
end