-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathexample.ph
More file actions
59 lines (47 loc) · 943 Bytes
/
example.ph
File metadata and controls
59 lines (47 loc) · 943 Bytes
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
let x : int := 1
let y : float := 2.0
let o: int := x
def h() -> void:
pass
class Hola:
init:
__init__(i: int):
pass
def f(d : float) -> int:
return 1
class MemberedClass:
init:
let member1 : int
let member2 : float
__init__(i: int, f: float):
self.member1 := i
print(self.member1)
self.member2 := f
print(self.member2)
def calc() -> float:
return self.member1 * self.member2
class SonClass(MemberedClass):
init:
__init__(i: int, f: float):
super.__init__(i,f)
def g(i : int) -> int:
let b : bool := True
if True:
return 5
for j :int := 0 : True : j := j + 1:
if False:
i := 200
else
continue
let c : int := 5
if c == 5:
return 1
return 2
def p(f: float) -> float:
return 5.0
let l : char[5]
create a : Hola(5)
create m : MemberedClass(5,4.0)
create s : SonClass(5+2,1.0+p(1.0))
print(m.calc())
print(s.calc())