Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

remove erroneous escaping of '/' in the parser for quoted Regexp

  • Loading branch information...
commit b4bdf3869e2f5fb0092138139852a03d7a61921b 1 parent 37b2281
@timfel timfel authored
Showing with 7 additions and 3 deletions.
  1. +7 −3 src/smalltalk/ruby/Regexp.gs
View
10 src/smalltalk/ruby/Regexp.gs
@@ -60,7 +60,7 @@ new: aString options: anInteger lang: langString
for specified pattern string and options.
langString must specifiy ASCII ."
- | res status opts |
+ | res status opts unescapedString |
aString _isRegexp ifTrue:[ ^ aString copy ].
@@ -73,9 +73,13 @@ new: aString options: anInteger lang: langString
].
opts := self optsFromLang: langString opts: opts .
].
-
+
+ "FIXME: This is a workaround for a bug in the parser. It's compile time,
+ so shouldn't be too bad, but remove this once GitHub issue #142 is fixed
+ properly"
+ unescapedString := aString copyReplaceAll: '\/' with: '/'.
res := self rubyNewCFinalizer_stBaseClass: Regexp .
- status := res _compile: aString options: opts .
+ status := res _compile: unescapedString options: opts .
status ~~ res ifTrue:[ RegexpError signal: status ].
^ res
%
Please sign in to comment.
Something went wrong with that request. Please try again.