rdoc 6.0.0.beta2 → 6.0.0.beta3

This diff has not been reviewed by any users.
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 79f073ce205804f7cb64ae64f2918b47aa208b80
4
- data.tar.gz: 3c5c07e3985797e49ec9d43e3f68ac2b0246061a
2
+ SHA256:
3
+ metadata.gz: 2f0664803866527a745f0bd9497407b3fb2efecff918b205368ad1c429a63954
4
+ data.tar.gz: 98336bc89aab5c3b779b518a8a51b5dd4d48fbc9c592cf5b57b41d8876c725e1
5
5
  SHA512:
6
- metadata.gz: cdecae483f5d749fed6339751c6ba2f28cd5c608024ead2d24ca20635548ecb9df5dc44c8a04f2052b3c09e9ee9534381960281ed8275042bd4ff9a14fc6aa88
7
- data.tar.gz: 2bbe546d5745c41bce196a253e708e6dca4ed21cd9a0695ee7c61ef1163b6750b6a8648149b3afcfdadde2873af9ba326d1b3c62d9ad29495c92d72100dd1665
6
+ metadata.gz: a4602b0b46be7eec1d5efbdbdb9dc029b6e0bdd074c3a513dae02c9fb227bf9faadc7cbfefb6423531f3b9939116534d3f24ec63c4d48964c96a16607814aa2a
7
+ data.tar.gz: 67e6b12048e14cacf0f96b6480b63acf90348990fc28f1bc34ed7c2df42375c56c3ee44a9ad30ae5f6b7d462ea35b7f1e5ead35b64e80bc077c6ec1dee2bcc66
@@ -3,9 +3,9 @@ before_install:
3
3
  - gem install bundler --no-document
4
4
  language: ruby
5
5
  rvm:
6
- - 2.2.7
7
- - 2.3.4
8
- - 2.4.1
6
+ - 2.2.8
7
+ - 2.3.5
8
+ - 2.4.2
9
9
  - ruby-head
10
10
  - jruby-9.1.13.0
11
11
  env:
@@ -8,7 +8,7 @@ classes for each feature.
8
8
  == Bugs
9
9
 
