The simplest way to express this question is with a small example in the repl:
coffee> "hello".split(/: #/) #this is fine
[ 'hello' ]
coffee> "hello".split(/\s#/) #all good here too
[ 'hello' ]
coffee> "hello".split(/ #/) #wtf??
[stdin]:1:20: error: missing )
"hello".split(/ #/)
Why does the last regex not work? from playing around a bit it seems that there will be an error for any regex matching ^ +.*#.*$
Note, that is a space at the start of the regex. (e.g. / foo#bar/
but not /foo bar#baz/
).
Is this a bug in the parser?
(running CoffeeScript version 1.7.1
on Arch Linux
)