-
Notifications
You must be signed in to change notification settings - Fork 0
/
hello.ast
125 lines (125 loc) · 1.97 KB
/
hello.ast
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
[
{
"type": "var_assign",
"var_name": {
"type": "identifier",
"value": "age",
"text": "age",
"offset": 4,
"lineBreaks": 0,
"line": 1,
"col": 5
},
"value": {
"type": "number",
"value": 17,
"text": "17",
"offset": 10,
"lineBreaks": 0,
"line": 1,
"col": 11
},
"kind": "let"
},
{
"type": "var_assign",
"var_name": {
"type": "identifier",
"value": "min_age",
"text": "min_age",
"offset": 14,
"lineBreaks": 0,
"line": 2,
"col": 1
},
"value": {
"type": "number",
"value": 18,
"text": "18",
"offset": 24,
"lineBreaks": 0,
"line": 2,
"col": 11
},
"kind": "const"
},
{
"type": "if_statement",
"condition": {
"left_value": {
"type": "identifier",
"value": "age",
"text": "age",
"offset": 33,
"lineBreaks": 0,
"line": 4,
"col": 4
},
"opr": {
"type": "great",
"value": ">",
"text": ">",
"offset": 37,
"lineBreaks": 0,
"line": 4,
"col": 8
},
"right_value": {
"type": "identifier",
"value": "min_age",
"text": "min_age",
"offset": 39,
"lineBreaks": 0,
"line": 4,
"col": 10
}
},
"body": [
{
"type": "fun_call",
"fun_name": {
"type": "identifier",
"value": "print",
"text": "print",
"offset": 52,
"lineBreaks": 0,
"line": 5,
"col": 3
},
"arguments": [
{
"type": "string",
"value": "\"5 is less than 10\"",
"text": "\"5 is less than 10\"",
"offset": 58,
"lineBreaks": 0,
"line": 5,
"col": 9
}
]
},
{
"type": "var_assign",
"var_name": {
"type": "identifier",
"value": "name",
"text": "name",
"offset": 86,
"lineBreaks": 0,
"line": 6,
"col": 7
},
"value": {
"type": "string",
"value": "\"Pratush\"",
"text": "\"Pratush\"",
"offset": 93,
"lineBreaks": 0,
"line": 6,
"col": 14
},
"kind": "let"
}
]
}
]