handlebars-lang / handlebars.js

Minimal templating on steroids.
http://handlebarsjs.com
MIT License
17.95k stars 2.04k forks source link

Allow colon characters in identifiers #460

Closed jpfiset closed 11 years ago

jpfiset commented 11 years ago

We are porting the Nunaliit (http://nunaliit.org https://github.com/GCRC/nunaliit) application from Mustache to Handlebars. In Nunaliit, there are a number of functions named with a special character so as to not have a function's name collide with a valid document property. More specifically, the names of helper functions start with a colon.

Would it be possible to had the colon character for identifiers so as our project can port to handlebars and support legacy templates?

kpdecker commented 11 years ago

Covered in 681f1a63

kpdecker commented 11 years ago

Thats to say that this was merged already but github didn't seem to pick that fact up.

wycats commented 11 years ago

I'm not a huge fan of having a policy of adding new characters in ID anytime anyone asks for them. What's the limit?

kpdecker commented 11 years ago

Personally I'd argue that anything that doesn't conflict with the rest of the grammar is fine. You can access just about anything using the [] syntax but I'm not certain that should be a requirement.

On the other hand freeforall IDs limits what can be done in the future if more behavior is added to the language.