summaryrefslogtreecommitdiffstats
path: root/spec/ast.js
Commit message (Collapse)AuthorAgeFilesLines
* Avoid direct references to sexpr in statementskpdecker2015-01-181-5/+5
| | | | | 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.
* Rework strip flags to make clearer at in AST levelkpdecker2014-11-281-7/+8
| | | 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-56/+3
|
* Rename AST objects to match type nameskpdecker2014-11-281-38/+32
|
* Update subexpression and hash AST constructskpdecker2014-11-271-1/+1
|
* Replace DataNode and IdNode with PathNodekpdecker2014-11-261-13/+5
| | | 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.
* Update statement node ASTskpdecker2014-11-261-36/+27
|
* Update MustacheNode for new AST structurekpdecker2014-11-261-9/+4
|
* Update ProgramNode to better match SpiderMonkeykpdecker2014-11-261-56/+56
|
* Update AST location info to match SpiderMonkeykpdecker2014-11-261-20/+19
| | | Part of #889
* Add parser support for block paramsMartin Muñoz2014-11-111-1/+1
|
* Simplify BlockNode by removing intermediate MustacheNodeMartin Muñoz2014-11-021-1/+1
|
* Allow whitespace control on commentskpdecker2014-11-021-1/+1
| | | | | 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-46/+17
| | | | | We can simplify our previous standalone determination logic by merging content blocks again. Fixes #854
* Replace string value rather than add omit flagkpdecker2014-08-231-34/+34
|
* Merge branch 'refactor-parser' of github.com:mmun/handlebars.js into ↵kpdecker2014-08-231-35/+13
|\ | | | | | | | | | | | | | | | | mmun-refactor-parser Conflicts: lib/handlebars/compiler/ast.js spec/ast.js src/handlebars.yy
| * Refactor blocks, programs and inversesMartin Muñoz2014-07-291-34/+13
| |
* | Flag standalone nodes in the ASTkpdecker2014-08-121-0/+148
| |
* | Track root status in ProgramNode constructorkpdecker2014-08-121-4/+4
| |
* | Parse context sections by linekpdecker2014-08-121-5/+5
|/
* Allow decimal number valueskpdecker2014-01-171-2/+2
| | | Fixes #472
* Add partial hash parser supportkpdecker2014-01-171-1/+1
|
* Include line info in compiler thrown exceptionskpdecker2014-01-011-9/+9
| | | Fixes #636
* Added support for subexpressionsmachty2013-12-301-2/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* add line numbers to nodes when parsingStanley Stuart2013-12-281-1/+185
| | | | closes #691
* Add AST test coverage for more complex pathskpdecker2013-12-231-0/+82