Skip to content
This repository

space around operators #14

Closed
michaelficarra opened this Issue · 4 comments

2 participants

Michael Ficarra Matt Perpick
Michael Ficarra

All operators should have whitespace around them.

a | b # good
a|b # bad
Matt Perpick
Owner

Cool. I like it. Stay tuned.

Michael Ficarra

Just binary operators or unary word operators. Unary symbols, in contrast, should not have space between them and their operand.

Matt Perpick
Owner

Give this a whirl. It turns up a few cases of CoffeeScript's source.

It's a bit hackey though. It crudely ignores + tokens inside of interpolations and extended regexes (though it sort of has to guess at what these are). To get it 100% right, I think the CoffeeScript lexer would have to be tweaked to mark the interpolation + tokens it inserts as generated, then I could easily ignore them.

Matt Perpick clutchski closed this
Michael Ficarra

@clutchski: I bet we'd happily accept a pull request that marks those tokens as generated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.