summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authoraycabta <aycabta@gmail.com>2019-05-21 18:36:10 +0900
committeraycabta <aycabta@gmail.com>2019-05-21 18:37:35 +0900
commitfd95ab44c66ce6b756f66210640cf8e8ffd1bd32 (patch)
treeae694fcf6131710537b591cc229b9550157a6e6b /lib
parent3f6b5f447caf8f8ca06d5c170e9266ef20945834 (diff)
IRB should eval and show an error when only `.` is inputted
Diffstat (limited to 'lib')
-rw-r--r--lib/irb/ruby-lex.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/irb/ruby-lex.rb b/lib/irb/ruby-lex.rb
index c4bec4a854..7b376b0a40 100644
--- a/lib/irb/ruby-lex.rb
+++ b/lib/irb/ruby-lex.rb
@@ -126,7 +126,7 @@ class RubyLex
end
def process_continue
- continued_bits = Ripper::EXPR_BEG | Ripper::EXPR_FNAME | Ripper::EXPR_DOT
+ continued_bits = Ripper::EXPR_BEG | Ripper::EXPR_FNAME
# last token is always newline
if @tokens.size >= 2 and @tokens[-2][1] == :on_regexp_end
# end of regexp literal
@@ -185,6 +185,12 @@ class RubyLex
# example:
# end
return false
+ when /syntax error, unexpected '\.'/
+ # "syntax error, unexpected '.'"
+ #
+ # example:
+ # .
+ return false
when /unexpected tREGEXP_BEG/
# "syntax error, unexpected tREGEXP_BEG, expecting keyword_do or '{' or '('"
#