Skip to content

Remove old token name #554

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 17, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions lib/rdoc/parser/ruby.rb
Original file line number Diff line number Diff line change
Expand Up @@ -318,8 +318,7 @@ def error(msg)
end

##
# Looks for a true or false token. Returns false if TkFALSE or TkNIL are
# found.
# Looks for a true or false token.

def get_bool
skip_tkspace
Expand Down Expand Up @@ -1461,8 +1460,7 @@ def parse_method_name_singleton container, name_t # :nodoc:
name_t2 = get_tk

if (:on_kw == name_t[:kind] && 'self' == name_t[:text]) || (:on_op == name_t[:kind] && '%' == name_t[:text]) then
# NOTE: work around '[' being consumed early and not being re-tokenized
# as a TkAREF
# NOTE: work around '[' being consumed early
if :on_lbracket == name_t2[:kind]
get_tk
name = '[]'
Expand Down
10 changes: 5 additions & 5 deletions test/test_rdoc_parser_ruby.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2826,7 +2826,7 @@ def test_parse_statements_identifier_yields
assert_nil m.params, 'Module parameter not removed'
end

def test_parse_statements_stopdoc_TkALIAS
def test_parse_statements_stopdoc_alias
klass = @top_level.add_class RDoc::NormalClass, 'Foo'

util_parser "\n# :stopdoc:\nalias old new"
Expand All @@ -2837,7 +2837,7 @@ def test_parse_statements_stopdoc_TkALIAS
assert_empty klass.unmatched_alias_lists
end

def test_parse_statements_stopdoc_TkIDENTIFIER_alias_method
def test_parse_statements_stopdoc_identifier_alias_method
klass = @top_level.add_class RDoc::NormalClass, 'Foo'

util_parser "\n# :stopdoc:\nalias_method :old :new"
Expand All @@ -2848,7 +2848,7 @@ def test_parse_statements_stopdoc_TkIDENTIFIER_alias_method
assert_empty klass.unmatched_alias_lists
end

def test_parse_statements_stopdoc_TkIDENTIFIER_metaprogrammed
def test_parse_statements_stopdoc_identifier_metaprogrammed
klass = @top_level.add_class RDoc::NormalClass, 'Foo'

util_parser "\n# :stopdoc:\n# attr :meta"
Expand All @@ -2859,7 +2859,7 @@ def test_parse_statements_stopdoc_TkIDENTIFIER_metaprogrammed
assert_empty klass.attributes
end

def test_parse_statements_stopdoc_TkCONSTANT
def test_parse_statements_stopdoc_constant
klass = @top_level.add_class RDoc::NormalClass, 'Foo'

util_parser "\n# :stopdoc:\nA = v"
Expand All @@ -2869,7 +2869,7 @@ def test_parse_statements_stopdoc_TkCONSTANT
assert_empty klass.constants
end

def test_parse_statements_stopdoc_TkDEF
def test_parse_statements_stopdoc_def
klass = @top_level.add_class RDoc::NormalClass, 'Foo'

util_parser "\n# :stopdoc:\ndef m\n end"
Expand Down