Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/org/rascalmpl/library/lang/pico/format/Formatting.rsc
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Box toBox((Statement) `while <Expression e> do <{Statement ";"}* block> od`)
L("od")
);

@synopsis{Format if-then-else }
@synopsis{Format if-then-else}
Box toBox((Statement) `if <Expression e> then <{Statement ";"}* thenPart> else <{Statement ";"}* elsePart> fi`)
= V(
H(L("if"), HV(toBox(e)), L("then")),
Expand All @@ -44,21 +44,23 @@ Box toBox((Statement) `if <Expression e> then <{Statement ";"}* thenPart> else <
L("fi")
);

@synopsis{Format if-then }
@synopsis{Format if-then}
Box toBox((Statement) `if <Expression e> then <{Statement ";"}* thenPart> fi`)
= V(
H(L("if"), HV(toBox(e)), L("then")),
I(toBox(thenPart)),
L("fi")
);

@synopsis{Format lists of declarations}
Box toBox((Declarations) `declare <{IdType ","}* decls>;`)
= V(
L("declare"),
I(V(SL([toBox(d) | d <- decls], L(","), op=H0()))),
L(";")
);

@synopsis{Format programs}
Box toBox((Program) `begin <Declarations decls> <{Statement ";"}* body> end`)
= V(
L("begin"),
Expand All @@ -67,4 +69,4 @@ Box toBox((Program) `begin <Declarations decls> <{Statement ";"}* body> end`)
I(V(toBox(body)))
, vs=1),
L("end")
);
);
Loading