mirror of
https://github.com/pry/pry.git
synced 2022-11-09 12:35:05 -05:00
re-re-fix super... (I added a test this time :p)
This commit is contained in:
parent
4f2a496399
commit
b96a26c094
2 changed files with 5 additions and 1 deletions
|
@ -48,7 +48,10 @@ class Pry
|
||||||
# Tokens that indicate the end of a statement (i.e. that, if they appear
|
# Tokens that indicate the end of a statement (i.e. that, if they appear
|
||||||
# directly before an "if" indicates that that if applies to the same line,
|
# directly before an "if" indicates that that if applies to the same line,
|
||||||
# not the next line)
|
# not the next line)
|
||||||
STATEMENT_END_TOKENS = IGNORE_TOKENS + [:regexp, :integer, :float, :keyword]
|
#
|
||||||
|
# :reserved and :keywords are the CodeRay 0.9.8 and 1.0.0 respectively
|
||||||
|
# classifications of "super", "next", "return", etc.
|
||||||
|
STATEMENT_END_TOKENS = IGNORE_TOKENS + [:regexp, :integer, :float, :keyword, :reserved]
|
||||||
|
|
||||||
# Collection of tokens that should appear dedented even though they
|
# Collection of tokens that should appear dedented even though they
|
||||||
# don't affect the surrounding code.
|
# don't affect the surrounding code.
|
||||||
|
|
|
@ -195,6 +195,7 @@ TXT
|
||||||
@indent.reset.indent("foo() if bar\n#").should == "foo() if bar\n#"
|
@indent.reset.indent("foo() if bar\n#").should == "foo() if bar\n#"
|
||||||
@indent.reset.indent("foo 'hi' if bar\n#").should == "foo 'hi' if bar\n#"
|
@indent.reset.indent("foo 'hi' if bar\n#").should == "foo 'hi' if bar\n#"
|
||||||
@indent.reset.indent("foo 1 while bar\n#").should == "foo 1 while bar\n#"
|
@indent.reset.indent("foo 1 while bar\n#").should == "foo 1 while bar\n#"
|
||||||
|
@indent.reset.indent("super if true\n#").should == "super if true\n#"
|
||||||
end
|
end
|
||||||
|
|
||||||
it "should indent cunningly disguised ifs" do
|
it "should indent cunningly disguised ifs" do
|
||||||
|
|
Loading…
Reference in a new issue