Skip to content

Commit e4aeece

Browse files
committed
feat: Desugaring of polymorphic method calls
Methods calls which must make use of the virtual table are now desugared. For example a method call within a method such as `foo(1, 2)` will now be desugared into `__vtable_{FB_NAME}#(THIS^.__vtable^).foo^(THIS^, 1, 2)`. Similarly, a variable like `refInstance: POINTER TO FbA` making a method call such as `refInstance^.foo(1, 2)` will be lowered into some similar form, except not making use of THIS, rather of the operator name (excluding the method name), i.e. `__vtable_FbA#(refInstance^.__vtable^).foo(refInstance^, 1, 2)`.
1 parent b316d5b commit e4aeece

34 files changed

+1471
-205
lines changed

.vscode/launch.json

Lines changed: 30 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,31 @@
44
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
55
"version": "0.2.0",
66
"configurations": [
7-
{
8-
"type": "codelldb",
9-
"request": "launch",
10-
"name": "Debug codelldb standard_lib",
11-
"cargo": {
7+
{
8+
"type": "codelldb",
9+
"request": "launch",
10+
"name": "Debug codelldb standard_lib",
11+
"cargo": {
12+
"args": [
13+
"build",
14+
"--bin=plc",
15+
"--package=plc_driver"
16+
],
17+
"filter": {
18+
"name": "plc",
19+
"kind": "bin"
20+
}
21+
},
22+
"program": "target/debug/plc",
1223
"args": [
13-
"build",
14-
"--bin=plc",
15-
"--package=plc_driver"
24+
"libs/stdlib/iec61131-st/*.st"
1625
],
17-
"filter": {
18-
"name": "plc",
19-
"kind": "bin"
20-
}
21-
},
22-
"program": "target/debug/plc",
23-
"args": ["libs/stdlib/iec61131-st/*.st"],
24-
"cwd": "${workspaceFolder}",
25-
"env": {
26-
"RUST_LOG": "rusty"
26+
"cwd": "${workspaceFolder}",
27+
"env": {
28+
"RUST_LOG": "rusty"
29+
},
30+
"terminal": "integrated"
2731
},
28-
"terminal": "integrated"
29-
},
3032
{
3133
"type": "codelldb",
3234
"request": "launch",
@@ -43,7 +45,11 @@
4345
}
4446
},
4547
"program": "target/debug/plc",
46-
"args": ["target/demo.st", "-g", "-c"],
48+
"args": [
49+
"target/demo.st",
50+
"-g",
51+
"-c"
52+
],
4753
"cwd": "${workspaceFolder}",
4854
"env": {
4955
"RUST_LOG": "rusty"
@@ -58,14 +64,15 @@
5864
"args": [
5965
"build",
6066
"--bin=plc",
61-
"--package=plc_driver"
67+
"--package=plc_driver",
6268
],
6369
"filter": {
6470
"name": "plc",
6571
"kind": "bin"
6672
}
6773
},
6874
"args": [
75+
"-j=1",
6976
"target/demo.st",
7077
"tests/lit/util/printf.pli"
7178
],
@@ -107,7 +114,6 @@
107114
"cwd": "${workspaceFolder}",
108115
"program": "target/demo",
109116
"terminal": "integrated"
110-
111117
}
112118
]
113-
}
119+
}

0 commit comments

Comments
 (0)