diff options
Diffstat (limited to 'lib/irb/ruby-token.rb')
-rw-r--r-- | lib/irb/ruby-token.rb | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/irb/ruby-token.rb b/lib/irb/ruby-token.rb index 525d4df14c..1415c8d90a 100644 --- a/lib/irb/ruby-token.rb +++ b/lib/irb/ruby-token.rb @@ -1,5 +1,5 @@ # -# irb/ruby-token.rb - ruby tokens +# irb/ruby-token.rb - ruby tokens # $Release Version: 0.9.5$ # $Revision$ # $Date$ @@ -7,7 +7,7 @@ # # -- # -# +# # module RubyToken EXPR_BEG = :EXPR_BEG @@ -22,7 +22,7 @@ module RubyToken if !defined?(Symbol) Symbol = Integer end - + class Token def initialize(seek, line_no, char_no) @seek = seek @@ -87,7 +87,7 @@ module RubyToken if (tk = TkReading2Token[token]).nil? IRB.fail TkReading2TokenNoKey, token end - tk = Token(tk[0], value) + tk = Token(tk[0], value) if tk.kind_of?(TkOp) tk.name = token end @@ -96,8 +96,8 @@ module RubyToken if (tk = TkSymbol2Token[token]).nil? IRB.fail TkSymbol2TokenNoKey, token end - return Token(tk[0], value) - else + return Token(tk[0], value) + else if (token.ancestors & [TkId, TkVal, TkOPASGN, TkUnknownChar]).empty? token.new(@prev_seek, @prev_line_no, @prev_char_no) else @@ -197,7 +197,7 @@ module RubyToken [:TkASSOC, TkOp, "=>"], [:TkQUESTION, TkOp, "?"], #? [:TkCOLON, TkOp, ":"], #: - + [:TkfLPAREN], # func( # [:TkfLBRACK], # func[ # [:TkfLBRACE], # func{ # @@ -253,7 +253,7 @@ module RubyToken IRB.fail AlreadyDefinedToken, token_n end token_c = eval("class #{token_n} < #{super_token}; end; #{token_n}") - + if reading if TkReading2Token[reading] IRB.fail TkReading2TokenDuplicateError, token_n, reading |