summaryrefslogtreecommitdiffstats
path: root/lib/handlebars/compiler/helpers.js
Commit message (Collapse)AuthorAgeFilesLines
* Add decorator parsingkpdecker2015-08-221-2/+9
|
* Create validateClose helper methodkpdecker2015-08-221-20/+19
| | | | Avoid duplicating the logic needed to check for close block mismatches.
* Implement partial blockskpdecker2015-08-221-0/+19
| | | | | | This allows for failover for missing partials as well as limited templating ability through the `{{> @partial-block }}` partial special case. Partial fix for #1018
* Drop AST constructors in favor of JSONkpdecker2015-08-181-17/+55
| | | | | These were little more than object literal statements that were less clear due to their use of index-based arguments. Fixes #1077
* Enforce 100% code coveragekpdecker2015-08-031-8/+9
|
* #1056 Fixed grammar for nested raw blocksEric Nielsen2015-07-151-2/+2
|
* Fix location information for programskpdecker2015-06-261-0/+25
| | | | | | | | 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
* Remove jshint completelykpdecker2015-04-271-4/+0
|
* Update for let and optional parameterskpdecker2015-04-201-8/+8
|
* Add full support for es6kpdecker2015-04-161-3/+3
| | | | | | | | Converts the tool chain to use babel, eslint, and webpack vs. the previous proprietary solutions. Additionally begins enforcing additional linting concerns as well as updates the code to reflect these rules. Fixes #855 Fixes #993
* Allow this references in literal statementskpdecker2015-04-141-2/+13
| | | Fixes #967
* Avoid direct references to sexpr in statementskpdecker2015-01-181-10/+12
| | | | | 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.
* Bump code coveragekpdecker2014-12-261-2/+2
|
* Rework strip flags to make clearer at in AST levelkpdecker2014-11-281-183/+21
| | | 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.
* Move Jison parsing out of AST into helperskpdecker2014-11-281-0/+37
|
* Rename AST objects to match type nameskpdecker2014-11-281-4/+4
|
* Update subexpression and hash AST constructskpdecker2014-11-271-4/+4
|
* Update statement node ASTskpdecker2014-11-261-11/+11
|
* Update ProgramNode to better match SpiderMonkeykpdecker2014-11-261-39/+39
|
* Update AST location info to match SpiderMonkeykpdecker2014-11-261-8/+14
| | | Part of #889
* Add parser support for block paramsMartin Muñoz2014-11-111-1/+3
|
* Merge branch 'remove-block-mustache' of github.com:mmun/handlebars.js into ↵kpdecker2014-11-081-7/+27
|\ | | | | | | | | | | | | | | mmun-remove-block-mustache Conflicts: lib/handlebars/compiler/helpers.js spec/parser.js
| * Remove RawBlockNode in favor of prepareRawBlock helperMartin Muñoz2014-11-051-1/+3
| |
| * Simplify BlockNode by removing intermediate MustacheNodeMartin Muñoz2014-11-021-7/+25
| |
* | Merge pull request #892 from wycats/else-ifKevin Decker2014-11-081-7/+26
|\ \ | | | | | | Implement parser for else chaining of helpers
| * | Implement parser for else chaining of helperskpdecker2014-10-271-7/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | Bump test coveragekpdecker2014-11-081-1/+2
| |/ |/|
* | Allow whitespace control on commentskpdecker2014-11-021-0/+5
|/ | | | | This changes the call signature for the CommentNode constructor, which is a potentially breaking change for AST users. Fixes #866
* Refactor content blocks to ignore lineskpdecker2014-08-251-57/+31
| | | | | We can simplify our previous standalone determination logic by merging content blocks again. Fixes #854
* Cleanup from code coverage reportkpdecker2014-08-231-2/+2
|
* Move strip processing into AST helper logickpdecker2014-08-231-18/+66
| | | | | We already have to track these behaviors for the standalone parsing and rather than having two whitespace pruning implementations this moves all of the behavior into one place. Fixes #852
* Replace string value rather than add omit flagkpdecker2014-08-231-2/+3
|
* Merge branch 'refactor-parser' of github.com:mmun/handlebars.js into ↵kpdecker2014-08-231-9/+131
| | | | | | | | | mmun-refactor-parser Conflicts: lib/handlebars/compiler/ast.js spec/ast.js src/handlebars.yy
* Refactor blocks, programs and inversesMartin Muñoz2014-07-291-0/+41