xxgreg / mustache

Mustache template Dart library
BSD 2-Clause "Simplified" License
57 stars 59 forks source link

Is it possible to get the AST of a template? #30

Open kulshekhar opened 7 years ago

kulshekhar commented 7 years ago

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

EasonPai commented 6 years ago

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.

xxgreg commented 6 years ago

It's possible but not publicly exposed.

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