$27 GRAYBYTE WORDPRESS FILE MANAGER $87

SERVER : premium201.web-hosting.com #1 SMP Wed Mar 26 12:08:09 UTC 2025
SERVER IP : 172.67.217.254 | ADMIN IP 216.73.216.23
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/opt/alt/ruby21/lib64/ruby/2.1.0/rdoc/

HOME
Current File : /opt/alt/ruby21/lib64/ruby/2.1.0/rdoc//token_stream.rb
##
# A TokenStream is a list of tokens, gathered during the parse of some entity
# (say a method). Entities populate these streams by being registered with the
# lexer. Any class can collect tokens by including TokenStream. From the
# outside, you use such an object by calling the start_collecting_tokens
# method, followed by calls to add_token and pop_token.

module RDoc::TokenStream

  ##
  # Converts +token_stream+ to HTML wrapping various tokens with
  # <tt><span></tt> elements.  The following tokens types are wrapped in spans
  # with the given class names:
  #
  # TkCONSTANT :: 'ruby-constant'
  # TkKW       :: 'ruby-keyword'
  # TkIVAR     :: 'ruby-ivar'
  # TkOp       :: 'ruby-operator'
  # TkId       :: 'ruby-identifier'
  # TkNode     :: 'ruby-node'
  # TkCOMMENT  :: 'ruby-comment'
  # TkREGEXP   :: 'ruby-regexp'
  # TkSTRING   :: 'ruby-string'
  # TkVal      :: 'ruby-value'
  #
  # Other token types are not wrapped in spans.

  def self.to_html token_stream
    token_stream.map do |t|
      next unless t

      style = case t
              when RDoc::RubyToken::TkCONSTANT then 'ruby-constant'
              when RDoc::RubyToken::TkKW       then 'ruby-keyword'
              when RDoc::RubyToken::TkIVAR     then 'ruby-ivar'
              when RDoc::RubyToken::TkOp       then 'ruby-operator'
              when RDoc::RubyToken::TkId       then 'ruby-identifier'
              when RDoc::RubyToken::TkNode     then 'ruby-node'
              when RDoc::RubyToken::TkCOMMENT  then 'ruby-comment'
              when RDoc::RubyToken::TkREGEXP   then 'ruby-regexp'
              when RDoc::RubyToken::TkSTRING   then 'ruby-string'
              when RDoc::RubyToken::TkVal      then 'ruby-value'
              end

      text = CGI.escapeHTML t.text

      if style then
        "<span class=\"#{style}\">#{text}</span>"
      else
        text
      end
    end.join
  end

  ##
  # Adds +tokens+ to the collected tokens

  def add_tokens(*tokens)
    tokens.flatten.each { |token| @token_stream << token }
  end

  alias add_token add_tokens

  ##
  # Starts collecting tokens

  def collect_tokens
    @token_stream = []
  end

  alias start_collecting_tokens collect_tokens

  ##
  # Remove the last token from the collected tokens

  def pop_token
    @token_stream.pop
  end

  ##
  # Current token stream

  def token_stream
    @token_stream
  end

  ##
  # Returns a string representation of the token stream

  def tokens_to_s
    token_stream.map { |token| token.text }.join ''
  end

end



