|
|
|
@ -71,17 +71,11 @@ const instrumenter = require('./instrumenter'); |
|
|
|
|
parse.AssignmentExpression = function parseAssignmentExpression(contract, expression) { |
|
|
|
|
instrumenter.instrumentStatement(contract, expression); |
|
|
|
|
instrumenter.instrumentAssignmentExpression(contract, expression); |
|
|
|
|
// parse[expression.left.type](contract, expression.left);
|
|
|
|
|
// parse[expression.right.type](contract, expression.right);
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
parse.ConditionalExpression = function parseConditionalExpression(contract, expression) { |
|
|
|
|
instrumenter.instrumentStatement(contract, expression); |
|
|
|
|
instrumenter.instrumentConditionalExpression(contract, expression); |
|
|
|
|
// parse[expression.test.left.type](contract, expression.test.left);
|
|
|
|
|
// parse[expression.test.right.type](contract, expression.test.right);
|
|
|
|
|
// parse[expression.consequent.type](contract, expression.consequent);
|
|
|
|
|
// parse[expression.alternate.type](contract, expression.alternate);
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
parse.Modifiers = function parseModifier(contract, modifiers) { |
|
|
|
@ -94,21 +88,14 @@ parse.Modifiers = function parseModifier(contract, modifiers) { |
|
|
|
|
|
|
|
|
|
parse.ReturnStatement = function parseReturnStatement(contract, expression) { |
|
|
|
|
instrumenter.instrumentStatement(contract, expression); |
|
|
|
|
// if (expression.argument){
|
|
|
|
|
// parse[expression.argument.type](contract, expression.argument);
|
|
|
|
|
// }
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
parse.NewExpression = function parseNewExpression(contract, expression) { |
|
|
|
|
parse[expression.callee.type](contract, expression.callee); |
|
|
|
|
// expression.arguments.forEach(construct => {
|
|
|
|
|
// parse[construct.type](construct);
|
|
|
|
|
// });
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
parse.MemberExpression = function parseMemberExpression(contract, expression) { |
|
|
|
|
parse[expression.object.type](contract, expression.object); |
|
|
|
|
// parse[expression.property.type](contract, expression.property);
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
parse.CallExpression = function parseCallExpression(contract, expression) { |
|
|
|
@ -145,7 +132,6 @@ parse.IfStatement = function parseIfStatement(contract, expression) { |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
parse.ExpressionStatement = function parseExpressionStatement(contract, content) { |
|
|
|
|
// if (instrument){instrumentStatement(content.expression)}
|
|
|
|
|
parse[content.expression.type](contract, content.expression); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
@ -166,7 +152,6 @@ parse.VariableDeclaration = function parseVariableDeclaration(contract, expressi |
|
|
|
|
console.log('more than one declaration'); |
|
|
|
|
} |
|
|
|
|
parse[expression.declarations[0].id.type](contract, expression.declarations[0].id); |
|
|
|
|
// parse[expression.declarations[0].init.type](contract, expression.declarations[0].init);
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
parse.UsingStatement = function parseUsingStatement(contract, expression) { |