mathConverter.js 610 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. var _ = require('lodash');
  2. var tree = require('../lib/tree');
  3. var treeStructure = require('../structure');
  4. module.exports = function(scope) {
  5. scope.fnAST = null;
  6. // find math operations and swap them out with fake builtin functions
  7. // do a deep copy
  8. scope.varsRefd = _.where(scope.flatExp, {type: 'BinaryExpression'}).map(function(e) {
  9. });
  10. };
  11. // by operator
  12. var handlers = {
  13. '/': function(n) {
  14. return {
  15. type: 'CallExpression',
  16. fake: true,
  17. name: '#Math.div',
  18. arguments: [
  19. // top,
  20. // bottom
  21. ],
  22. loc: _.extend({}, n.loc),
  23. }
  24. }
  25. };