Compare commits
No commits in common. "d4303606dfccfc32762172a49a46d0e37e0f942c" and "f3d37076ee203a16ad0f1555fd606fff87748d8f" have entirely different histories.
d4303606df
...
f3d37076ee
|
@ -9,17 +9,18 @@
|
|||
<div id="elm-container">
|
||||
</div>
|
||||
<script>
|
||||
var program = `move(0, 0);
|
||||
var program = `
|
||||
move(0, 0);
|
||||
define line(x1, y1, x2, y2) {
|
||||
pen up;
|
||||
move(x1, y1);
|
||||
pen down;
|
||||
move(x2, y2);
|
||||
}
|
||||
};
|
||||
define nix(x, y, width, height) {
|
||||
call line (x, y, x + width, y + height);
|
||||
call line (x + width, y, x, y + height);
|
||||
}
|
||||
};
|
||||
call nix(0, 0, 20, 20);
|
||||
`
|
||||
var container = document.getElementById("elm-container");
|
||||
|
|
|
@ -90,7 +90,7 @@ parseExpr = oneOf [ lazy (\_ -> backtrackable parseSum), parseTerm ]
|
|||
parseProg : Parser LogoProg
|
||||
parseProg = sequence
|
||||
{ start = ""
|
||||
, separator = ""
|
||||
, separator = ";"
|
||||
, end = ""
|
||||
, spaces = spaces
|
||||
, item = lazy (\_ -> parseCmd)
|
||||
|
@ -135,8 +135,6 @@ parseCall = succeed Call
|
|||
, item = parseExpr
|
||||
, trailing = Forbidden
|
||||
}
|
||||
|. spaces
|
||||
|. symbol ";"
|
||||
|
||||
parsePenMode : Parser LogoPenMode
|
||||
parsePenMode = oneOf
|
||||
|
@ -149,8 +147,6 @@ parsePen = succeed Pen
|
|||
|. keyword "pen"
|
||||
|. spaces
|
||||
|= parsePenMode
|
||||
|. spaces
|
||||
|. symbol ";"
|
||||
|
||||
parseMove : Parser LogoCmd
|
||||
parseMove = succeed Move
|
||||
|
@ -162,10 +158,7 @@ parseMove = succeed Move
|
|||
|. symbol ","
|
||||
|. spaces
|
||||
|= parseExpr
|
||||
|. spaces
|
||||
|. symbol ")"
|
||||
|. spaces
|
||||
|. symbol ";"
|
||||
|
||||
{-
|
||||
======= Semantics Code =======
|
||||
|
|
Loading…
Reference in New Issue
Block a user