-
Notifications
You must be signed in to change notification settings - Fork 0
Template parsing thoughts
Imre Pühvel edited this page Oct 12, 2015
·
1 revision
First scanner pass will output input template broken into a linear stream of text and command blocks.
Rules:
- Command start and end tag markers are omitted from output command texts
- Command start and end tag markers can be used as part of ordinary text or command themselves if written double.
- Every command start must be closed with end tag. Template with unclosed command will be rejected with error.
- Command mode strings must not intersect. Such templates will be rejected with error.
Command parser will verify each command has correct syntax and determine if command is a function command or a path to model.
Function commands are broken to components:
- function name
- array of provided arguments
Model path commands are broken to components:
- array of model property names
- optional format string
Template will be represented as tree for efficient document generation later.