| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
Allows for ] literal characters to be used within [] IDs by prefixing them with the \ character. `\` literal at the end of the may be referenced by the `\\` sequence if conflicting. Under most circumstances the `\\` sequence will continue to work.
Potentially breaking change for users of [] ids that have `\\` anywhere in the id or `\` at the end of the id.
Fixes #1092
|
| |
|
|
|
|
| |
Avoid duplicating the logic needed to check for close block mismatches.
|
|
|
|
|
|
| |
This allows for failover for missing partials as well as limited templating ability through the `{{> @partial-block }}` partial special case.
Partial fix for #1018
|
|
|
|
|
| |
These were little more than object literal statements that were less clear due to their use of index-based arguments.
Fixes #1077
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
There appears to be a bug in our use of jison causing the parent location information to be reported to programs. I wasn’t able to work through what might be causing this so instead using the location information of the statements collection to generate the proper location information.
This is a bit of a hack but we are very far behind on the Jison release train and upgrading will likely be a less than pleasant task that doesn’t provide us much benefit.
Fixes #1024
|
| |
|
|
|
| |
Fixes #967
|
| |
|
|
|
|
|
| |
This adds the UndefinedLiteral and NullLiteral to AST.
Fixes #990
|
|
|
| |
Adds support for literal helper names in a few missing cases such as block expressions and subexpressions.
|
| |
|
|
|
|
|
| |
This allows us to avoid creating unnecessary AST nodes and avoids things like isHelper.
Side effect of these changes is that @data functions can now have data parameters passed to them.
|
|
|
|
|
|
|
|
|
| |
Uses the subexpression syntax to allow for dynamic partial lookups. Ex:
```
{{> (helper) }}
```
Fixes #933
|
| |
|
|
|
| |
Rather than keeping state in the AST, which requires some gymnastics, we create a separate visitor flow which does the top down iteration necessary to calculate all of the state needed for proper whitespace control evaluation.
|
| |
|
| |
|
| |
|
| |
|
|
|
| |
This is a breaking change for string mode users as there is no longer a distinct type for data parameters. Instead data consumers should look for the @ prefix value.
|
| |
|
| |
|
| |
|
|
|
| |
Part of #889
|
| |
|
|\
| |
| |
| |
| |
| |
| |
| | |
mmun-remove-block-mustache
Conflicts:
lib/handlebars/compiler/helpers.js
spec/parser.js
|
| | |
|
|\ \
| |/
|/| |
Implement parser for else chaining of helpers
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Allows users to chain multiple helpers together using their inverse callbacks. I.e.
```
{{#if foo}}
{{else if bar}}
{{else}}
{{/if}}
```
The control flow here effectively causes the helpers to be nested. The above is actually syntactic sugar for this:
```
{{#if foo}}
{{else}}
{{#if bar}}
{{else}}
{{/if}}
{{/if}}
```
Any helper may be used in this manner, the only requirement is they support normal calls and inverse calls.
Introduces a breaking change in that `{{else foo}}` may no longer be used as a root level operator. Instead `{{^foo}}` must be used.
Fixes #72.
|
|/
|
|
|
| |
This changes the call signature for the CommentNode constructor, which is a potentially breaking change for AST users.
Fixes #866
|
|
|
|
|
| |
We can simplify our previous standalone determination logic by merging content blocks again.
Fixes #854
|
| |
|
|\
| |
| |
| |
| |
| |
| |
| |
| | |
mmun-refactor-parser
Conflicts:
lib/handlebars/compiler/ast.js
spec/ast.js
src/handlebars.yy
|
| | |
|
| | |
|
| | |
|
|/ |
|
| |
|
| |
|
| |
|
|
|
| |
Fixes #472
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Handlebars now supports subexpressions.
{{foo (bar 3)}}
Subexpressions are always evaluated as helpers; if
`3` were omitted from the above example, `bar`
would be invoked as a param-less helper, even
though a top-levell `{{bar}}` would be considered
ambiguous.
The return value of a subexpression helper is
passed in as a parameter of a parent subexpression
helper, even in string params mode. Their type,
as listed in `options.types` or `options.hashTypes`
in string params mode, is "sexpr".
The main conceptual change in the Handlebars code
is that there is a new AST.SexprNode that manages
the params/hash passed into a mustache, as well
as the logic that governs whether that mustache
is a helper invocation, property lookup, etc.
MustacheNode, which used to manage this stuff,
still exists, but only manages things like
white-space stripping and whether the mustache
is escaped or not. So, a MustacheNode _has_
a SexprNode.
The introduction of subexpressions is fully
backwards compatible, but a few things needed
to change about the compiled output of a template
in order to support subexpressions. The main one
is that the options hash is no longer stashed in
a local `options` var before being passed to
either the helper being invoked or the
`helperMissing` fallback. Rather, the options
object is inlined in these cases. This does
mean compiled template sizes will be a little
bit larger, even those that don't make use of
subexpressions, but shouldn't have any noticeable
impact on performance when actually rendering
templates as only one of these inlined objects
will actually get evaluated.
|
|
|
|
| |
closes #691
|
|\
| |
| |
| |
| |
| |
| | |
dmarcotte-fix-escapes
Conflicts:
spec/tokenizer.js
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Escaped-escape mustaches ("\\{{") immediately following escaped
mustaches ("\{{") were being handled incorrectly.
Fix the lookahead to make sure yytext still contains the appropriate
slashes when we pop out of <emu> so they can be handled consistently
by the initial state.
|
| |
| |
| |
| |
| | |
Older versions of IE do not support [] access to string contents so charAt must be used.
Fixes #677
|
|/
|
| |
Allows us to execute jshint in non-forced mode.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
Previously, "\\{{foo}}" would only result in the desired "\fooValue" if
it was at the beginning of the file or immediately after a close stache.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
| |
Resolves a parsing issue in the 0.4 branch of jison.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
| |
Fixes #437
|
|
|
| |
Fixes #519
|
| |
|
| |
|
|
|
|
| |
Fixes #433
Fixes #469
|
| |
|
| |
|
|\
| |
| | |
Fix support for Rhino
|
| | |
|
|\ \ |
|
| | |
| | |
| | | |
Issue #460
|
| |/
| |
| |
| |
| | |
avoid name collisions with registered helper functions.
Issue #458
|
|/
|
| |
Fixes #456
|
|
|
| |
Fixes #422
|
|
|
|
|
| |
Removes unnecessary commonjs code generated for the parser. This reduces
the size of the parse by about 700bytes and should resolve lookup issues
with browserify and other static analysis tools. See #220
|
|\
| |
| | |
Allow empty blocks around simple inverses
|
| |
| |
| |
| |
| |
| |
| |
| | |
Previously, the parser required at least one character of whitespace
to properly interpret empty blocks around simple inverses, which was
non-intuitive and inconsistent with empty block parsing.
Update the parser to allow empty blocks around simple inverses.
|
|/
|
|
|
|
| |
Allows partials with slashes, a common partial syntax. For example:
{{> shared/dude}}
|
|
|
|
| |
{{!-- can contain
{{handlebars expressions}} --}}
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
* Make block and inverse use the main helper path
* Eliminate separate inverse AST node
|
| |
|
| |
|
| |
|