-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathq
301 lines (207 loc) · 10.3 KB
/
q
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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
[33mcommit 212ffad8d635636ff6d0e7133c3fb80ea88dea7c[m[33m ([m[1;36mHEAD -> [m[1;32mmain[m[33m, [m[1;31morigin/main[m[33m, [m[1;31morigin/HEAD[m[33m)[m
Merge: 90dd6e4 dcdbc23
Author: Lasse Drongesen <105007826+Laskiri@users.noreply.github.com>
Date: Mon Mar 18 09:39:39 2024 +0100
Merge pull request #2 from SW4-GR1/development
Development
[33mcommit dcdbc2367e4734a48d018d3539c0278bbd4a2413[m
Author: Magnus K. Lundgren <magnus@themstrupvej.dk>
Date: Sat Mar 16 12:07:30 2024 +0100
Update README.md
[33mcommit 09da24370bfcaebcdacb0eb3844f417f78dfa23f[m
Author: Magnus K. Lundgren <magnus@themstrupvej.dk>
Date: Sat Mar 16 12:05:19 2024 +0100
removing old unused files
[33mcommit c6b0599c56add90a0791d3b97717647a1fae5988[m
Author: Magnus K. Lundgren <magnus@themstrupvej.dk>
Date: Sat Mar 16 12:03:44 2024 +0100
removing tracked files from build directory
[33mcommit cdadbdfc493700c7116e800bf9a93a14d6b9538b[m
Author: Magnus K. Lundgren <magnus@themstrupvej.dk>
Date: Sat Mar 16 11:59:39 2024 +0100
tests
[33mcommit 09ba1977b841f9d28a84d0169262fb56a246fda5[m
Author: Magnus K. Lundgren <magnus@themstrupvej.dk>
Date: Sat Mar 16 11:57:02 2024 +0100
added tests folder, run make tests to execute all test files. Also fixed bug where two integers could not be subtracted as the second would be seen as a negative integet and not recognize the binary operator
[33mcommit 8948a6ef779c5c34ec1a85a392dbd7c118b75ee4[m
Author: Magnus K. Lundgren <magnus@themstrupvej.dk>
Date: Sat Mar 16 11:24:30 2024 +0100
added function declarations for all types. Updated prog to be a list of functions and a statement. Updated pretty printer to print functions, and prettier if statements
[33mcommit 4be5a3d2e8a4efe2c586ba5e954f7792bb361398[m
Author: Magnus K. Lundgren <magnus@themstrupvej.dk>
Date: Fri Mar 15 11:34:05 2024 +0100
extended pp to include if statements
[33mcommit 542279b1cac138280fe4009abc1cc3fb6bc2676a[m
Author: Magnus K. Lundgren <magnus@themstrupvej.dk>
Date: Fri Mar 15 11:19:38 2024 +0100
added simple pretty printer functionality
[33mcommit 3db56917424ab6a76ab7ddd60fc25042c4a4050e[m
Author: Magnus K. Lundgren <magnus@themstrupvej.dk>
Date: Fri Mar 15 09:49:02 2024 +0100
added if statements
[33mcommit 90dd6e4d8587cca5f6f2a0687a593443bfa2d095[m
Author: Thomass1412 <thomas.lunoe@gmail.com>
Date: Fri Mar 15 09:18:05 2024 +0100
fixed issues
[33mcommit b2501d5f2a095001ec3298305ee5c7aae2c78da6[m
Author: Thomass1412 <thomas.lunoe@gmail.com>
Date: Wed Mar 13 14:28:44 2024 +0100
added a start to function calls1
[33mcommit 0a1cf8a0f32d601a7b3cc8fbdbdf32256876e77c[m
Author: Thomass1412 <thomas.lunoe@gmail.com>
Date: Wed Mar 13 14:18:19 2024 +0100
added a start to function calls
[33mcommit 9fd7d33001b202f10c191b7c9a869a859f684e6b[m
Author: Thomass1412 <thomas.lunoe@gmail.com>
Date: Wed Mar 13 13:14:20 2024 +0100
Expanded lexer and parser
[33mcommit 433d2159937b3447d35237cf84fa272ecb6be5e5[m
Author: Magnus K. Lundgren <magnus@themstrupvej.dk>
Date: Mon Mar 11 15:17:21 2024 +0100
nick forgot to add something
[33mcommit ce8a331234c01c9502c544c3976962a45488767a[m
Author: Magnus K. Lundgren <magnus@themstrupvej.dk>
Date: Mon Mar 11 15:16:33 2024 +0100
.\syntaxSuggestions.txt
[33mcommit 4ea310981942120ebb64256abbc39ac48745a9e7[m
Author: Magnus K. Lundgren <magnus@themstrupvej.dk>
Date: Fri Mar 8 10:55:05 2024 +0100
small change
[33mcommit 112a93e6bc070a0251efae1e66c21427dea12ce8[m
Author: Magnus K. Lundgren <magnus@themstrupvej.dk>
Date: Fri Mar 8 10:47:58 2024 +0100
added new main.ml and non functional pretty printer
[33mcommit ad4e15a79023ba7bfdf093a1fb19e552569e6aef[m
Author: Magnus K. Lundgren <magnus@themstrupvej.dk>
Date: Fri Mar 8 08:28:50 2024 +0100
helper functions in lexer and parser
[33mcommit 19c6b1d5afb7a05be01b2e4d010cb5204206f10b[m
Author: Magnus K. Lundgren <magnus@themstrupvej.dk>
Date: Wed Mar 6 13:52:36 2024 +0100
small changes
[33mcommit 0953f2a4cfb7eaec31a1f8d864165ee33220fefe[m
Author: Magnus K. Lundgren <magnus@themstrupvej.dk>
Date: Wed Mar 6 13:52:20 2024 +0100
added suggestions for syntax with some examples
[33mcommit eebcbb95e3b09226e2f5b039fe48d613627ee230[m
Author: Magnus K. Lundgren <magnus@themstrupvej.dk>
Date: Wed Mar 6 11:14:00 2024 +0100
hello, does this work
[33mcommit c094e86783f60e6fd6b9775558d9023143e101fd[m
Author: Magnus K. Lundgren <magnus@themstrupvej.dk>
Date: Wed Mar 6 10:51:05 2024 +0100
considered newline in comments
[33mcommit 2c26adf7663de4c87f98e7a779fa529f1c088b58[m
Author: Magnus K. Lundgren <magnus@themstrupvej.dk>
Date: Wed Mar 6 10:40:36 2024 +0100
updated gitignore
[33mcommit 86e9955bfe06379118d2a7bdbc20cc96a2583737[m
Author: Magnus K. Lundgren <magnus@themstrupvej.dk>
Date: Wed Mar 6 10:39:19 2024 +0100
added NEWLINE to parser for prog. Also Lexing_error to lexer
[33mcommit 12b53e4a8e536250dc61ffdbe5781b560b2da993[m
Author: Magnus K. Lundgren <magnus@themstrupvej.dk>
Date: Wed Mar 6 10:33:19 2024 +0100
added parser and ast
[33mcommit 834eb6c6ad95404855aedbab188f943e9fbd7041[m
Author: Magnus K. Lundgren <magnus@themstrupvej.dk>
Date: Wed Mar 6 09:51:27 2024 +0100
added ident to main.ml
[33mcommit 32cfcd38e87953886cf3746c1f28ecc535c9ec9a[m
Merge: b719679 5bc00b3
Author: Magnus K. Lundgren <magnus@themstrupvej.dk>
Date: Wed Mar 6 09:48:03 2024 +0100
Merge branch 'main' of https://github.com/SW4-GR1/P4
[33mcommit b719679fac0119158f03fe842c5423f28a04062a[m
Author: Magnus K. Lundgren <magnus@themstrupvej.dk>
Date: Wed Mar 6 09:47:42 2024 +0100
added eof to comment cases in lexer and added IDENT token
[33mcommit 5bc00b3ee8bb28c2ed85d24bacc7e7a578cd717d[m
Author: Magnus K. Lundgren <magnus@themstrupvej.dk>
Date: Wed Mar 6 09:43:02 2024 +0100
Update README.md
[33mcommit ba70fd773648d881b990f973b89d353866e3125c[m
Merge: ebfc25d d0deb42
Author: Magnus K. Lundgren <magnus@themstrupvej.dk>
Date: Wed Mar 6 09:41:15 2024 +0100
merge conflict
[33mcommit ebfc25d57aaff3747d47a547cada1d92b8aab5a3[m
Author: Magnus K. Lundgren <magnus@themstrupvej.dk>
Date: Wed Mar 6 09:40:27 2024 +0100
makefile + dunev2
[33mcommit d0deb42d7edf38d8f12155e7bd19a7f8029c565b[m
Author: Thomass1412 <thomas.lunoe@gmail.com>
Date: Wed Mar 6 09:39:43 2024 +0100
Improved lexer
[33mcommit 774a9b70869ce28e699d5ab6280f0840f4b2ce5f[m
Author: Magnus K. Lundgren <magnus@themstrupvej.dk>
Date: Wed Mar 6 09:39:20 2024 +0100
added Makefile
[33mcommit 7e374baf0d5cab3f297ebad7aa58591fce1246fd[m
Author: Thomass1412 <thomas.lunoe@gmail.com>
Date: Wed Mar 6 09:27:28 2024 +0100
updated parser
[33mcommit 86c8eafe4b633dc9e480bdf5be2d83ebb7852d3a[m
Author: Magnus K. Lundgren <magnus@themstrupvej.dk>
Date: Wed Mar 6 09:13:10 2024 +0100
added next_line and some helper regex
[33mcommit 40dc0102e6508b2be6d9d2ea32b3275aee0a2355[m
Author: Magnus K. Lundgren <magnus@themstrupvej.dk>
Date: Wed Mar 6 09:09:26 2024 +0100
removed WebASS directory
[33mcommit 5a1884fa71a9e67f8e0f20f12293506b04fbe40f[m
Merge: 1ebe7e2 f80e241
Author: Magnus K. Lundgren <magnus@themstrupvej.dk>
Date: Tue Mar 5 11:53:00 2024 +0100
Merge branch 'main' of https://github.com/SW4-GR1/P4
[33mcommit 1ebe7e2df9e954e10f0e23a0b97e55ab43a56534[m
Author: Magnus K. Lundgren <magnus@themstrupvej.dk>
Date: Tue Mar 5 11:52:51 2024 +0100
added gitignore, idk if it was deleted at some point
[33mcommit f80e24169719150d18353c5939ad9f0416ca9015[m
Author: Lasse <lassemgp@gmail.com>
Date: Tue Mar 5 09:30:08 2024 +0000
skeleton of lexer for frontend of compiler
[33mcommit 932be0a7fd4656ede3d7d64cd97c2e51570215b4[m
Merge: c590471 edd1b11
Author: Magnus K. Lundgren <magnus@themstrupvej.dk>
Date: Fri Feb 23 09:44:57 2024 +0100
Merge branch 'main' of https://github.com/SW4-GR1/P4
[33mcommit edd1b111f3f5e8bbf420200bbf2ea9d45fc18975[m
Author: Lasse Drongesen <Lassemgp@gmail.com>
Date: Fri Feb 23 09:44:06 2024 +0100
Added extra stuff
[33mcommit c590471d2b9f08beea25e64f25e9707d8ae4f2c0[m
Merge: 5741f8f 8890176
Author: Magnus K. Lundgren <magnus@themstrupvej.dk>
Date: Fri Feb 23 09:43:14 2024 +0100
Merge branch 'master' of https://github.com/SW4-GR1/P4
[33mcommit 8890176c17cc20986b3237ba8d0f718cf6f3142a[m
Author: Lasse Drongesen <Lassemgp@gmail.com>
Date: Wed Feb 21 09:28:26 2024 +0100
WebASSers assemble
[33mcommit 5741f8f686a62cce81dd6ee0dbffecd2dea7af46[m
Author: Magnus Lundgren <magnus@themstrupvej.dk>
Date: Wed Feb 21 09:15:16 2024 +0100
Test
[33mcommit e97e666f745980d05fcbbf84ab546e397b8424e6[m
Author: Magnus K. Lundgren <magnus@themstrupvej.dk>
Date: Tue Feb 6 10:06:56 2024 +0100
Update README.md
[33mcommit 34333111c69ea476f80fbc1c2d4bf906c24faabf[m
Author: Magnus K. Lundgren <magnus@themstrupvej.dk>
Date: Tue Feb 6 10:06:33 2024 +0100
Initial commit
let test_vars_with_similar_names _ctxt =
let vdec1 = mk_stmt (Sdecl {var_ty = Int_ty; var_name = mk_ident "x"; var_expr = None}) in
let vdec2 = mk_stmt (Sdecl {var_ty = Int_ty; var_name = mk_ident "x1"; var_expr = None}) in
let vdec3 = mk_stmt (Sdecl {var_ty = Int_ty; var_name = mk_ident "x2"; var_expr = None}) in
let assign1 = mk_stmt (Sass ("x", Add_assign, mk_expr (EConst 1))) in
let assign2 = mk_stmt (Sass ("x1", Sub_assign, mk_expr (EConst 2))) in
let assign3 = mk_stmt (Sass ("x2", Mul_assign, mk_expr (EConst 3))) in
let return = mk_stmt (Sreturn (mk_expr (EIdent (mk_ident "x")))) in
let functions = [mk_stmt (Sfunc (mk_fundec Int_ty "f" [] (Slist [vdec1; vdec2; vdec3; assign1; assign2; assign3; return])))] in
let input_ast = mk_prog [] (Sglobal_list []) (Sfundec_list functions) in
let expected_wat = "(module(func$f(resulti32)(local$xi32)(local$x1i32)(local$x2i32)(set_local$x(i32.add(get_local$x)(i32.const1)))(set_local$x1(i32.sub(get_local$x1)(i32.const2)))(set_local$x2(i32.mul(get_local$x2)(i32.const3)))(return(get_local$x))))" in
typeCodegen_test input_ast expected_wat