nitlanguage
/
nit.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
frontend: parse examples annotations
[nit.git]
/
tests
/
nitin.inputs
1
print 5+2
2
3
for i in [0..5[ do
4
print i
5
end
6
7
do
8
var sum = 0
9
for i in [0..50[ do
10
sum += i
11
end
12
print sum
13
end
14
15
class A
16
fun foo do
17
print "hello"
18
end
19
end
20
(new A).foo
21
22
class
23
end
24
class A
25
end
26
redef class A
27
redef fun foo do print "Bye"
28
end
29
(new A).foo
30
31
foo
32
fun foo do
33
print "I'm sys"
34
end
35
foo
36
37
redef class Sys
38
var my_int: Int is writable
39
end
40
my_int = 5
41
print my_int
42
43
print([0..10[.to_a.to_json)
44
import json
45
print([0..10[.to_a.to_json)
46
47
%$^&
48
49
fun foo_abstract is abstract
50
fun foo_intern is intern
51
class B
52
var a: B is noautoinit
53
fun foo do print "B"
54
end
55
fun nil: nullable B do return null
56
57
abort
58
nil.foo
59
foo_abstract
60
assert false
61
(new A).as(B).foo
62
print((new B).a)
63
foo_intern
64
65
print "Finished"