Permalink
Browse files

docs

  • Loading branch information...
1 parent a9fdaf2 commit ac31323fb4ab043957fd527dc516ff90a43375f2 @maxtaco committed Dec 9, 2011
Showing with 13 additions and 13 deletions.
  1. +13 −13 TAME.md
View
26 TAME.md
@@ -102,35 +102,35 @@ The CoffeeScript tame addition uses a simlar continuation-passing
translation to *tamejs*, but it's been refined greatly. Here are
the general steps involved:
-1. Run the standard CoffeeScript lexer, rewriter, and parser, with a
+* Run the standard CoffeeScript lexer, rewriter, and parser, with a
few small additions (for `await` and `defer`), yielding
a standard CoffeeScript-style abstract syntax tree (AST).
-2. Apply *tame annotations*:
+* Apply *tame annotations*:
- A. Find all `await` nodes in the AST. Mark these nodes and their
+ * Find all `await` nodes in the AST. Mark these nodes and their
ancestors with an **A** flag.
- B. Find all `for`, `while`, or `loop` nodes marked with **A**.
+ * Find all `for`, `while`, or `loop` nodes marked with **A**.
Mark them and their descendants with an **L** flag.
- C. Find all `continue` or `break` nodes marked with an **L** flag.
+ * Find all `continue` or `break` nodes marked with an **L** flag.
Mark them and their descendants with a **P** flag.
-3. ``Rotate'' all those nodes marked with **A** or **P**:
+* ``Rotate'' all those nodes marked with **A** or **P**:
- A. For each `Block` node _b_ in the `AST` marked **A** or **P**:
+ * For each `Block` node _b_ in the `AST` marked **A** or **P**:
- i. Find _b_'s first child _c_ marked with with **A** or **P**.
+ * Find _b_'s first child _c_ marked with with **A** or **P**.
- ii. Cut _b_'s list of expressions after _c_, and move those
+ * Cut _b_'s list of expressions after _c_, and move those
expressions on the right of the cut into a new block, called
_d_. This block is _b_'s continuation block and becomes _c_'s
child in the AST. This is the actual ``rotation.''
- iii. Call the rotation recursively on the child block _d_.
+ * Call the rotation recursively on the child block _d_.
- iv. Add an additional code to _c_'s body, which is to call the
+ * Add an additional code to _c_'s body, which is to call the
continuation represented by _d_. For `if` statements this means
calling the continuation in both branches; for `switch`
statements, this means calling the continuation from all
@@ -139,13 +139,13 @@ a standard CoffeeScript-style abstract syntax tree (AST).
continuation as the last statement in the block. See
`callContinuation` in `nodes.coffee.`
-4. Output preamble/boilerplate; for the case of JavaScript output to
+* Output preamble/boilerplate; for the case of JavaScript output to
browsers, inline the small class `Deferrals` needed during runtime;
for node-based server-side JavaScript, a `require` statement suffices
here. Only do this if the source file has a `defer` statement
in it.
-5. Compile as normal. The effect of the above is to mutate the original
+* Compile as normal. The effect of the above is to mutate the original
CoffeeScript AST into another valid CoffeeScript AST. This AST is then
compiled with the normal rules.

0 comments on commit ac31323

Please sign in to comment.