Broken structure now gets through syntax evaluator.

This commit is contained in:
2024-03-08 18:39:13 -07:00
parent 77c4277625
commit b0cc2fc26b
12 changed files with 389 additions and 50 deletions

View File

@@ -0,0 +1,25 @@
struct Point {
x: u64;
y: u64;
}
function getX(p: Point) -> u64
p.x;
function getY(p: Point) -> u64
p.y;
function newPoint(x, y) -> Point
Point {
x: x;
y: y;
};
function slope(p1, p2) -> u64
(getY(p2) - p1.y) / (getX(p2) - p1.x);
origin = newPoint(0, 0);
farther = newPoint(4, 4);
mySlope = slope(origin, farther);
print mySlope;