mustache icon indicating copy to clipboard operation
mustache copied to clipboard

Is it possible to get the AST of a template?

Open kulshekhar opened this issue 9 years ago • 2 comments

Is it possible to use this package to fetch the AST of a mustache template?

kulshekhar avatar Dec 16 '16 09:12 kulshekhar

I would like to get tokens before rendering too.

What I want is to make sure if any token cannot be rendered with context, then I put a default value to context for it before rendering.

EasonPai avatar Jan 09 '18 03:01 EasonPai

It's possible but not publicly exposed.

You can import: mustache/lib/src/parser.dart and then call parse() which returns List<Node>.

xxgreg avatar Jan 09 '18 05:01 xxgreg