Skip to content
Open
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
1 change: 1 addition & 0 deletions lib/method_source/code_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ module IncompleteExpression
/embedded document meets end of file/, # =begin
/unterminated (quoted string|string|regexp|list) meets end of file/, # "quoted string" is ironruby
/can't find string ".*" anywhere before EOF/, # rbx and jruby
/expected a closing delimiter for the `%x` or backtick string/, # prism
/missing 'end' for/, /expecting kWHEN/ # rbx
]

Expand Down
5 changes: 5 additions & 0 deletions spec/method_source/code_helpers_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
@tester = Object.new.extend(MethodSource::CodeHelpers)
end

it "recognizes incomplete command-string delimiters" do
expect(@tester.complete_expression?("%x[word")).to be_falsy
expect(@tester.complete_expression?("`word")).to be_falsy
end

[
["p = '", "'"],
["def", "a", "(); end"],
Expand Down