summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Fitzgerald <rwfitzge@gmail.com>2013-07-27 14:55:38 -0700
committerRyan Fitzgerald <rwfitzge@gmail.com>2013-07-27 14:55:38 -0700
commit8083e124d1c336fb0563fa9a2deec592762f13c4 (patch)
tree53c5957782014445aa9edce329f0b92de3332eae
parent06f9ee6626f3dd5a5fab98b4c6eeefb1432e5eca (diff)
downloadmethod_source-8083e124d1c336fb0563fa9a2deec592762f13c4.tar.gz
Be more careful about separating out the rbx-only regexes
-rw-r--r--lib/method_source/code_helpers.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/method_source/code_helpers.rb b/lib/method_source/code_helpers.rb
index d555f5a..6c1d53e 100644
--- a/lib/method_source/code_helpers.rb
+++ b/lib/method_source/code_helpers.rb
@@ -125,13 +125,13 @@ module MethodSource
GENERIC_REGEXPS = [
/unexpected (\$end|end-of-file|end-of-input|END_OF_FILE)/, # mri, jruby, ruby-2.0, ironruby
/embedded document meets end of file/, # =begin
- /unterminated (quoted string|string|regexp) meets end of file/ # "quoted string" is ironruby
+ /unterminated (quoted string|string|regexp) meets end of file/, # "quoted string" is ironruby
+ /can't find string ".*" anywhere before EOF/, # rbx and jruby
+ /missing 'end' for/, /expecting kWHEN/ # rbx
]
- RBX_REGEXPS = [
- /missing 'end' for/, /expecting '[})\]]'(?:$|:)/,
- /can't find string ".*" anywhere before EOF/, /expecting keyword_end/,
- /expecting kWHEN/
+ RBX_ONLY_REGEXPS = [
+ /expecting '[})\]]'(?:$|:)/, /expecting keyword_end/
]
def self.===(ex)
@@ -139,7 +139,7 @@ module MethodSource
case ex.message
when *GENERIC_REGEXPS
true
- when *RBX_REGEXPS
+ when *RBX_ONLY_REGEXPS
rbx?
else
false