Skip to content

Can't create a regex that starts with = #1399

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
rstacruz opened this issue May 29, 2011 · 3 comments
Closed

Can't create a regex that starts with = #1399

rstacruz opened this issue May 29, 2011 · 3 comments
Labels

Comments

@rstacruz
Copy link

$ coffee
coffee> re = /=/
Error: In repl, Parse error on line 1: Unexpected 'COMPOUND_ASSIGN'

CoffeeScript v1.1.0, NodeJS v0.4.7, Mac OSX 10.6.7

@rstacruz
Copy link
Author

This can be worked around with:

re = /\=/

I encountered this issue while trying to make Zepto work with js2coffee.

@mpolden
Copy link

mpolden commented Jun 11, 2012

I encountered this issue as well. It's inconsistent with regular JS.

coffee> 'foo = foo'.replace /=.*/, 'bar'
Error: In repl, Parse error on line 1: Unexpected '.'
    at Object.parseError (/opt/node-v0.6.19/lib/node_modules/coffee-script/lib/coffee-script/parser.js:477:11)
    at Object.parse (/opt/node-v0.6.19/lib/node_modules/coffee-script/lib/coffee-script/parser.js:554:22)
    at /opt/node-v0.6.19/lib/node_modules/coffee-script/lib/coffee-script/coffee-script.js:43:20
    at Object.eval (/opt/node-v0.6.19/lib/node_modules/coffee-script/lib/coffee-script/coffee-script.js:140:10)
    at Interface.<anonymous> (/opt/node-v0.6.19/lib/node_modules/coffee-script/lib/coffee-script/repl.js:131:40)
    at Interface.emit (events.js:67:17)
    at Interface._onLine (readline.js:162:10)
    at Interface._line (readline.js:426:8)
    at Interface._ttyWrite (readline.js:603:14)
    at ReadStream.<anonymous> (readline.js:82:12)
> 'foo = foo'.replace(/=.*/, 'bar')
'foo bar'
$ coffee -v
CoffeeScript version 1.3.3
$ node -v
v0.6.19

@vendethiel vendethiel added the bug label Nov 3, 2014
@lydell
Copy link
Collaborator

lydell commented Jan 10, 2015

Fixed by #3782.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants