cujojs / wire

A light, fast, flexible Javascript IOC container
Other
861 stars 68 forks source link

add regex to support comment inside string like http://example.com #136

Open fabricematrat opened 10 years ago

fabricematrat commented 10 years ago

Hi,

To be able to support 'http://example.com' inside the template, cram should avoid to take it as a comment. The current behavior of cram will create an invalid file with 'http: and then the next line. I implemented a regexp which replace the string containing comments (// or /.../) by a temp variable and store it in an array. Then call the same logic of removing comment, then put back the original string.

BR, Fabrice.

briancavalier commented 10 years ago

Thanks, @fabricematrat. I'll have a look at this soon. Hopefully @unscriptable can take a look, too, since he did a lot of the more recent work on the builder.

briancavalier commented 10 years ago

This is looking pretty good to me. I love that you separated out part of the parsing so it is testable. Any concerns, @unscriptable?