view graal/com.oracle.truffle.sl.test/tests/DefineFunction.sl @ 18755:59953a46c56f

Truffle-DSL: migrate DSL tests to use @GenerateNodeFactory.
author Christian Humer <christian.humer@gmail.com>
date Mon, 29 Dec 2014 23:38:30 +0100
parents b16ec83edc73
children
line wrap: on
line source

function foo() {
  println(test(40, 2));
}

function main() {
  defineFunction("function test(a, b) { return a + b; }");
  foo();

  defineFunction("function test(a, b) { return a - b; }");
  foo();
}