kpdecker
d044ada7aa
Convert children to nested functions. Reuse identifiers by closure where possible.
2011-07-31 16:17:39 -05:00
kpdecker
72ea816cf7
Remove debug code
2011-07-30 16:11:37 -05:00
kpdecker
ccf32821df
Throw a handlebars exception when attempting to use template partials in VM mode.
2011-07-30 16:01:43 -05:00
kpdecker
5aa12b5e09
Rename Handlebars.VM.compile to Handelbars.VM.template
2011-07-30 15:23:01 -05:00
kpdecker
4a9270aa38
Fix module loading within node
2011-07-30 12:18:56 -05:00
kpdecker
59f5331db4
Phase 2 of precompiled extraction:
...
Use string representations to pass around the function context
2011-07-30 11:23:24 -05:00
kpdecker
74bd8cac60
Phase 1 of precompiled extraction:
...
Separate template logic from container construction.
2011-07-30 11:10:13 -05:00
kpdecker
f2dccb753f
Break compiler and vm logic into separate files.
2011-07-30 10:11:13 -05:00
tomhuda
5d99572006
Rename vm.js to compiler.js
2011-05-03 20:38:28 -07:00
tomhuda
201ecbd7bc
Improve Handlebars subclassability
2011-05-03 19:30:32 -07:00
tomhuda
9333d1210d
Add support for passing String parameters to helper
2011-05-03 19:30:32 -07:00
Yehuda Katz
3e5bc84058
Merge pull request #69 from rgrove/allow-hyphens.
...
Allow ids to contain hyphens. Fixes #36 .
2011-05-03 19:01:37 -07:00
Yehuda Katz
5d8480fa8a
Merge pull request #48 from jasondavies/master.
...
Fix multi-backslash escaping
2011-05-03 18:59:59 -07:00
Ryan Grove
b324d002ca
Allow ids to contain hyphens. Fixes #36 .
...
Previously, a mustache like {{foo-bar}} would generate a
parse error, which was a departure from the behavior of
other Mustache implementations.
2011-04-28 22:30:21 -07:00
tomhuda
a7bb51d8a5
DRY up some code that converts program AST nodes to opcodes.
2011-03-04 15:17:32 -08:00
tomhuda
357710f136
Add support for block hashes and clean up mustache/program code
2011-03-04 15:10:22 -08:00
tomhuda
ca9b9671a5
Add Hash arguments to simple mustaches (TODO: add Hash args to block helpers)
2011-03-04 00:11:03 -08:00
Jason Davies
0397f875c5
Merge branch 'master' of http://github.com/wycats/handlebars.js
2011-02-28 22:23:11 +00:00
Jason Davies
2cf88d4e77
Fix backslash escaping
2011-02-28 22:23:02 +00:00
tomhuda
32d7e52182
Helpers take precedence over context properties with the same name. This is useful in scenarios where your context object is inherited from another system (such as a framework or JSON API) that may contain properties that conflict with helpers you explicitly define.
2011-02-25 23:01:11 -08:00
tomhuda
2b319bef2f
Make the function passed to a block helper have an identical signature to top-level template methods
2011-02-14 16:05:01 -08:00
tomhuda
d7f93c09e7
Subclasses should be able to replace the compiler - this is needed so that child views are compiled using the updated semantics of the parent compiler
2011-02-11 20:11:52 -08:00
tomhuda
299a0e81e3
data is passed to block helpers
2011-02-11 20:11:23 -08:00
tomhuda
88e7003331
* Added a few public API methods to JavaScriptCompiler.prototype, so it can be subclassed.
...
* made it possible to define an alternate name lookup scheme (so that {{foo}} does not have to be
context.foo, but can instead be something like context.get('foo'))
* made it possible to substitute an alternate buffer instead of the default empty String and override how
the compiled template appends to the buffer
* Added the concept of template-local data. In order to enable template-local data, pass true
as the second parameter to the template compiler. Then, pass in the data as the fourth
parameter (context, helpers, partials, data). These signatures may change before the 1.0 release.
2011-02-11 17:03:12 -08:00
wycats
aaaafb4400
Makes Handlebars work in contexts without a global object (node)
2011-02-08 14:31:09 -08:00
wycats
b7c649617b
noop should return an empty String, not undefined
2011-01-11 23:16:03 -08:00
wycats
1974aa5277
If the partial is not found, an exception should be thrown
2010-12-29 19:23:23 -08:00
wycats
e20c57c9b2
Move compile to the right spot
2010-12-29 19:09:55 -08:00
wycats
bf6c74aa83
Restructure things more simply
2010-12-29 18:21:43 -08:00
wycats
16ed2cd3f1
Refactoring and performance enhancements on the VM compiler
2010-12-21 09:47:27 -08:00
wycats
fc0d721b96
Use pluggable logger rather the puts
2010-12-21 09:45:59 -08:00
wycats
f4ae0c27fe
Allow reserved words to be used without slowing down most operations in browsers with faster foo.bar vs. foo['bar'].
2010-12-19 00:06:30 -08:00
wycats
b418ef6eb2
Add optimized compiled version of handlebars, which should be significantly faster. Use Handlebars.VM.compile instead of Handlebars.compile to use the optimized version.
...
Major TODOS:
* clean up a bunch of code duplication in the compiler
* reorganize the compiler
* add support for debug symbols which would make it possible
to provide information about what part of the source caused
a runtime error.
2010-12-18 23:27:34 -08:00