Skip to content

Commit

Permalink
Added license to sl files.
Browse files Browse the repository at this point in the history
  • Loading branch information
boris-spas committed Mar 13, 2020
1 parent 63973f2 commit b65fb65
Show file tree
Hide file tree
Showing 61 changed files with 314 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
* Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
*/

function ack(m,n) {
if (m == 0) {
return n + 1;
Expand All @@ -17,4 +22,3 @@ function execute() {
function main() {
return execute;
}

Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
* Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
*/

function fib(num) {
if (num < 1) {return 0;}
n1 = 0;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
* Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
*/

function main() {
return -1;
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
* Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
*/

function test(n) {
a = 1;
if (a > 0) {
Expand Down
5 changes: 5 additions & 0 deletions truffle/src/com.oracle.truffle.sl.test/src/tests/Add.sl
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
* Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
*/

function main() {
println(3 + 4);
println(3 + "4");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
* Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
*/

function main() {
println(3 + 4 - 2);
println(3 - 4 + 2);
Expand Down
5 changes: 5 additions & 0 deletions truffle/src/com.oracle.truffle.sl.test/src/tests/Break.sl
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
* Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
*/

function main() {
i = 0;
while (i < 1000) {
Expand Down
5 changes: 5 additions & 0 deletions truffle/src/com.oracle.truffle.sl.test/src/tests/Builtins.sl
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
* Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
*/

function main() {
println("Hello World!");
nanoTime();
Expand Down
5 changes: 5 additions & 0 deletions truffle/src/com.oracle.truffle.sl.test/src/tests/Call.sl
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
* Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
*/

function ret(a) { return a; }
function dub(a) { return a * 2; }
function inc(a) { return a + 1; }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
* Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
*/

function main() {
println("<");
println(4 < 20);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
* Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
*/

function foo() {}
function bar() {}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
* Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
*/

function foo() {
println(test(40, 2));
}
Expand Down
5 changes: 5 additions & 0 deletions truffle/src/com.oracle.truffle.sl.test/src/tests/Div.sl
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
* Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
*/

function main() {
println(4 / 2);
println(4 / 4000000000000);
Expand Down
5 changes: 5 additions & 0 deletions truffle/src/com.oracle.truffle.sl.test/src/tests/Equal.sl
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
* Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
*/

function e(a, b) {
return a == b;
}
Expand Down
5 changes: 5 additions & 0 deletions truffle/src/com.oracle.truffle.sl.test/src/tests/Eval.sl
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
* Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
*/

function main() {
eval("sl", "function foo() { return 14 + 2; }");
println(foo());
Expand Down
5 changes: 5 additions & 0 deletions truffle/src/com.oracle.truffle.sl.test/src/tests/Fibonacci.sl
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
* Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
*/

function fib(num) {
if (num < 1) {return 0;}
n1 = 0;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
* Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
*/

function add(a, b) {
return a + b;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
* Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
*/

function doIt(a) {
println("Initial stack trace:");
println(stacktrace());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
* Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
*/

function main() {
println("Hello World!");
}
5 changes: 5 additions & 0 deletions truffle/src/com.oracle.truffle.sl.test/src/tests/Inlining.sl
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
* Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
*/


function a() {return 42;}
function b() {return a();}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
* Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
*/

function printTypes(type) {
println(isInstance(type, 42));
println(isInstance(type, 42000000000000000000000000000000000000000));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
* Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
*/

function recursion(n) {
local = 42;

Expand Down
5 changes: 5 additions & 0 deletions truffle/src/com.oracle.truffle.sl.test/src/tests/Logical.sl
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
* Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
*/

function main() {
t = 10 == 10; // true
f = 10 != 10; // false
Expand Down
5 changes: 5 additions & 0 deletions truffle/src/com.oracle.truffle.sl.test/src/tests/Loop.sl
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
* Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
*/

function main() {
i = 0;
while (i < 1000) {
Expand Down
5 changes: 5 additions & 0 deletions truffle/src/com.oracle.truffle.sl.test/src/tests/LoopCall.sl
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
* Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
*/

function add(a, b) {
return a + b;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
* Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
*/

function add(a, b) {
return a + b;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
* Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
*/

function loop(n) {
obj = new();
obj.i = 0;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
* Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
*/

function loop(n, obj, name) {
obj[name] = 0;
while (obj[name] < n) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
* Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
*/

function add(a, b) {
return a + b;
}
Expand Down
5 changes: 5 additions & 0 deletions truffle/src/com.oracle.truffle.sl.test/src/tests/LoopPrint.sl
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
* Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
*/

function loop(n) {
i = 0;
while (i < n) {
Expand Down
5 changes: 5 additions & 0 deletions truffle/src/com.oracle.truffle.sl.test/src/tests/Mul.sl
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
* Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
*/

function main() {
println(3 * 4);
println(3 * 4000000000000);
Expand Down
5 changes: 5 additions & 0 deletions truffle/src/com.oracle.truffle.sl.test/src/tests/Null.sl
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
* Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
*/

/* The easiest way to generate null: a function without a return statement implicitly returns null. */
function null() {
}
Expand Down
5 changes: 5 additions & 0 deletions truffle/src/com.oracle.truffle.sl.test/src/tests/Object.sl
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
* Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
*/

function main() {
obj1 = new();
obj1.x = 42;
Expand Down
5 changes: 5 additions & 0 deletions truffle/src/com.oracle.truffle.sl.test/src/tests/ObjectDyn.sl
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
* Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
*/

function main() {
obj1 = new();
obj1["x"] = 42;
Expand Down
5 changes: 5 additions & 0 deletions truffle/src/com.oracle.truffle.sl.test/src/tests/String.sl
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
* Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
*/

function null() {
}

Expand Down
5 changes: 5 additions & 0 deletions truffle/src/com.oracle.truffle.sl.test/src/tests/Sub.sl
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
* Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
*/

function main() {
println(3 - 4);
println(3 - 4000000000000);
Expand Down
5 changes: 5 additions & 0 deletions truffle/src/com.oracle.truffle.sl.test/src/tests/Sum.sl
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
* Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
*/

function main() {
i = 0;
sum = 0;
Expand Down
5 changes: 5 additions & 0 deletions truffle/src/com.oracle.truffle.sl.test/src/tests/SumCall.sl
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
* Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
*/

function add(a, b) {
return a + b;
}
Expand Down
5 changes: 5 additions & 0 deletions truffle/src/com.oracle.truffle.sl.test/src/tests/SumObject.sl
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
* Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
*/

function loop(n) {
obj = new();
obj.i = 0;
Expand Down
5 changes: 5 additions & 0 deletions truffle/src/com.oracle.truffle.sl.test/src/tests/SumPrint.sl
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
* Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
*/

function loop(n) {
i = 0;
sum = 0;
Expand Down
7 changes: 6 additions & 1 deletion truffle/src/com.oracle.truffle.sl.test/src/tests/TypeOf.sl
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
* Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
*/

function main() {
println(typeOf(42));
println(typeOf(42000000000000000000000000000000000000000));
Expand All @@ -8,4 +13,4 @@ function main() {
println(typeOf(null()));
}
function null() {
}
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
* Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
*/

function main() {
x = 42 = 42;
}
}
Loading

0 comments on commit b65fb65

Please sign in to comment.