-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsource.um
90 lines (63 loc) · 1.25 KB
/
source.um
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
/* test */ import (
"std.um"
th_font = "font.um"
)
// some comment
type X = struct {
field: map[str]int
a: [10]int
b, c: []int
d: str
e: weak ^th_font::Font
f: fn (a: int, b: char): (bool, uint)
}
const x = 32
const x2* = 32
const (
y = 64
z* = 128
)
fn (x: X) method() {
}
fn main() {
var b: int = 1
var c: []int = {
1,
2,
3
}
switch x {
case 1:
printf("one")
case 2, 3: printf("two or three")
default:
printf("other")
}
switch v := input(); v {
case 0: printf("zero")
case 1: printf("one")
case 2: printf("two")
default: printf("other")
}
y := int{x: 32, b: 64564, z: {32423, 234, 2423}}
x := sfgfg{a, b, 324}
n := .hello
z := |a, b| {
return a
}
x := DKFJ(a)
switch val := type(x) {
case int: printf("int")
case str: printf("str")
case map[str][]int: printf("map from str to array of ints")
default: printf("other")
}
printf("Hello \n %d world!", 42)
if a := true; a {
printf("yes")
}
for i := 0; less(i, 10); i++ {}
for 10; i++ {}
for 10 {}
for i, v^ in {1, 2, 3, 4} {}
}