10
10
  If you think you found a bug, file a ticket on the {issues
11
- tracker}[https://github.com/rdoc/rdoc/issues] on github.
11
+ tracker}[https://github.com/ruby/rdoc/issues] on github.
12
12
 
13
13
  If your bug involves an error RDoc produced please include a sample file that
14
14
  illustrates the problem or link to the repository or gem that is associated
@@ -17,8 +17,8 @@ with the bug.
17
17
  Please include steps to reproduce the issue. Here are some examples of good
18
18
  issues:
19
19
 
20
- * https://github.com/rdoc/rdoc/issues/55
21
- * https://github.com/rdoc/rdoc/issues/61
20
+ * https://github.com/ruby/rdoc/issues/55
21
+ * https://github.com/ruby/rdoc/issues/61
22
22
 
23
23
  == Developer Quick Start
24
24
 
@@ -35,7 +35,7 @@ This will install all the necessary dependencies for development with rake,
35
35
  generate documentation and run the tests for the first time.
36
36
 
37
37
  If the tests don't pass on the first run check the {Travis CI page for
38
- RDoc}[https://travis-ci.org/rdoc/rdoc] to see if there are any known failures
38
+ RDoc}[https://travis-ci.org/ruby/rdoc] to see if there are any known failures
39
39
  (there shouldn't be).
40
40
 
41
41
  You can now use `rake` and `autotest` to run the tests.
@@ -47,7 +47,7 @@ contain just Markup-style markup (with or without leading '#' comment
47
47
  markers). If directory names are passed to RDoc, they are scanned
48
48
  recursively for C and Ruby source files only.
49
49
 
50
- To generate documentation using +rake+ see RDoc::Task[https://rdoc.github.io/rdoc/RDocTask.html].
50
+ To generate documentation using +rake+ see RDoc::Task[https://ruby.github.io/rdoc/RDocTask.html].
51
51
 
52
52
  To generate documentation programmatically:
53
53
 
data/Rakefile CHANGED
@@ -62,11 +62,11 @@ parsed_files = PARSER_FILES.map do |parser_file|
62
62
  if parser_file =~ /\.ry\z/ # need racc
63
63
  racc = Gem.bin_path 'racc', 'racc'
64
64
  rb_file = parser_file.gsub(/\.ry\z/, ".rb")
65
- ruby "-rubygems #{racc} -l -o #{rb_file} #{parser_file}"
65
+ ruby "#{racc} -l -o #{rb_file} #{parser_file}"
66
66
  elsif parser_file =~ /\.kpeg\z/ # need kpeg
67
67
  kpeg = Gem.bin_path 'kpeg', 'kpeg'
68
68
  rb_file = parser_file.gsub(/\.kpeg\z/, ".rb")
69
- ruby "-rubygems #{kpeg} -fsv -o #{rb_file} #{parser_file}"
69
+ ruby "#{kpeg} -fsv -o #{rb_file} #{parser_file}"
70
70
  end
71
71
  end
72
72
 
@@ -74,9 +74,11 @@ parsed_files = PARSER_FILES.map do |parser_file|
74
74
  end
75
75
 
76
76
  task "#{path}.gem" => package_parser_files
77
- task :generate => parsed_files
78
77
  task :check_manifest => :generate
79
78
 
79
+ desc "Genrate all files used racc and kpeg"
80
+ task :generate => parsed_files
81
+
80
82
  # These tasks expect to have the following directory structure:
81
83
  #
82
84
  # git/git.rubini.us/code # Rubinius git HEAD checkout
@@ -1,18 +1,32 @@
1
1
  ---
2
+ init:
3
+ # To avoid duplicated executables in PATH, see https://github.com/ruby/spec/pull/468
4
+ - set PATH=C:\ruby%RUBY_VERSION%\bin;C:\msys64\usr\bin;C:\Program Files\7-Zip;C:\Program Files\AppVeyor\BuildAgent;C:\Program Files\Git\cmd;C:\Windows\system32;C:\Program Files;C:\Windows
5
+ # Loads trunk build and updates MSYS2 / MinGW to most recent gcc compiler
6
+ - if %ruby_version%==_trunk (
7
+ appveyor DownloadFile %APPVEYOR_URL%/api/projects/MSP-Greg/ruby-loco/artifacts/ruby_trunk.7z -FileName C:\ruby_trunk.7z &
8
+ 7z x C:\ruby_trunk.7z -oC:\ruby_trunk)
9
+
2
10
  install:
3
- - SET PATH=C:\Ruby%ruby_version%\bin;%PATH%
4
- - gem install bundler --no-document
5
11
  - bundle install
12
+
6
13
  build: off
14
+
7
15
  test_script:
8
16
  - rake
17
+
18
+ on_finish:
19
+ - ruby -v
20
+
9
21
  deploy: off
22
+
10
23
  environment:
11
24
  NOBENCHMARK: 1
12
25
  matrix:
13
- - ruby_version: "22"
14
- - ruby_version: "22-x64"
15
- - ruby_version: "23"
16
- - ruby_version: "23-x64"
17
- - ruby_version: "24"
18
- - ruby_version: "24-x64"
26
+ - ruby_version: 22
27
+ - ruby_version: 22-x64
28
+ - ruby_version: 23
29
+ - ruby_version: 23-x64
30
+ - ruby_version: 24
31
+ - ruby_version: 24-x64
32
+ - ruby_version: _trunk
@@ -65,7 +65,7 @@ module RDoc
65
65
  ##
66
66
  # RDoc version you are using
67
67
 
68
- VERSION = '6.0.0.beta2'
68
+ VERSION = '6.0.0.beta3'
69
69
 
70
70
  ##
71
71
  # Method visibilities
@@ -276,8 +276,7 @@ class RDoc::AnyMethod < RDoc::MethodAttr
276
276
  # &block
277
277
  params.sub!(/,?\s*&\w+/, '')
278
278
 
279
- block = @block_params.gsub(/\s*\#.*/, '')
280
- block = block.tr("\n", " ").squeeze(" ")
279
+ block = @block_params.tr("\n", " ").squeeze(" ")
281
280
  if block[0] == ?(
282
281
  block.sub!(/^\(/, '').sub!(/\)/, '')
283
282
  end
@@ -1,5 +1,5 @@
1
1
  <footer id="validator-badges" role="contentinfo">
2
- <p><a href="http://validator.w3.org/check/referer">Validate</a>
3
- <p>Generated by <a href="https://rdoc.github.io/rdoc">RDoc</a> <%= RDoc::VERSION %>.
2
+ <p><a href="https://validator.w3.org/check/referer">Validate</a>
3
+ <p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> <%= RDoc::VERSION %>.
4
4
  <p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
5
5
  </footer>
@@ -114,7 +114,7 @@
114
114
  <% else %>
115
115
  <div class="method-heading">
116
116
  <span class="method-name"><%= h method.name %></span><span
117
- class="method-args"><%= method.param_seq %></span>
117
+ class="method-args"><%= h method.param_seq %></span>
118
118
  <% if method.token_stream then %>
119
119
  <span class="method-click-advice">click to toggle source</span>
120
120
  <% end %>
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: false
2
2
  ##
3
- # This module provides i18n realated features.
3
+ # This module provides i18n related features.
4
4
 
5
5
  module RDoc::I18n
6
6
 
@@ -1161,7 +1161,7 @@ CodeFence = &{ github? }
1161
1161
  @Newline
1162
1162
  )+ > Ticks3 @Sp @Newline*
1163
1163
  { verbatim = RDoc::Markup::Verbatim.new text
1164
- verbatim.format = format.intern if format
1164
+ verbatim.format = format.intern if format.instance_of?(String)
1165
1165
  verbatim
1166
1166
  }
1167
1167
 
@@ -377,7 +377,7 @@
377
377
  #
378
378
  # Example links:
379
379
  #
380
- # https://github.com/rdoc/rdoc
380
+ # https://github.com/ruby/rdoc
381
381
  # mailto:user@example.com
382
382
  # {RDoc Documentation}[http://rdoc.rubyforge.org]
383
383
  # {RDoc Markup}[rdoc-ref:RDoc::Markup]
@@ -764,7 +764,7 @@ Ruby #{RUBY_VERSION}-p#{RUBY_PATCHLEVEL} #{RUBY_RELEASE_DATE}
764
764
 
765
765
  Please file a bug report with the above information at:
766
766
 
767
- https://github.com/rdoc/rdoc/issues
767
+ https://github.com/ruby/rdoc/issues
768
768
 
769
769
  EOF
770
770
  raise
@@ -206,7 +206,7 @@ class RDoc::Markup::ToHtml < RDoc::Markup::Formatter
206
206
  result = RDoc::TokenStream.to_html tokens
207
207
  result = result + "\n" unless "\n" == result[-1]
208
208
  result
209
- rescue RDoc::RubyLex::Error
209
+ rescue
210
210
  CGI.escapeHTML text
211
211
  end
212
212
  else
@@ -87,31 +87,6 @@ class RDoc::Parser
87
87
  not s.valid_encoding?
88
88
  end
89
89
 
90
- ##
91
- # Processes common directives for CodeObjects for the C and Ruby parsers.
92
- #
93
- # Applies +directive+'s +value+ to +code_object+, if appropriate
94
-
95
- def self.process_directive code_object, directive, value
96
- warn "RDoc::Parser::process_directive is deprecated and wil be removed in RDoc 4. Use RDoc::Markup::PreProcess#handle_directive instead" if $-w
97
-
98
- case directive
99
- when 'nodoc' then
100
- code_object.document_self = nil # notify nodoc
101
- code_object.document_children = value.downcase != 'all'
102
- when 'doc' then
103
- code_object.document_self = true
104
- code_object.force_documentation = true
105
- when 'yield', 'yields' then
106
- # remove parameter &block
107
- code_object.params.sub!(/,?\s*&\w+/, '') if code_object.params
108
-
109
- code_object.block_params = value
110
- when 'arg', 'args' then
111
- code_object.params = value
112
- end
113
- end
114
-
115
90
  ##
116
91
  # Checks if +file+ is a zip file in disguise. Signatures from
117
92
  # http://www.garykessler.net/library/file_sigs.html
@@ -376,7 +376,11 @@ class RDoc::Parser::Ruby < RDoc::Parser
376
376
  unless :on_const == name_t[:kind] || :on_ident == name_t[:kind]
377
377
  raise RDoc::Error, "Invalid class or module definition: #{given_name}"
378
378
  end
379
- given_name << '::' << name_t[:text]
379
+ if prev_container == container and !ignore_constants
380
+ given_name = name_t[:text]
381
+ else
382
+ given_name << '::' << name_t[:text]
383
+ end
380
384
  end
381
385
 
382
386
  skip_tkspace false
@@ -872,21 +876,17 @@ class RDoc::Parser::Ruby < RDoc::Parser
872
876
 
873
877
  return unless name =~ /^\w+$/
874
878
 
875
- eq_tk = get_tk
876
-
877
- if :on_op == eq_tk[:kind] && '::' == eq_tk[:text] then
878
- unget_tk eq_tk
879
+ if :on_op == peek_tk[:kind] && '::' == peek_tk[:text] then
879
880
  unget_tk tk
880
881
 
881
882
  container, name_t, = get_class_or_module container, ignore_constants
882
883
 
883
884
  name = name_t[:text]
884
-
885
- eq_tk = get_tk
886
885
  end
887
886
 
888
887
  is_array_or_hash = false
889
- if eq_tk && :on_lbracket == eq_tk[:kind]
888
+ if peek_tk && :on_lbracket == peek_tk[:kind]
889
+ get_tk
890
890
  nest = 1
891
891
  while bracket_tk = get_tk
892
892
  case bracket_tk[:kind]
@@ -898,14 +898,13 @@ class RDoc::Parser::Ruby < RDoc::Parser
898
898
  end
899
899
  end
900
900
  skip_tkspace false
901
- eq_tk = get_tk
902
901
  is_array_or_hash = true
903
902
  end
904
903
 
905
- unless eq_tk && :on_op == eq_tk[:kind] && '=' == eq_tk[:text] then
906
- unget_tk eq_tk
904
+ unless peek_tk && :on_op == peek_tk[:kind] && '=' == peek_tk[:text] then
907
905
  return false
908
906
  end
907
+ get_tk
909
908
 
910
909
  value = ''
911
910
  con = RDoc::Constant.new name, value, comment
@@ -1623,7 +1622,6 @@ class RDoc::Parser::Ruby < RDoc::Parser
1623
1622
  def parse_rescue
1624
1623
  skip_tkspace false
1625
1624
 
1626
- nest = 0
1627
1625
  while tk = get_tk
1628
1626
  case tk[:kind]
1629
1627
  when :on_nl, :on_semicolon, :on_comment then
@@ -47,13 +47,24 @@ class RDoc::RI::Driver
47
47
 
48
48
  class NotFoundError < Error
49
49
 
50
+ def initialize(klass, suggestions = nil) # :nodoc:
51
+ @klass = klass
52
+ @suggestions = suggestions
53
+ end
54
+
50
55
  ##
51
56
  # Name that wasn't found
52
57
 
53
- alias name message
58
+ def name
59
+ @klass
60
+ end
54
61
 
55
62
  def message # :nodoc:
56
- "Nothing known about #{super}"
63
+ str = "Nothing known about #{@klass}"
64
+ if @suggestions and !@suggestions.empty?
65
+ str += "\nDid you mean? #{@suggestions.join("\n ")}"
66
+ end
67
+ str
57
68
  end
58
69
  end
59
70
 
@@ -917,13 +928,38 @@ or the PAGER environment variable.
917
928
  display out
918
929
  end
919
930
 
931
+ def check_did_you_mean # :nodoc:
932
+ if defined? DidYouMean::SpellChecker
933
+ true
934
+ else
935
+ begin
936
+ require 'did_you_mean'
937
+ if defined? DidYouMean::SpellChecker
938
+ true
939
+ else
940
+ false
941
+ end
942
+ rescue LoadError
943
+ false
944
+ end
945
+ end
946
+ end
947
+
920
948
  ##
921
949
  # Expands abbreviated klass +klass+ into a fully-qualified class. "Zl::Da"
922
950
  # will be expanded to Zlib::DataError.
923
951
 
924
952
  def expand_class klass
925
- ary = classes.keys.grep(Regexp.new("\\A#{klass.gsub(/(?=::|\z)/, '[^:]*')}\\z"))
926
- raise NotFoundError, klass if ary.length != 1 && ary.first != klass
953
+ class_names = classes.keys
954
+ ary = class_names.grep(Regexp.new("\\A#{klass.gsub(/(?=::|\z)/, '[^:]*')}\\z"))
955
+ if ary.length != 1 && ary.first != klass
956
+ if check_did_you_mean
957
+ suggestions = DidYouMean::SpellChecker.new(dictionary: class_names).correct(klass)
958
+ raise NotFoundError.new(klass, suggestions)
959
+ else
960
+ raise NotFoundError, klass
961
+ end
962
+ end
927
963
  ary.first
928
964
  end
929
965
 
@@ -1235,7 +1271,21 @@ or the PAGER environment variable.
1235
1271
  def lookup_method name
1236
1272
  found = load_methods_matching name
1237
1273
 
1238
- raise NotFoundError, name if found.empty?
1274
+ if found.empty?
1275
+ if check_did_you_mean
1276
+ methods = []
1277
+ _, _, method_name = parse_name name
1278
+ find_methods name do |store, klass, ancestor, types, method|
1279
+ methods.push(*store.class_methods[klass]) if [:class, :both].include? types
1280
+ methods.push(*store.instance_methods[klass]) if [:instance, :both].include? types
1281
+ end
1282
+ methods = methods.uniq
1283
+ suggestions = DidYouMean::SpellChecker.new(dictionary: methods).correct(method_name)
1284
+ raise NotFoundError.new(name, suggestions)
1285
+ else
1286
+ raise NotFoundError, name
1287
+ end
1288
+ end
1239
1289
 
1240
1290
  filter_methods found, name
1241
1291
  end
@@ -217,7 +217,7 @@ exception:
217
217
  <pre>#{ERB::Util.html_escape exception.message}</pre>
218
218
 
219
219
  <p>Please report this to the
220
- <a href="https://github.com/rdoc/rdoc/issues">RDoc issues tracker</a>. Please
220
+ <a href="https://github.com/ruby/rdoc/issues">RDoc issues tracker</a>. Please
221
221
  include the RDoc version, the URI above and exception class, message and
222
222
  backtrace. If you're viewing a gem's documentation, include the gem name and
223
223
  version. If you're viewing Ruby's documentation, include the version of ruby.
@@ -1,5 +1,10 @@
1
1
  # frozen_string_literal: false
2
- require 'io/console'
2
+ begin
3
+ require 'io/console/size'
4
+ rescue LoadError
5
+ # for JRuby
6
+ require 'io/console'
7
+ end
3
8
 
4
9
  ##
5
10
  # Stats printer that prints just the files being documented with a progress
@@ -23,7 +28,8 @@ class RDoc::Stats::Normal < RDoc::Stats::Quiet
23
28
 
24
29
  # Print a progress bar, but make sure it fits on a single line. Filename
25
30
  # will be truncated if necessary.
26
- terminal_width = IO.console.winsize[1].to_i.nonzero? || 80
31
+ size = IO.respond_to?(:console_size) ? IO.console_size : IO.console.winsize
32
+ terminal_width = size[1].to_i.nonzero? || 80
27
33
  max_filename_size = terminal_width - progress_bar.size
28
34
 
29
35
  if filename.size > max_filename_size then
@@ -1,4 +1,3 @@
1
- # coding: utf-8
2
1
  # frozen_string_literal: false
3
2
 
4
3
  ##
@@ -6,16 +5,6 @@
6
5
 
7
6
  require 'strscan'
8
7
 
9
- ##
10
- # For RDoc::Text#snippet
11
-
12
- begin
13
- gem 'json'
14
- rescue NameError => e # --disable-gems
15
- raise unless e.name == :gem
16
- rescue Gem::LoadError
17
- end
18
-
19
8
  ##
20
9
  # Methods for manipulating comment text
21
10
 
@@ -10,21 +10,8 @@ module RDoc::TokenStream
10
10
 
11
11
  ##
12
12
  # Converts +token_stream+ to HTML wrapping various tokens with
13
- # <tt><span></tt> elements. The following tokens types are wrapped in spans
14
- # with the given class names:
15
- #
16
- # TkCONSTANT :: 'ruby-constant'
17
- # TkKW :: 'ruby-keyword'
18
- # TkIVAR :: 'ruby-ivar'
19
- # TkOp :: 'ruby-operator'
20
- # TkId :: 'ruby-identifier'
21
- # TkNode :: 'ruby-node'
22
- # TkCOMMENT :: 'ruby-comment'
23
- # TkREGEXP :: 'ruby-regexp'
24
- # TkSTRING :: 'ruby-string'
25
- # TkVal :: 'ruby-value'
26
- #
27
- # Other token types are not wrapped in spans.
13
+ # <tt><span></tt> elements. Some tokens types are wrapped in spans
14
+ # with the given class names. Other token types are not wrapped in spans.
28
15
 
29
16
  def self.to_html token_stream
30
17
  token_stream.map do |t|
@@ -1,19 +1,25 @@
1
- require_relative "lib/rdoc"
1
+ begin
2
+ require_relative "lib/rdoc"
3
+ rescue LoadError
4
+ # for Ruby repository
5
+ require_relative "../rdoc"
6
+ end
2
7
 
3
8
  Gem::Specification.new do |s|
4
9
  s.name = "rdoc"
5
10
  s.version = RDoc::VERSION
6
- s.date = "2017-09-12"
7
-
11
+ s.date = "2017-10-10"
12
+
8
13
  s.authors = [
9
14
  "Eric Hodel",
10
15
  "Dave Thomas",
11
16
  "Phil Hagelberg",
12
17
  "Tony Strauss",
13
18
  "Zachary Scott",
14
- "Hiroshi SHIBATA"
19
+ "Hiroshi SHIBATA",
20
+ "ITOYANAGI Sakura"
15
21
  ]
16
- s.email = ["drbrain@segment7.net", "", "", "", "mail@zzak.io", "hsbt@ruby-lang.org"]
22
+ s.email = ["drbrain@segment7.net", "", "", "", "mail@zzak.io", "hsbt@ruby-lang.org", "aycabta@gmail.com"]
17
23
 
18
24
  s.summary = "RDoc produces HTML and command-line documentation for Ruby projects"
19
25
  s.description = <<-DESCRIPTION
@@ -27,7 +33,7 @@ RDoc includes the +rdoc+ and +ri+ tools for generating and displaying documentat
27
33
  s.executables = ["rdoc", "ri"]
28
34
  s.require_paths = ["lib"]
29
35
  # for ruby core repository. It was generated by `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
30
- s.files = [".document", ".gitignore", ".travis.yml", "CONTRIBUTING.rdoc", "CVE-2013-0256.rdoc", "ExampleMarkdown.md", "ExampleRDoc.rdoc", "Gemfile", "History.rdoc", "LEGAL.rdoc", "LICENSE.rdoc", "README.rdoc", "RI.rdoc", "Rakefile", "TODO.rdoc", "appveyor.yml", "bin/console", "bin/setup", "exe/rdoc", "exe/ri", "lib/rdoc.rb", "lib/rdoc/alias.rb", "lib/rdoc/anon_class.rb", "lib/rdoc/any_method.rb", "lib/rdoc/attr.rb", "lib/rdoc/class_module.rb", "lib/rdoc/code_object.rb", "lib/rdoc/code_objects.rb", "lib/rdoc/comment.rb", "lib/rdoc/constant.rb", "lib/rdoc/context.rb", "lib/rdoc/context/section.rb", "lib/rdoc/cross_reference.rb", "lib/rdoc/encoding.rb", "lib/rdoc/erb_partial.rb", "lib/rdoc/erbio.rb", "lib/rdoc/extend.rb", "lib/rdoc/generator.rb", "lib/rdoc/generator/darkfish.rb", "lib/rdoc/generator/json_index.rb", "lib/rdoc/generator/markup.rb", "lib/rdoc/generator/pot.rb", "lib/rdoc/generator/pot/message_extractor.rb", "lib/rdoc/generator/pot/po.rb", "lib/rdoc/generator/pot/po_entry.rb", "lib/rdoc/generator/ri.rb", "lib/rdoc/generator/template/darkfish/.document", "lib/rdoc/generator/template/darkfish/_footer.rhtml", "lib/rdoc/generator/template/darkfish/_head.rhtml", "lib/rdoc/generator/template/darkfish/_sidebar_VCS_info.rhtml", "lib/rdoc/generator/template/darkfish/_sidebar_classes.rhtml", "lib/rdoc/generator/template/darkfish/_sidebar_extends.rhtml", "lib/rdoc/generator/template/darkfish/_sidebar_in_files.rhtml", "lib/rdoc/generator/template/darkfish/_sidebar_includes.rhtml", "lib/rdoc/generator/template/darkfish/_sidebar_installed.rhtml", "lib/rdoc/generator/template/darkfish/_sidebar_methods.rhtml", "lib/rdoc/generator/template/darkfish/_sidebar_navigation.rhtml", "lib/rdoc/generator/template/darkfish/_sidebar_pages.rhtml", "lib/rdoc/generator/template/darkfish/_sidebar_parent.rhtml", "lib/rdoc/generator/template/darkfish/_sidebar_search.rhtml", "lib/rdoc/generator/template/darkfish/_sidebar_sections.rhtml", "lib/rdoc/generator/template/darkfish/_sidebar_table_of_contents.rhtml", "lib/rdoc/generator/template/darkfish/class.rhtml", "lib/rdoc/generator/template/darkfish/css/fonts.css", "lib/rdoc/generator/template/darkfish/css/rdoc.css", "lib/rdoc/generator/template/darkfish/fonts/Lato-Light.ttf", "lib/rdoc/generator/template/darkfish/fonts/Lato-LightItalic.ttf", "lib/rdoc/generator/template/darkfish/fonts/Lato-Regular.ttf", "lib/rdoc/generator/template/darkfish/fonts/Lato-RegularItalic.ttf", "lib/rdoc/generator/template/darkfish/fonts/SourceCodePro-Bold.ttf", "lib/rdoc/generator/template/darkfish/fonts/SourceCodePro-Regular.ttf", "lib/rdoc/generator/template/darkfish/images/add.png", "lib/rdoc/generator/template/darkfish/images/arrow_up.png", "lib/rdoc/generator/template/darkfish/images/brick.png", "lib/rdoc/generator/template/darkfish/images/brick_link.png", "lib/rdoc/generator/template/darkfish/images/bug.png", "lib/rdoc/generator/template/darkfish/images/bullet_black.png", "lib/rdoc/generator/template/darkfish/images/bullet_toggle_minus.png", "lib/rdoc/generator/template/darkfish/images/bullet_toggle_plus.png", "lib/rdoc/generator/template/darkfish/images/date.png", "lib/rdoc/generator/template/darkfish/images/delete.png", "lib/rdoc/generator/template/darkfish/images/find.png", "lib/rdoc/generator/template/darkfish/images/loadingAnimation.gif", "lib/rdoc/generator/template/darkfish/images/macFFBgHack.png", "lib/rdoc/generator/template/darkfish/images/package.png", "lib/rdoc/generator/template/darkfish/images/page_green.png", "lib/rdoc/generator/template/darkfish/images/page_white_text.png", "lib/rdoc/generator/template/darkfish/images/page_white_width.png", "lib/rdoc/generator/template/darkfish/images/plugin.png", "lib/rdoc/generator/template/darkfish/images/ruby.png", "lib/rdoc/generator/template/darkfish/images/tag_blue.png", "lib/rdoc/generator/template/darkfish/images/tag_green.png", "lib/rdoc/generator/template/darkfish/images/transparent.png", "lib/rdoc/generator/template/darkfish/images/wrench.png", "lib/rdoc/generator/template/darkfish/images/wrench_orange.png", "lib/rdoc/generator/template/darkfish/images/zoom.png", "lib/rdoc/generator/template/darkfish/index.rhtml", "lib/rdoc/generator/template/darkfish/js/darkfish.js", "lib/rdoc/generator/template/darkfish/js/jquery.js", "lib/rdoc/generator/template/darkfish/js/search.js", "lib/rdoc/generator/template/darkfish/page.rhtml", "lib/rdoc/generator/template/darkfish/servlet_not_found.rhtml", "lib/rdoc/generator/template/darkfish/servlet_root.rhtml", "lib/rdoc/generator/template/darkfish/table_of_contents.rhtml", "lib/rdoc/generator/template/json_index/.document", "lib/rdoc/generator/template/json_index/js/navigation.js", "lib/rdoc/generator/template/json_index/js/searcher.js", "lib/rdoc/ghost_method.rb", "lib/rdoc/i18n.rb", "lib/rdoc/i18n/locale.rb", "lib/rdoc/i18n/text.rb", "lib/rdoc/include.rb", "lib/rdoc/known_classes.rb", "lib/rdoc/markdown.kpeg", "lib/rdoc/markdown/entities.rb", "lib/rdoc/markdown/literals.kpeg", "lib/rdoc/markdown/literals.rb", "lib/rdoc/markup.rb", "lib/rdoc/markup/attr_changer.rb", "lib/rdoc/markup/attr_span.rb", "lib/rdoc/markup/attribute_manager.rb", "lib/rdoc/markup/attributes.rb", "lib/rdoc/markup/blank_line.rb", "lib/rdoc/markup/block_quote.rb", "lib/rdoc/markup/document.rb", "lib/rdoc/markup/formatter.rb", "lib/rdoc/markup/formatter_test_case.rb", "lib/rdoc/markup/hard_break.rb", "lib/rdoc/markup/heading.rb", "lib/rdoc/markup/include.rb", "lib/rdoc/markup/indented_paragraph.rb", "lib/rdoc/markup/inline.rb", "lib/rdoc/markup/list.rb", "lib/rdoc/markup/list_item.rb", "lib/rdoc/markup/paragraph.rb", "lib/rdoc/markup/parser.rb", "lib/rdoc/markup/pre_process.rb", "lib/rdoc/markup/raw.rb", "lib/rdoc/markup/rule.rb", "lib/rdoc/markup/special.rb", "lib/rdoc/markup/text_formatter_test_case.rb", "lib/rdoc/markup/to_ansi.rb", "lib/rdoc/markup/to_bs.rb", "lib/rdoc/markup/to_html.rb", "lib/rdoc/markup/to_html_crossref.rb", "lib/rdoc/markup/to_html_snippet.rb", "lib/rdoc/markup/to_joined_paragraph.rb", "lib/rdoc/markup/to_label.rb", "lib/rdoc/markup/to_markdown.rb", "lib/rdoc/markup/to_rdoc.rb", "lib/rdoc/markup/to_table_of_contents.rb", "lib/rdoc/markup/to_test.rb", "lib/rdoc/markup/to_tt_only.rb", "lib/rdoc/markup/verbatim.rb", "lib/rdoc/meta_method.rb", "lib/rdoc/method_attr.rb", "lib/rdoc/mixin.rb", "lib/rdoc/normal_class.rb", "lib/rdoc/normal_module.rb", "lib/rdoc/options.rb", "lib/rdoc/parser.rb", "lib/rdoc/parser/c.rb", "lib/rdoc/parser/changelog.rb", "lib/rdoc/parser/markdown.rb", "lib/rdoc/parser/rd.rb", "lib/rdoc/parser/ripper_state_lex.rb", "lib/rdoc/parser/ruby.rb", "lib/rdoc/parser/ruby_tools.rb", "lib/rdoc/parser/simple.rb", "lib/rdoc/parser/text.rb", "lib/rdoc/rd.rb", "lib/rdoc/rd/block_parser.ry", "lib/rdoc/rd/inline.rb", "lib/rdoc/rd/inline_parser.ry", "lib/rdoc/rdoc.rb", "lib/rdoc/require.rb", "lib/rdoc/ri.rb", "lib/rdoc/ri/driver.rb", "lib/rdoc/ri/formatter.rb", "lib/rdoc/ri/paths.rb", "lib/rdoc/ri/store.rb", "lib/rdoc/ri/task.rb", "lib/rdoc/ruby_token.rb", "lib/rdoc/rubygems_hook.rb", "lib/rdoc/servlet.rb", "lib/rdoc/single_class.rb", "lib/rdoc/stats.rb", "lib/rdoc/stats/normal.rb", "lib/rdoc/stats/quiet.rb", "lib/rdoc/stats/verbose.rb", "lib/rdoc/store.rb", "lib/rdoc/task.rb", "lib/rdoc/test_case.rb", "lib/rdoc/text.rb", "lib/rdoc/token_stream.rb", "lib/rdoc/tom_doc.rb", "lib/rdoc/top_level.rb", "rdoc.gemspec"]
36
+ s.files = [".document", ".gitignore", ".travis.yml", "CONTRIBUTING.rdoc", "CVE-2013-0256.rdoc", "ExampleMarkdown.md", "ExampleRDoc.rdoc", "Gemfile", "History.rdoc", "LEGAL.rdoc", "LICENSE.rdoc", "README.rdoc", "RI.rdoc", "Rakefile", "TODO.rdoc", "appveyor.yml", "bin/console", "bin/setup", "exe/rdoc", "exe/ri", "lib/rdoc.rb", "lib/rdoc/alias.rb", "lib/rdoc/anon_class.rb", "lib/rdoc/any_method.rb", "lib/rdoc/attr.rb", "lib/rdoc/class_module.rb", "lib/rdoc/code_object.rb", "lib/rdoc/code_objects.rb", "lib/rdoc/comment.rb", "lib/rdoc/constant.rb", "lib/rdoc/context.rb", "lib/rdoc/context/section.rb", "lib/rdoc/cross_reference.rb", "lib/rdoc/encoding.rb", "lib/rdoc/erb_partial.rb", "lib/rdoc/erbio.rb", "lib/rdoc/extend.rb", "lib/rdoc/generator.rb", "lib/rdoc/generator/darkfish.rb", "lib/rdoc/generator/json_index.rb", "lib/rdoc/generator/markup.rb", "lib/rdoc/generator/pot.rb", "lib/rdoc/generator/pot/message_extractor.rb", "lib/rdoc/generator/pot/po.rb", "lib/rdoc/generator/pot/po_entry.rb", "lib/rdoc/generator/ri.rb", "lib/rdoc/generator/template/darkfish/.document", "lib/rdoc/generator/template/darkfish/_footer.rhtml", "lib/rdoc/generator/template/darkfish/_head.rhtml", "lib/rdoc/generator/template/darkfish/_sidebar_VCS_info.rhtml", "lib/rdoc/generator/template/darkfish/_sidebar_classes.rhtml", "lib/rdoc/generator/template/darkfish/_sidebar_extends.rhtml", "lib/rdoc/generator/template/darkfish/_sidebar_in_files.rhtml", "lib/rdoc/generator/template/darkfish/_sidebar_includes.rhtml", "lib/rdoc/generator/template/darkfish/_sidebar_installed.rhtml", "lib/rdoc/generator/template/darkfish/_sidebar_methods.rhtml", "lib/rdoc/generator/template/darkfish/_sidebar_navigation.rhtml", "lib/rdoc/generator/template/darkfish/_sidebar_pages.rhtml", "lib/rdoc/generator/template/darkfish/_sidebar_parent.rhtml", "lib/rdoc/generator/template/darkfish/_sidebar_search.rhtml", "lib/rdoc/generator/template/darkfish/_sidebar_sections.rhtml", "lib/rdoc/generator/template/darkfish/_sidebar_table_of_contents.rhtml", "lib/rdoc/generator/template/darkfish/class.rhtml", "lib/rdoc/generator/template/darkfish/css/fonts.css", "lib/rdoc/generator/template/darkfish/css/rdoc.css", "lib/rdoc/generator/template/darkfish/fonts/Lato-Light.ttf", "lib/rdoc/generator/template/darkfish/fonts/Lato-LightItalic.ttf", "lib/rdoc/generator/template/darkfish/fonts/Lato-Regular.ttf", "lib/rdoc/generator/template/darkfish/fonts/Lato-RegularItalic.ttf", "lib/rdoc/generator/template/darkfish/fonts/SourceCodePro-Bold.ttf", "lib/rdoc/generator/template/darkfish/fonts/SourceCodePro-Regular.ttf", "lib/rdoc/generator/template/darkfish/images/add.png", "lib/rdoc/generator/template/darkfish/images/arrow_up.png", "lib/rdoc/generator/template/darkfish/images/brick.png", "lib/rdoc/generator/template/darkfish/images/brick_link.png", "lib/rdoc/generator/template/darkfish/images/bug.png", "lib/rdoc/generator/template/darkfish/images/bullet_black.png", "lib/rdoc/generator/template/darkfish/images/bullet_toggle_minus.png", "lib/rdoc/generator/template/darkfish/images/bullet_toggle_plus.png", "lib/rdoc/generator/template/darkfish/images/date.png", "lib/rdoc/generator/template/darkfish/images/delete.png", "lib/rdoc/generator/template/darkfish/images/find.png", "lib/rdoc/generator/template/darkfish/images/loadingAnimation.gif", "lib/rdoc/generator/template/darkfish/images/macFFBgHack.png", "lib/rdoc/generator/template/darkfish/images/package.png", "lib/rdoc/generator/template/darkfish/images/page_green.png", "lib/rdoc/generator/template/darkfish/images/page_white_text.png", "lib/rdoc/generator/template/darkfish/images/page_white_width.png", "lib/rdoc/generator/template/darkfish/images/plugin.png", "lib/rdoc/generator/template/darkfish/images/ruby.png", "lib/rdoc/generator/template/darkfish/images/tag_blue.png", "lib/rdoc/generator/template/darkfish/images/tag_green.png", "lib/rdoc/generator/template/darkfish/images/transparent.png", "lib/rdoc/generator/template/darkfish/images/wrench.png", "lib/rdoc/generator/template/darkfish/images/wrench_orange.png", "lib/rdoc/generator/template/darkfish/images/zoom.png", "lib/rdoc/generator/template/darkfish/index.rhtml", "lib/rdoc/generator/template/darkfish/js/darkfish.js", "lib/rdoc/generator/template/darkfish/js/jquery.js", "lib/rdoc/generator/template/darkfish/js/search.js", "lib/rdoc/generator/template/darkfish/page.rhtml", "lib/rdoc/generator/template/darkfish/servlet_not_found.rhtml", "lib/rdoc/generator/template/darkfish/servlet_root.rhtml", "lib/rdoc/generator/template/darkfish/table_of_contents.rhtml", "lib/rdoc/generator/template/json_index/.document", "lib/rdoc/generator/template/json_index/js/navigation.js", "lib/rdoc/generator/template/json_index/js/searcher.js", "lib/rdoc/ghost_method.rb", "lib/rdoc/i18n.rb", "lib/rdoc/i18n/locale.rb", "lib/rdoc/i18n/text.rb", "lib/rdoc/include.rb", "lib/rdoc/known_classes.rb", "lib/rdoc/markdown.kpeg", "lib/rdoc/markdown/entities.rb", "lib/rdoc/markdown/literals.kpeg", "lib/rdoc/markdown/literals.rb", "lib/rdoc/markup.rb", "lib/rdoc/markup/attr_changer.rb", "lib/rdoc/markup/attr_span.rb", "lib/rdoc/markup/attribute_manager.rb", "lib/rdoc/markup/attributes.rb", "lib/rdoc/markup/blank_line.rb", "lib/rdoc/markup/block_quote.rb", "lib/rdoc/markup/document.rb", "lib/rdoc/markup/formatter.rb", "lib/rdoc/markup/formatter_test_case.rb", "lib/rdoc/markup/hard_break.rb", "lib/rdoc/markup/heading.rb", "lib/rdoc/markup/include.rb", "lib/rdoc/markup/indented_paragraph.rb", "lib/rdoc/markup/inline.rb", "lib/rdoc/markup/list.rb", "lib/rdoc/markup/list_item.rb", "lib/rdoc/markup/paragraph.rb", "lib/rdoc/markup/parser.rb", "lib/rdoc/markup/pre_process.rb", "lib/rdoc/markup/raw.rb", "lib/rdoc/markup/rule.rb", "lib/rdoc/markup/special.rb", "lib/rdoc/markup/text_formatter_test_case.rb", "lib/rdoc/markup/to_ansi.rb", "lib/rdoc/markup/to_bs.rb", "lib/rdoc/markup/to_html.rb", "lib/rdoc/markup/to_html_crossref.rb", "lib/rdoc/markup/to_html_snippet.rb", "lib/rdoc/markup/to_joined_paragraph.rb", "lib/rdoc/markup/to_label.rb", "lib/rdoc/markup/to_markdown.rb", "lib/rdoc/markup/to_rdoc.rb", "lib/rdoc/markup/to_table_of_contents.rb", "lib/rdoc/markup/to_test.rb", "lib/rdoc/markup/to_tt_only.rb", "lib/rdoc/markup/verbatim.rb", "lib/rdoc/meta_method.rb", "lib/rdoc/method_attr.rb", "lib/rdoc/mixin.rb", "lib/rdoc/normal_class.rb", "lib/rdoc/normal_module.rb", "lib/rdoc/options.rb", "lib/rdoc/parser.rb", "lib/rdoc/parser/c.rb", "lib/rdoc/parser/changelog.rb", "lib/rdoc/parser/markdown.rb", "lib/rdoc/parser/rd.rb", "lib/rdoc/parser/ripper_state_lex.rb", "lib/rdoc/parser/ruby.rb", "lib/rdoc/parser/ruby_tools.rb", "lib/rdoc/parser/simple.rb", "lib/rdoc/parser/text.rb", "lib/rdoc/rd.rb", "lib/rdoc/rd/block_parser.ry", "lib/rdoc/rd/inline.rb", "lib/rdoc/rd/inline_parser.ry", "lib/rdoc/rdoc.rb", "lib/rdoc/require.rb", "lib/rdoc/ri.rb", "lib/rdoc/ri/driver.rb", "lib/rdoc/ri/formatter.rb", "lib/rdoc/ri/paths.rb", "lib/rdoc/ri/store.rb", "lib/rdoc/ri/task.rb", "lib/rdoc/rubygems_hook.rb", "lib/rdoc/servlet.rb", "lib/rdoc/single_class.rb", "lib/rdoc/stats.rb", "lib/rdoc/stats/normal.rb", "lib/rdoc/stats/quiet.rb", "lib/rdoc/stats/verbose.rb", "lib/rdoc/store.rb", "lib/rdoc/task.rb", "lib/rdoc/test_case.rb", "lib/rdoc/text.rb", "lib/rdoc/token_stream.rb", "lib/rdoc/tom_doc.rb", "lib/rdoc/top_level.rb", "rdoc.gemspec"]
31
37
  # files from .gitignore
32
38
  s.files << "lib/rdoc/rd/block_parser.rb" << "lib/rdoc/rd/inline_parser.rb" << "lib/rdoc/markdown.rb"
33
39
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rdoc
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.0.0.beta2
4
+ version: 6.0.0.beta3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Hodel
@@ -10,10 +10,11 @@ authors:
10
10
  - Tony Strauss
11
11
  - Zachary Scott
12
12
  - Hiroshi SHIBATA
13
+ - ITOYANAGI Sakura
13
14
  autorequire:
14
15
  bindir: exe
15
16
  cert_chain: []
16
- date: 2017-09-12 00:00:00.000000000 Z
17
+ date: 2017-10-10 00:00:00.000000000 Z
17
18
  dependencies:
18
19
  - !ruby/object:Gem::Dependency
19
20
  name: rake
@@ -95,6 +96,7 @@ email:
95
96
  - ''
96
97
  - mail@zzak.io
97
98
  - hsbt@ruby-lang.org
99
+ - aycabta@gmail.com
98
100
  executables:
99
101
  - rdoc
100
102
  - ri
@@ -296,7 +298,6 @@ files:
296
298
  - lib/rdoc/ri/paths.rb
297
299
  - lib/rdoc/ri/store.rb
298
300
  - lib/rdoc/ri/task.rb
299
- - lib/rdoc/ruby_token.rb
300
301
  - lib/rdoc/rubygems_hook.rb
301
302
  - lib/rdoc/servlet.rb
302
303
  - lib/rdoc/single_class.rb
@@ -1,470 +0,0 @@
1
- # frozen_string_literal: false
2
- #--
3
- # irb/ruby-token.rb - ruby tokens
4
- # $Release Version: 0.9.5$
5
- # $Revision: 11708 $
6
- # $Date: 2007-02-12 15:01:19 -0800 (Mon, 12 Feb 2007) $
7
- # by Keiju ISHITSUKA(keiju@ruby-lang.org)
8
- #++
9
- # Definitions of all tokens involved in the lexical analysis.
10
- #
11
- # This class is not documented because it is so deep in the internals.
12
-
13
- module RDoc::RubyToken
14
- # :stopdoc:
15
-
16
- EXPR_BEG = :EXPR_BEG
17
- EXPR_MID = :EXPR_MID
18
- EXPR_END = :EXPR_END
19
- EXPR_ARG = :EXPR_ARG
20
- EXPR_FNAME = :EXPR_FNAME
21
- EXPR_DOT = :EXPR_DOT
22
- EXPR_CLASS = :EXPR_CLASS
23
-
24
- # for ruby 1.4X
25
- if !defined?(Symbol)
26
- Symbol = Integer
27
- end
28
-
29
- def set_token_position(seek, line, char)
30
- @prev_seek = seek
31
- @prev_line_no = line
32
- @prev_char_no = char
33
- end
34
-
35
- class Token
36
- def initialize(seek, line_no, char_no, text = nil)
37
- @seek = seek
38
- @line_no = line_no
39
- @char_no = char_no
40
- @text = text
41
- end
42
-
43
- attr_reader :seek
44
- attr_reader :line_no
45
- attr_reader :char_no
46
-
47
- attr_accessor :text
48
-
49
- def ==(other)
50
- self.class == other.class and
51
- other.line_no == @line_no and
52
- other.char_no == @char_no and
53
- other.text == @text
54
- end
55
-
56
- ##
57
- # Because we're used in contexts that expect to return a token, we set the
58
- # text string and then return ourselves
59
-
60
- def set_text(text)
61
- @text = text
62
- self
63
- end
64
-
65
- def inspect # :nodoc:
66
- klass = self.class.name.split('::').last
67
- "{%s %d, %d:%d %p}" % [klass, @seek, @line_no, @char_no, @text]
68
- end
69
-
70
- end
71
-
72
- class TkNode < Token
73
- def initialize(seek, line_no, char_no, node = nil)
74
- super seek, line_no, char_no
75
- @node = node
76
- end
77
-
78
- attr_reader:node
79
-
80
- def ==(other)
81
- self.class == other.class and
82
- other.line_no == @line_no and
83
- other.char_no == @char_no and
84
- other.node == @node
85
- end
86
-
87
- def set_text text
88
- @node = text
89
- self
90
- end
91
-
92
- alias text node
93
-
94
- def inspect # :nodoc:
95
- klass = self.class.name.split('::').last
96
- "{%s %d, %d:%d %p}" % [klass, @seek, @line_no, @char_no, @node]
97
- end
98
-
99
- end
100
-
101
- class TkId < Token
102
- def initialize(seek, line_no, char_no, name)
103
- super(seek, line_no, char_no)
104
- @name = name
105
- end
106
- attr_reader:name
107
-
108
- def ==(other)
109
- self.class == other.class and
110
- other.line_no == @line_no and
111
- other.char_no == @char_no and
112
- other.name == @name
113
- end
114
-
115
- def set_text text
116
- @name = text
117
- self
118
- end
119
-
120
- alias text name
121
-
122
- def inspect # :nodoc:
123
- klass = self.class.name.split('::').last
124
- "{%s %d, %d:%d %p}" % [klass, @seek, @line_no, @char_no, @name]
125
- end
126
-
127
- end
128
-
129
- class TkKW < TkId
130
- end
131
-
132
- class TkVal < Token
133
- def initialize(seek, line_no, char_no, value = nil)
134
- super(seek, line_no, char_no)
135
- @value = value
136
- end
137
- attr_accessor :value
138
-
139
- def ==(other)
140
- self.class == other.class and
141
- other.line_no == @line_no and
142
- other.char_no == @char_no and
143
- other.value == @value
144
- end
145
-
146
- def set_text text
147
- @value = text
148
- self
149
- end
150
-
151
- alias text value
152
-
153
- def inspect # :nodoc:
154
- klass = self.class.name.split('::').last
155
- "{%s %s, %d:%d %p}" % [klass, @seek, @line_no, @char_no, @value]
156
- end
157
-
158
- end
159
-
160
- class TkOp < Token
161
- def initialize(seek, line_no, char_no, name = nil)
162
- super seek, line_no, char_no
163
- @name = name
164
- end
165
-
166
- attr_accessor :name
167
-
168
- def ==(other)
169
- self.class == other.class and
170
- other.line_no == @line_no and
171
- other.char_no == @char_no and
172
- other.name == @name
173
- end
174
-
175
- def set_text text
176
- @name = text
177
- self
178
- end
179
-
180
- alias text name
181
-
182
- def inspect # :nodoc:
183
- klass = self.class.name.split('::').last
184
- "{%s %d, %d:%d %p}" % [klass, @seek, @line_no, @char_no, @name]
185
- end
186
-
187
- end
188
-
189
- class TkOPASGN < TkOp
190
- def initialize(seek, line_no, char_no, op)
191
- super(seek, line_no, char_no)
192
- op = TkReading2Token[op][0] unless op.kind_of?(Symbol)
193
- @op = op
194
- @text = nil
195
- end
196
-
197
- attr_reader:op
198
-
199
- def ==(other)
200
- self.class == other.class and
201
- other.line_no == @line_no and
202
- other.char_no == @char_no and
203
- other.op == @op
204
- end
205
-
206
- def text
207
- @text ||= "#{TkToken2Reading[op]}="
208
- end
209
-
210
- def inspect # :nodoc:
211
- klass = self.class.name.split('::').last
212
- "{%s %d, %d:%d %p}" % [klass, @seek, @line_no, @char_no, @op]
213
- end
214
-
215
- end
216
-
217
- class TkUnknownChar < Token
218
- def initialize(seek, line_no, char_no, name)
219
- super(seek, line_no, char_no)
220
- @name = name
221
- end
222
- attr_reader:name
223
-
224
- def ==(other)
225
- self.class == other.class and
226
- other.line_no == @line_no and
227
- other.char_no == @char_no and
228
- other.name == @name
229
- end
230
-
231
- def set_text text
232
- @name = text
233
- self
234
- end
235
-
236
- alias text name
237
-
238
- def inspect # :nodoc:
239
- klass = self.class.name.split('::').last
240
- "{%s %d, %d:%d %p}" % [klass, @seek, @line_no, @char_no, @name]
241
- end
242
-
243
- end
244
-
245
- class TkError < Token
246
- end
247
-
248
- def Token(token, value = nil)
249
- value ||= TkToken2Reading[token]
250
-
251
- case token
252
- when String
253
- if (tk = TkReading2Token[token]).nil?
254
- IRB.fail TkReading2TokenNoKey, token
255
- end
256
-
257
- tk = Token(tk[0], value)
258
-
259
- if tk.kind_of?(TkOp) then
260
- tk.name = token
261
- end
262
- when Symbol
263
- if (tk = TkSymbol2Token[token]).nil?
264
- IRB.fail TkSymbol2TokenNoKey, token
265
- end
266
-
267
- tk = Token(tk[0], value)
268
- else
269
- if token.instance_method(:initialize).arity == 3 then
270
- tk = token.new(@prev_seek, @prev_line_no, @prev_char_no)
271
- tk.set_text value
272
- else
273
- tk = token.new(@prev_seek, @prev_line_no, @prev_char_no, value)
274
- end
275
- end
276
-
277
- tk
278
- end
279
-
280
- TokenDefinitions = [
281
- [:TkCLASS, TkKW, "class", :EXPR_CLASS],
282
- [:TkMODULE, TkKW, "module", :EXPR_BEG],
283
- [:TkDEF, TkKW, "def", :EXPR_FNAME],
284
- [:TkUNDEF, TkKW, "undef", :EXPR_FNAME],
285
- [:TkBEGIN, TkKW, "begin", :EXPR_BEG],
286
- [:TkRESCUE, TkKW, "rescue", :EXPR_MID],
287
- [:TkENSURE, TkKW, "ensure", :EXPR_BEG],
288
- [:TkEND, TkKW, "end", :EXPR_END],
289
- [:TkIF, TkKW, "if", :EXPR_BEG, :TkIF_MOD],
290
- [:TkUNLESS, TkKW, "unless", :EXPR_BEG, :TkUNLESS_MOD],
291
- [:TkTHEN, TkKW, "then", :EXPR_BEG],
292
- [:TkELSIF, TkKW, "elsif", :EXPR_BEG],
293
- [:TkELSE, TkKW, "else", :EXPR_BEG],
294
- [:TkCASE, TkKW, "case", :EXPR_BEG],
295
- [:TkWHEN, TkKW, "when", :EXPR_BEG],
296
- [:TkWHILE, TkKW, "while", :EXPR_BEG, :TkWHILE_MOD],
297
- [:TkUNTIL, TkKW, "until", :EXPR_BEG, :TkUNTIL_MOD],
298
- [:TkFOR, TkKW, "for", :EXPR_BEG],
299
- [:TkBREAK, TkKW, "break", :EXPR_MID],
300
- [:TkNEXT, TkKW, "next", :EXPR_END],
301
- [:TkREDO, TkKW, "redo", :EXPR_END],
302
- [:TkRETRY, TkKW, "retry", :EXPR_END],
303
- [:TkIN, TkKW, "in", :EXPR_BEG],
304
- [:TkDO, TkKW, "do", :EXPR_BEG],
305
- [:TkRETURN, TkKW, "return", :EXPR_MID],
306
- [:TkYIELD, TkKW, "yield", :EXPR_ARG],
307
- [:TkSUPER, TkKW, "super", :EXPR_ARG],
308
- [:TkSELF, TkKW, "self", :EXPR_END],
309
- [:TkNIL, TkKW, "nil", :EXPR_END],
310
- [:TkTRUE, TkKW, "true", :EXPR_END],
311
- [:TkFALSE, TkKW, "false", :EXPR_END],
312
- [:TkAND, TkKW, "and", :EXPR_BEG],
313
- [:TkOR, TkKW, "or", :EXPR_BEG],
314
- [:TkNOT, TkKW, "not", :EXPR_BEG],
315
- [:TkIF_MOD, TkKW],
316
- [:TkUNLESS_MOD, TkKW],
317
- [:TkWHILE_MOD, TkKW],
318
- [:TkUNTIL_MOD, TkKW],
319
- [:TkALIAS, TkKW, "alias", :EXPR_FNAME],
320
- [:TkDEFINED, TkKW, "defined?", :EXPR_ARG],
321
- [:TklBEGIN, TkKW, "BEGIN", :EXPR_END],
322
- [:TklEND, TkKW, "END", :EXPR_END],
323
- [:Tk__LINE__, TkKW, "__LINE__", :EXPR_END],
324
- [:Tk__FILE__, TkKW, "__FILE__", :EXPR_END],
325
- [:Tk__ENCODING__,TkKW, "__ENCODING__", :EXPR_END],
326
-
327
- [:TkIDENTIFIER, TkId],
328
- [:TkFID, TkId],
329
- [:TkGVAR, TkId],
330
- [:TkCVAR, TkId],
331
- [:TkIVAR, TkId],
332
- [:TkCONSTANT, TkId],
333
- [:TkHEREDOCBEG, TkId],
334
- [:TkHEREDOCEND, TkId],
335
-
336
- [:TkINTEGER, TkVal],
337
- [:TkFLOAT, TkVal],
338
- [:TkRATIONAL, TkVal],
339
- [:TkIMAGINARY, TkVal],
340
- [:TkSTRING, TkVal],
341
- [:TkHEREDOC, TkVal],
342
- [:TkXSTRING, TkVal],
343
- [:TkREGEXP, TkVal],
344
- [:TkSYMBOL, TkVal],
345
- [:TkCHAR, TkVal],
346
-
347
- [:TkDSTRING, TkNode],
348
- [:TkDXSTRING, TkNode],
349
- [:TkDREGEXP, TkNode],
350
- [:TkNTH_REF, TkNode],
351
- [:TkBACK_REF, TkNode],
352
-
353
- [:TkUPLUS, TkOp, "+@"],
354
- [:TkUMINUS, TkOp, "-@"],
355
- [:TkPOW, TkOp, "**"],
356
- [:TkCMP, TkOp, "<=>"],
357
- [:TkEQ, TkOp, "=="],
358
- [:TkEQQ, TkOp, "==="],
359
- [:TkNEQ, TkOp, "!="],
360
- [:TkGEQ, TkOp, ">="],
361
- [:TkLEQ, TkOp, "<="],
362
- [:TkHASHROCKET, TkOp, "=>"],
363
- [:TkANDOP, TkOp, "&&"],
364
- [:TkOROP, TkOp, "||"],
365
- [:TkMATCH, TkOp, "=~"],
366
- [:TkNMATCH, TkOp, "!~"],
367
- [:TkDOT2, TkOp, ".."],
368
- [:TkDOT3, TkOp, "..."],
369
- [:TkAREF, TkOp, "[]"],
370
- [:TkASET, TkOp, "[]="],
371
- [:TkLSHFT, TkOp, "<<"],
372
- [:TkRSHFT, TkOp, ">>"],
373
- [:TkCOLON2, TkOp, '::'],
374
- [:TkCOLON3, TkOp, '::'],
375
- #[:OPASGN, TkOp], # +=, -= etc. #
376
- [:TkASSOC, TkOp, "=>"],
377
- [:TkLAMBDA, TkOp, "->"],
378
- [:TkQUESTION, TkOp, "?"], #?
379
- [:TkCOLON, TkOp, ":"], #:
380
-
381
- [:TkfLPAREN, Token, "("], # func( #
382
- [:TkfLBRACK, Token, "["], # func[ #
383
- [:TkfLBRACE, Token, "{"], # func{ #
384
- [:TkSYMBEG, Token, ":"], # :SYMBOL
385
-
386
- [:TkAMPER, TkOp, "&"],
387
- [:TkGT, TkOp, ">"],
388
- [:TkLT, TkOp, "<"],
389
- [:TkPLUS, TkOp, "+"],
390
- [:TkSTAR, TkOp, "*"],
391
- [:TkMINUS, TkOp, "-"],
392
- [:TkMULT, TkOp, "*"],
393
- [:TkDIV, TkOp, "/"],
394
- [:TkMOD, TkOp, "%"],
395
- [:TkBITOR, TkOp, "|"],
396
- [:TkBITXOR, TkOp, "^"],
397
- [:TkBITAND, TkOp, "&"],
398
- [:TkBITNOT, TkOp, "~"],
399
- [:TkNOTOP, TkOp, "!"],
400
-
401
- [:TkBACKQUOTE, TkOp, "`"],
402
-
403
- [:TkASSIGN, Token, "="],
404
- [:TkDOT, Token, "."],
405
- [:TkSAFENAV, Token, "&."],
406
- [:TkLPAREN, Token, "("], #(exp)
407
- [:TkLBRACK, Token, "["], #[arry]
408
- [:TkLBRACE, Token, "{"], #{hash}
409
- [:TkRPAREN, Token, ")"],
410
- [:TkRBRACK, Token, "]"],
411
- [:TkRBRACE, Token, "}"],
412
- [:TkCOMMA, Token, ","],
413
- [:TkSEMICOLON, Token, ";"],
414
-
415
- [:TkCOMMENT, TkVal],
416
- [:TkSPACE, Token, " "],
417
- [:TkNL, Token, "\n"],
418
- [:TkEND_OF_SCRIPT],
419
-
420
- [:TkBACKSLASH, TkUnknownChar, "\\"],
421
- [:TkAT, TkUnknownChar, "@"],
422
- [:TkDOLLAR, TkUnknownChar, "$"],
423
- ]
424
-
425
- # {reading => token_class}
426
- # {reading => [token_class, *opt]}
427
- TkReading2Token = {}
428
- TkToken2Reading = {}
429
- TkSymbol2Token = {}
430
-
431
- def self.def_token(token_n, super_token = Token, reading = nil, *opts)
432
- token_n = token_n.id2name if token_n.kind_of?(Symbol)
433
- if const_defined?(token_n)
434
- IRB.fail AlreadyDefinedToken, token_n
435
- end
436
- token_c = eval("class #{token_n} < #{super_token}; end; #{token_n}")
437
-
438
- if reading
439
- TkToken2Reading[token_c] = reading
440
-
441
- return if TkReading2Token[reading]
442
-
443
- if opts.empty?
444
- TkReading2Token[reading] = [token_c]
445
- else
446
- TkReading2Token[reading] = [token_c].concat(opts)
447
- end
448
- end
449
- TkSymbol2Token[token_n.intern] = token_c
450
- end
451
-
452
- for defs in TokenDefinitions
453
- def_token(*defs)
454
- end
455
-
456
- def_token :TkRD_COMMENT, TkCOMMENT
457
-
458
- NEWLINE_TOKEN = TkNL.new 0, 0, 0, "\n"
459
-
460
- class TkSYMBOL
461
-
462
- def to_sym
463
- @sym ||= text[1..-1].intern
464
- end
465
-
466
- end
467
-
468
- # :startdoc:
469
- end
470
-