Skip to content
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


Add "break;" and "continue;" to untyped SIMPLE.  Just take the
semantics of these from C/C++/Java, if uncertain.  Do only the simple,
unlabeled ones, which only break/continue the innermost loop.  One
thing to think about: do you still want to desugar the for-loop into a
while-loop as we do it now?

*) Make sure you add the syntax of break and continue to the SYNTAX
module, and not where the semantics is.  That's because the parser for
programs is generated from the SYNTAX module only, so if you define
break and continue in the semantics module then "break;" and
"continue;" will be parsed as expression statements! (i.e., lookup
variable "break" followed by ";").

*) If you decide to keep the for and to desugar while into for, then
make sure that you extend the syntax of for to take Stmts instead of
Stmt as first argument, because inplace declarations of the form
  for(var i=1; i<=y; ++i) ...
macro expand to
  for((var i; i=1;) i<=y; ++i) ...
Otherwise, the resulting statements with such for loops as above will
not parse as Stmt, so nothing will match; not even the lookup rule.
So the syntax of for should be 
  "for" "(" Stmts Exp ";" Exp ")" Block
You can’t perform that action at this time.