Skip to content

Commit

Permalink
change the livedemo url
Browse files Browse the repository at this point in the history
  • Loading branch information
pissang committed Jan 21, 2013
1 parent 7c4072e commit 066ef86
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

The code analyze is based on [Parser API](https://developer.mozilla.org/en/SpiderMonkey/Parser_API) AST, which you can generated with [Esprima](esprima.org). And [Escodegen](https://github.com/Constellation/escodegen) is needed for the final output code regenerate.

**[Live demo](http://pissang.github.com/dfatool/example/static/)**
**[Live demo](http://pissang.github.com/dfatool/example/static/index.html)**

### Install

Expand Down
16 changes: 6 additions & 10 deletions dfatool.js
Original file line number Diff line number Diff line change
Expand Up @@ -990,9 +990,7 @@ Scope.prototype.offsetLoc = function(loc){
}

function calculateLoc( loc ){

return loc.line + loc.column / 1000;

}

Scope.prototype.traverse = function(before, after){
Expand Down Expand Up @@ -1416,9 +1414,7 @@ var Value = function(ast, scope){

// elements is for array
this.elements = null;

// if the value has other properties
// the value will be force convert to an object type value

this.props = {
'__protot__' : null
}
Expand Down Expand Up @@ -2336,6 +2332,9 @@ ConditionalStatement.prototype.getFlattenExpression = function(){
return code;
}

//=====================================
// Conditional Tree
//=====================================
var ConditionalTree = function( variable, scope ){

this.root = new ConditionalTree.Node;
Expand All @@ -2346,9 +2345,6 @@ var ConditionalTree = function( variable, scope ){

this.scope = scope;
}
//=====================================
// Conditional Tree
//=====================================
ConditionalTree.prototype.build = function( variable, scope ){

if( scope == variable.scope ){
Expand Down Expand Up @@ -2421,7 +2417,7 @@ ConditionalTree.prototype.buildAST = function(){
ConditionalTree.Node = function( statement ){

this._condid = -1;
// {{ConditionalStatement}}
// Test expression
this._expression = null;
// {ConditionalTree.Node || AssignStatement || UseStatement}
this.consequent = [];
Expand Down Expand Up @@ -2480,7 +2476,7 @@ ConditionalTree.Node.prototype.build = function( statement ){
ConditionalTree.Node.prototype.buildAST = function( varName ){
var consequent = TEMPLATE_BLOCK();
this.consequent.forEach( function( node ){
consequent.body.push( buildAST(node) );
consequent.body.push( node(buildAST) );
} );
if( this.alternate.length ){
var alternate = TEMPLATE_BLOCK();
Expand Down

0 comments on commit 066ef86

Please sign in to comment.