diff --git a/compiler/bin/main.ml b/compiler/bin/main.ml index 801f333..0212752 100644 --- a/compiler/bin/main.ml +++ b/compiler/bin/main.ml @@ -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 diff --git a/compiler/lib/typecheck.ml b/compiler/lib/typecheck.ml index 204d7d7..721607f 100644 --- a/compiler/lib/typecheck.ml +++ b/compiler/lib/typecheck.ml @@ -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 diff --git a/compiler/test/test_roundtrip.ml b/compiler/test/test_roundtrip.ml index d6d3fe7..6ecb92e 100644 --- a/compiler/test/test_roundtrip.ml +++ b/compiler/test/test_roundtrip.ml @@ -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)"); ] (* --------------------------------------------------------------------- *)