Permalink
Browse files

DONE: update forking.md for v5.0.0

  • Loading branch information...
1 parent 0527205 commit 1fdc9f1f53382eb3644159b2ca22fe7170ec89a5 @groue committed Sep 16, 2012
Showing with 11 additions and 12 deletions.
  1. +11 −11 Guides/forking.md
  2. +0 −1 TODO.txt
View
@@ -52,20 +52,20 @@ The library features are described in the [guides](introduction.md). This sectio
For instance, from the tokens parsed from `Hello {{name}}!`, a compiler outputs an AST made of one template containing two text elements and a variable element.
-- **Runtime contexts**
- - `GRMustacheContext`
+- **Runtime**
+ - `GRMustacheInvocation`
+ - `GRMustacheRuntime`
+ - `GRMustacheTemplateDelegate`
- During a template rendering, a *context* implements a state of the context stack that is initialized with the initial object that the library user provides in order to "fill" the template, extends when entering sections, and shrinks when leaving those.
+ A *runtime* implements a state of three different stacks:
+
+ - a *context stack*, initialized with the initial object that the library user provides in order to "fill" the template. Section elements create new runtime objects with an extended context stack.
+ - a *filter stack*, that is initialized with the *filter library* (see below). Templates extend this filter stack with user's custom filters.
+ - a *delegate stack*, initialized with a template's delegate. Section elements create new runtime objects with an extended delegate stack whenever they render objects that conform to the GRMustacheTemplateDelegate protocol.
- A context is able to provide the value for an identifier such as `name` found in a `{{name}}` tag.
-
- However, contexts are not responsible for providing values that should be rendered. Expressions built at the parsing phase are. For instance, expressions are able to perform a lookup for scoped expressions such as `person.name`, or apply filters such as `uppercase(name)`.
-
-- **Template delegate**
- - `GRMustacheInvocation`
- - `GRMustacheTemplateDelegate`
+ A runtime is able to provide the value for an identifier such as `name` found in a `{{name}}` tag. However, runtime is not responsible for providing values that should be rendered. Expressions built at the parsing phase are. They query the runtime in order to compute their values.
- *Invocations* are generated by expressions, and exposed to the *template delegate*, so that the library user can inspect or override values that are rendered.
+ *Invocations* are created by runtime objects, and exposed to *delegates*, so that the library user inspect or override rendered values.
- **Lambda sections**
- `GRMustacheHelper`
View
@@ -1 +0,0 @@
-- update forking.md for v5.0.0

0 comments on commit 1fdc9f1

Please sign in to comment.