Skip to content
Merged
Show file tree
Hide file tree
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
10 changes: 9 additions & 1 deletion compiler/bin/main.ml
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,15 @@ let dump_tokens (filename : string) : unit =
| STRING s -> Printf.printf "STRING(%S)" s
| IDENT s -> Printf.printf "IDENT(%s)" s
| GENERATOR n -> Printf.printf "GENERATOR(%d)" n
| EOF -> print_string "EOF");
| EOF -> print_string "EOF"
| ECHOCLOSE -> print_string "ECHOCLOSE"
| LOWER -> print_string "LOWER"
| RESIDUE -> print_string "RESIDUE"
| PAIR -> print_string "PAIR"
| FST -> print_string "FST"
| SND -> print_string "SND"
| ECHOADD -> print_string "ECHOADD"
| ECHOEQ -> print_string "ECHOEQ");
print_newline ();
if tok <> EOF then loop ()
in
Expand Down
2 changes: 2 additions & 0 deletions compiler/lib/typecheck.ml
Original file line number Diff line number Diff line change
Expand Up @@ -584,6 +584,8 @@ and strand_type_of_ty (t : ty) : strand_type =
| TBool -> StrandNamed "Bool"
| TWord _ -> StrandDefault
| TTangle _ -> StrandDefault
| TProd _ -> StrandDefault
| TEcho _ -> StrandDefault

(** Convert a strand_type to a boundary element for self-crossing. *)
and strand_to_type (st : strand_type) : strand_type = st
Expand Down
9 changes: 9 additions & 0 deletions compiler/test/test_roundtrip.ml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,15 @@ let basic_corpus : (string * string) list = [
("nullary def", "def x = identity");
("unary def", "def f(a) = a");
("binary def", "def f(a, b) = a + b");
(* Echo / structured-loss forms (PR #45) *)
("echoClose", "def x = echoClose(a)");
("lower", "def x = lower(a)");
("residue", "def x = residue(a)");
("pair", "def x = pair(a, b)");
("fst", "def x = fst(a)");
("snd", "def x = snd(a)");
("echoAdd", "def x = echoAdd(a, b)");
("echoEq", "def x = echoEq(a, b)");
]

(* --------------------------------------------------------------------- *)
Expand Down
Loading