summaryrefslogtreecommitdiffstats
path: root/lib/handlebars/compiler/ast.js
Commit message (Collapse)AuthorAgeFilesLines
* Drop AST constructors in favor of JSONkpdecker2015-08-181-126/+0
| | | | | These were little more than object literal statements that were less clear due to their use of index-based arguments. Fixes #1077
* Bulletproof AST.helpers.helperExpressionkpdecker2015-08-031-1/+3
| | | | | Avoid undefined values and potential false positives from other type values such as partials. Fixes #1055
* Update for let and optional parameterskpdecker2015-04-201-1/+1
|
* Add full support for es6kpdecker2015-04-161-5/+4
| | | | | | | | 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
* Add undefined and null literal supportkpdecker2015-04-071-0/+12
| | | | | This adds the UndefinedLiteral and NullLiteral to AST. Fixes #990
* Avoid direct references to sexpr in statementskpdecker2015-01-181-19/+17
| | | | | 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.
* Add support for dynamic partial nameskpdecker2015-01-181-0/+9
| | | | | | | | | Uses the subexpression syntax to allow for dynamic partial lookups. Ex: ``` {{> (helper) }} ``` Fixes #933
* Expose AST helpers in public APIkpdecker2014-12-211-0/+21
|
* Remove unused vars and add jshint checkingkpdecker2014-12-161-2/+0
|
* Add instructions for 'spec/mustache' to CONTRIBUTING.md, fix a few typos ↵Or Neeman2014-12-071-1/+1
| | | | elsewere
* Rework strip flags to make clearer at in AST levelkpdecker2014-11-281-4/+5
| | | 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-38/+9
|
* Add original to BooleanLiteralkpdecker2014-11-281-1/+2
|
* Rename AST objects to match type nameskpdecker2014-11-281-12/+12
|
* Update subexpression and hash AST constructskpdecker2014-11-271-10/+15
|
* Simplify Path and Sexpr calculated flagskpdecker2014-11-271-21/+2
|
* Replace DataNode and IdNode with PathNodekpdecker2014-11-261-19/+8
| | | 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 literal ast nodes for new speckpdecker2014-11-261-9/+6
|
* Update statement node ASTskpdecker2014-11-261-46/+35
|
* Update MustacheNode for new AST structurekpdecker2014-11-261-16/+5
|
* Update ProgramNode to better match SpiderMonkeykpdecker2014-11-261-2/+3
|
* Update AST location info to match SpiderMonkeykpdecker2014-11-261-22/+14
| | | Part of #889
* Add parser support for block paramsMartin Muñoz2014-11-111-1/+2
|
* Remove RawBlockNode in favor of prepareRawBlock helperMartin Muñoz2014-11-051-8/+0
|
* Simplify BlockNode by removing intermediate MustacheNodeMartin Muñoz2014-11-021-10/+4
|
* Allow whitespace control on commentskpdecker2014-11-021-4/+3
| | | | | This changes the call signature for the CommentNode constructor, which is a potentially breaking change for AST users. Fixes #866
* Prune unused codekpdecker2014-08-251-2/+0
|
* Add original value tracking to ContentNodekpdecker2014-08-231-1/+1
|
* Merge branch 'refactor-parser' of github.com:mmun/handlebars.js into ↵kpdecker2014-08-231-172/+6
|\ | | | | | | | | | | | | | | | | mmun-refactor-parser Conflicts: lib/handlebars/compiler/ast.js spec/ast.js src/handlebars.yy
| * Refactor blocks, programs and inversesMartin Muñoz2014-07-291-44/+6
| |
* | Flag standalone nodes in the ASTkpdecker2014-08-121-3/+138
| |
* | Track root status in ProgramNode constructorkpdecker2014-08-121-6/+6
|/
* Ensure isHelper is coerced to a booleanMartin Muñoz2014-05-051-1/+1
|
* Make raw blocks operate like blockskpdecker2014-02-091-3/+8
|
* raw block helpersJesse Ezell2014-02-091-0/+9
|
* Add trackIds compiler flagkpdecker2014-01-171-1/+5
| | | | Allows helpers that care about where a particular field came from derive this data while maintaining backward compatibility with existing helpers.
* Fix missing parameters for pathed mustacheskpdecker2014-01-171-5/+5
| | | Fixes #658
* Allow decimal number valueskpdecker2014-01-171-4/+4
| | | Fixes #472
* Add partial hash parser supportkpdecker2014-01-171-1/+2
|
* Fix DATA value in stringParams modekpdecker2014-01-061-0/+1
| | | | Fixes #699
* Include line info in compiler thrown exceptionskpdecker2014-01-011-7/+12
| | | Fixes #636
* Remove duplication from generated subexpressionskpdecker2014-01-011-0/+2
|
* Add location tracking to sexprkpdecker2013-12-311-1/+3
|
* Added support for subexpressionsmachty2013-12-301-3/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Fix ProgramNode parameter handling under IEkpdecker2013-12-291-3/+5
|
* add line numbers to nodes when parsingStanley Stuart2013-12-281-15/+55
| | | | closes #691
* Fix handling of boolean escape in MustacheNodekpdecker2013-12-231-3/+8
| | | Fixes issue with Ember compatibility due to direct instantiation of MustacheNode.
* Use charAt rather than string indexkpdecker2013-12-231-1/+2
| | | | | Older versions of IE do not support [] access to string contents so charAt must be used. Fixes #677
* Export AST as an object rather than modulekpdecker2013-12-011-136/+142
| | | The parser expects the AST object to be mutable, which modules are not.
* Load strip flags from lex streamkpdecker2013-10-141-8/+26
|
* Pass open token to MustacheNode for flag parsingkpdecker2013-10-141-2/+3
|
* Remove global Handlebars referenceskpdecker2013-10-091-1/+1
|
* Use proper default vs. module import semanticskpdecker2013-10-011-30/+26
|
* Break exception class out into a standalone modulekpdecker2013-10-011-1/+1
|
* Further progress towards modularization.Yehuda Katz2013-07-241-15/+19
| | | | | At this point, I have only 2 fails in the Node build, but I'm doing a bunch of manual stuff locally and still have a bunch of hacks.
* Initial work on ES6 modulesYehuda Katz2013-07-011-24/+15
|
* Remove unnecessary functionkpdecker2013-06-021-6/+3
|
* Allow ID, STRING, or INTEGER for partial namekpdecker2013-05-291-1/+1
| | | Fixes #519
* Improve tracking of original path valueskpdecker2013-05-271-7/+12
|
* Remove unused scope functionkpdecker2013-02-161-101/+98
|
* mergeTommy Messbauer2013-02-111-91/+101
|\
| * Only allow 'this' or '..' to lead a pathLes Hill2013-01-211-2/+5
| | | | | | | | Paths like 'outer/../key' raise an exception when compiling.
| * Boolean("false") === truetomhuda2013-01-181-1/+1
| |
| * Add support for getting types in string modeYehuda Katz2013-01-161-0/+5
| | | | | | | | | | This makes it possible to determine whether an argument was passed as a string or as a path when implementing helpers in string mode.
| * Partials can be pathsLes Hill2012-12-131-7/+9
| | | | | | | | | | | | Allows partials with slashes, a common partial syntax. For example: {{> shared/dude}}
* | restored scope of var verifyMatchTommy Messbauer2013-02-111-6/+6
| |
* | Factory update with tabs to spaces.. sorry :(Tommy Messbauer2012-11-261-117/+119
| |
* | Commiting initial factory codeTommy Messbauer2012-08-291-3/+4
|/
* Add support for @data variablesYehuda Katz2012-07-051-0/+5
|
* Clean up parser tests and AST printertomhuda2012-05-281-0/+4
|
* More cleanuptomhuda2012-05-281-8/+2
| | | | * Make block and inverse use the main helper path * Eliminate separate inverse AST node
* Start doing earlier work on helpersYehuda Katz2012-05-281-5/+22
|
* Fix module loading within nodekpdecker2011-07-301-1/+1
|
* Move art into compiler dirkpdecker2011-07-301-0/+103