Current_dir [ NOT WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
3 Mar 2024 10.53 PM
root / root
0755
context
--
3 Mar 2024 10.43 PM
root / linksafe
0755
generator
--
3 Mar 2024 10.43 PM
root / linksafe
0755
markdown
--
3 Mar 2024 10.43 PM
root / linksafe
0755
markup
--
3 Mar 2024 10.43 PM
root / linksafe
0755
parser
--
3 Mar 2024 10.43 PM
root / linksafe
0755
rd
--
3 Mar 2024 10.43 PM
root / linksafe
0755
ri
--
3 Mar 2024 10.43 PM
root / linksafe
0755
stats
--
3 Mar 2024 10.43 PM
root / linksafe
0755
alias.rb
2.093 KB
27 Nov 2012 4.28 AM
root / linksafe
0644
anon_class.rb
0.139 KB
27 Nov 2012 4.28 AM
root / linksafe
0644
any_method.rb
6.821 KB
18 Sep 2013 11.33 PM
root / linksafe
0644
attr.rb
3.729 KB
23 Jan 2013 1.02 AM
root / linksafe
0644
class_module.rb
19.727 KB
18 Sep 2013 11.33 PM
root / linksafe
0644
code_object.rb
9.378 KB
18 Sep 2013 11.33 PM
root / linksafe
0644
code_objects.rb
0.118 KB
27 Nov 2012 4.28 AM
root / linksafe
0644
comment.rb
5.29 KB
18 Sep 2013 11.33 PM
root / linksafe
0644
constant.rb
3.547 KB
3 Dec 2013 3.18 AM
root / linksafe
0644
context.rb
28.756 KB
18 Sep 2013 11.33 PM
root / linksafe
0644
cross_reference.rb
5.823 KB
18 Sep 2013 11.33 PM
root / linksafe
0644
encoding.rb
2.744 KB
18 Dec 2012 8.24 AM
root / linksafe
0644
erb_partial.rb
0.361 KB
27 Nov 2012 4.28 AM
root / linksafe
0644
erbio.rb
0.775 KB
15 May 2011 11.55 AM
root / linksafe
0644
extend.rb
0.137 KB
18 Sep 2013 11.33 PM
root / linksafe
0644
generator.rb
1.723 KB
27 Nov 2012 4.28 AM
root / linksafe
0644
ghost_method.rb
0.111 KB
27 Nov 2012 4.28 AM
root / linksafe
0644
include.rb
0.139 KB
18 Sep 2013 11.33 PM
root / linksafe
0644
known_classes.rb
2.628 KB
18 Sep 2013 11.33 PM
root / linksafe
0644
markdown.rb
370.007 KB
19 Sep 2013 7.22 AM
root / linksafe
0644
markup.rb
28.218 KB
18 Sep 2013 11.33 PM
root / linksafe
0644
meta_method.rb
0.097 KB
27 Nov 2012 4.28 AM
root / linksafe
0644
method_attr.rb
8.783 KB
18 Sep 2013 11.33 PM
root / linksafe
0644
mixin.rb
2.723 KB
18 Sep 2013 11.33 PM
root / linksafe
0644
normal_class.rb
2.104 KB
18 Sep 2013 11.33 PM
root / linksafe
0644
normal_module.rb
1.403 KB
18 Sep 2013 11.33 PM
root / linksafe
0644
options.rb
29.695 KB
18 Sep 2013 11.33 PM
root / linksafe
0644
parser.rb
8.059 KB
3 Dec 2013 12.42 AM
root / linksafe
0644
rd.rb
3.538 KB
27 Nov 2012 4.28 AM
root / linksafe
0644
rdoc.rb
13.4 KB
18 Sep 2013 11.33 PM
root / linksafe
0644
require.rb
0.913 KB
27 Nov 2012 4.28 AM
root / linksafe
0644
ri.rb
0.308 KB
27 Nov 2012 4.28 AM
root / linksafe
0644
ruby_lex.rb
27.706 KB
19 Nov 2013 12.47 AM
root / linksafe
0644
ruby_token.rb
11.28 KB
18 Sep 2013 11.33 PM
root / linksafe
0644
rubygems_hook.rb
5.165 KB
18 Nov 2013 8.55 PM
root / linksafe
0644
servlet.rb
11.837 KB
18 Sep 2013 11.33 PM
root / linksafe
0644
single_class.rb
0.322 KB
27 Nov 2012 4.28 AM
root / linksafe
0644
stats.rb
10.366 KB
18 Sep 2013 11.33 PM
root / linksafe
0644
store.rb
22.369 KB
19 Nov 2013 12.51 AM
root / linksafe
0644
task.rb
7.66 KB
27 Nov 2012 4.28 AM
root / linksafe
0644
test_case.rb
4.145 KB
22 Nov 2013 2.06 AM
root / linksafe
0644
text.rb
7.603 KB
17 Feb 2015 3.18 PM
root / linksafe
0644
token_stream.rb
2.465 KB
27 Nov 2012 4.28 AM
root / linksafe
0644
tom_doc.rb
6.263 KB
18 Sep 2013 11.33 PM
root / linksafe
0644
top_level.rb
5.41 KB
18 Sep 2013 11.33 PM
root / linksafe
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025 CONTACT ME
Static GIF