satyr / coco

Unfancy CoffeeScript
http://satyr.github.com/coco/
MIT License
498 stars 48 forks source link

Make strings/regexs escape like markdown ? #219

Closed vendethiel closed 11 years ago

vendethiel commented 11 years ago

I could see strings/regexs escape like markdown (I have an use case for both), to allow for more flexibility. I looked at 7915ca548825f89232de3629d098f87251bff7b4 but I'm not sure it would be that easy for these because interpolations (though I don't exactly now how these "works", I just know you you instantiate a new lexer, counting pairs to find the closing } then merge tokens, or something like that).

satyr commented 11 years ago

Wouldn't work for strings, where the empty literal is essential.

vendethiel commented 11 years ago

My bad. Indeed, we need it,especially since the short string syntax doesn't allow it either. Attractive for regexs? I'm not sure why we'd need an empty one, and even then, we have /(?:)/

satyr commented 11 years ago

Regexes possible, though not very attractive.

For one, unlike JS literal, the single-slash and double-slash have different semantics.