forked from highlightjs/highlight.js
-
Notifications
You must be signed in to change notification settings - Fork 1
/
default.txt
55 lines (40 loc) · 981 Bytes
/
default.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
function testBefore(<Test> a, var b = 5, int c = 10)
{
a->method1();
return b + c;
}
namespace Test;
use RuntimeException as RE;
/**
* Example comment
*/
class Test extends CustomClass implements TestInterface
{
const C1 = null;
// Magic constant: http://php.net/manual/ru/language.constants.predefined.php
const className = __CLASS__;
public function method1()
{
int a = 1, b = 2;
return a + b;
}
// See fn is allowed like shortcut
public fn method2() -> <Test>
{
call_user_func(function() { echo "hello"; });
[1, 2, 3, 4, 5]->walk(
function(int! x) {
return x * x;
}
);
[1, 2, 3, 4, 5]->walk(
function(_, int key) { echo key; }
);
array input = [1, 2, 3, 4, 5];
input->walk(
function(_, int key) { echo key; }
);
input->map(x => x * x);
return this;
}
}