Add examples
This commit is contained in:
parent
802d776f29
commit
4db27de0c9
6 changed files with 40 additions and 0 deletions
5
examples/call.tada
Normal file
5
examples/call.tada
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
module
|
||||||
|
|
||||||
|
foo(),
|
||||||
|
foo(3),
|
||||||
|
foo{ 1, foo: true },
|
||||||
4
examples/expr.tada
Normal file
4
examples/expr.tada
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
module
|
||||||
|
|
||||||
|
a + 2 * 3 - 4,
|
||||||
|
{ 1, nil, true, c: "foo" },
|
||||||
7
examples/field.tada
Normal file
7
examples/field.tada
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
module
|
||||||
|
|
||||||
|
foo.bar,
|
||||||
|
foo.bar = 7,
|
||||||
|
|
||||||
|
foo[1 + 1],
|
||||||
|
foo[1 + 1] = 2,
|
||||||
11
examples/func_def.tada
Normal file
11
examples/func_def.tada
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
module
|
||||||
|
|
||||||
|
function() true,
|
||||||
|
function(arg) arg + 1,
|
||||||
|
function{ arg } arg + 1,
|
||||||
|
function foo() true,
|
||||||
|
function foo(arg) arg + 1,
|
||||||
|
function foo{ arg } arg + 1,
|
||||||
|
|
||||||
|
function() foo(),
|
||||||
|
(function () foo)(),
|
||||||
4
examples/table_destr.tada
Normal file
4
examples/table_destr.tada
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
module
|
||||||
|
|
||||||
|
{ a, b, c: d } = { 1, 2, c: 3 },
|
||||||
|
local { a, b, c: d } = { 1, 2, c: 3 },
|
||||||
9
examples/var.tada
Normal file
9
examples/var.tada
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
module
|
||||||
|
|
||||||
|
["x"],
|
||||||
|
["x"] = nil,
|
||||||
|
local ["x"] = nil,
|
||||||
|
|
||||||
|
x,
|
||||||
|
x = nil,
|
||||||
|
local x = nil,
|
||||||
Loading…
Add table
Add a link
Reference in a new issue