Skip to content
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

Regex literal lexer is too aggressive #22

Closed
liamoc opened this issue Jan 1, 2010 · 1 comment
Closed

Regex literal lexer is too aggressive #22

liamoc opened this issue Jan 1, 2010 · 1 comment

Comments

@liamoc
Copy link

liamoc commented Jan 1, 2010

This gives an unexpected regex error because of the two division signs.

add_bezier_slopes(ground,0,height / 2, width, height * 6 / 10)
@jashkenas
Copy link
Owner

Thanks. Nice bug. There's a interesting discussion of the issue here:

http://www.mozilla.org/js/language/js20-2002-04/rationale/syntax.html#regular-expressions

Fixed now on master by making the lexer check the previous token before deciding if it's a regex or not. Regexes can't immediately follow identifiers, numbers, or strings. Division signs can only follow identifiers and numbers.

Closing the ticket.

alangpierce pushed a commit to alangpierce/coffeescript that referenced this issue Feb 12, 2017
`Op` represents both binary and unary operations, and in the unary case the second operand is not present.
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants