Skip to content

Instantly share code, notes, and snippets.

@MoOx
Created August 4, 2014 14:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MoOx/f40a00dffeb21a54eb9d to your computer and use it in GitHub Desktop.
Save MoOx/f40a00dffeb21a54eb9d to your computer and use it in GitHub Desktop.
replaceFunctionCall("blah TRUC(1) machin TRUC(2)", "TRUC", fn(body) {
// body === 1, then 2
/* your stuff on body */
// eg body += "truc"
return body
})
// => "blah 1truc machin 2truc"
@bloodyowl
Copy link

// interpret-function-call.js
var checkFunctionSyntax = require("check-function-syntax")
var interpreter = require("./lib/interpreter")

module.exports = function(string, parser){
  var err = checkFunctionCalls(string)
  if(err) {
    throw err
  }
  return interpreter(string, parser)
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment