Permalink
Browse files

Merge branch 'master' of github.com:Whiteknight/jaesop

  • Loading branch information...
Whiteknight committed Sep 10, 2011
2 parents 4343c8c + 484a8a2 commit 8478c3b66b67b35112332ab58707ddc51f19dae5
Showing with 178 additions and 61 deletions.
  1. +34 −0 stage0/README.md
  2. +11 −3 stage0/js/nodes.js
  3. +113 −58 stage0/js/wast.js
  4. +20 −0 t/stage0/try_catch.t
View
@@ -0,0 +1,34 @@
+The purpose of the stage 0 compiler is to be a suitable bootstrapping tool
+for writing a JavaScript compiler in JavaScript. Stage 0 does not intend to
+be complete or perfect. It will be a subset, missing certain features.
+
+Here we list the items which are purposefully omitted from the compiler, and
+the items which are intended to be included but which have not yet been
+implemented.
+
+## Known Feature Omissions:
+
+The stage 0 compiler is not a full or complete JavaScript compiler. Some
+features have been purposefully omitted and will not be supported:
+
+* `with` will not be supported
+* Primitive strings do not autobox to String. Must use `newString(...)`
+
+## Features Not Yet Implemented:
+
+This is a list of items which are yet to be done, but should be implemented
+before stage 0 is called "complete" and usable for stage 1:
+
+* switch/case/default statements
+* continue/break statements
+* new String()
+* methods on Object
+* methods on Array
+* pcre bindings and RegExpExpr
+* Handling empty statements
+
+## Features to Maybe Implement:
+
+These features might or might not need to be implemented:
+
+* `arguments`
View
@@ -310,7 +310,10 @@ def(stmt,'ReturnStmt', {
def(stmt,'TryStmt', {
toWast : function() {
- return errorWast(this.nodeType);
+ var w = getWast("TryStatement");
+ w.setTryBlock(this.children[0].toWast());
+ w.setCatchClause(this.children[1].toWast());
+ return w;
}
});
@@ -324,13 +327,18 @@ def(stmt,'BlockStmt', {
def(node,'CatchClause', {
toWast : function() {
- return errorWast(this.nodeType);
+ var w = getWast("CatchClause");
+ w.setExceptionVar(this.children[0].toWast());
+ w.setCatchBlock(this.children[1].toWast());
+ return w;
}
});
def(stmt,'ThrowStmt', {
toWast : function() {
- return errorWast(this.nodeType);
+ var w = getWast("ThrowStatement");
+ w.setPayload(this.children[0].toWast());
+ return w;
}
});
Oops, something went wrong.

0 comments on commit 8478c3b

Please sign in to comment.