<> <> <> <> <> <> <> <<>> DIRECTORY <> Commander, IO, <> Rope, Tempus; TempusUtilImpl: CEDAR PROGRAM IMPORTS <> Commander, IO, <> Rope, Tempus = BEGIN OPEN Tempus; <> <> <> <<<>>> <> <> <> <> <<};>> <> <> <> <> <> <> <<};>> <<>> WhenIs: Commander.CommandProc = { err: Rope.ROPE; t: Packed; [t, ] ¬ Parse[cmd.commandLine ! Unintelligible => { err ¬ SELECT ec FROM invalid => "Invalid", tooVague => "Too Vague", overConstrained => "Over Constrained", nothingSpecified => "Not a time", notImplemented => "Not Implemented", ENDCASE => ERROR; IF vicinity # -1 THEN err ¬ Rope.Cat[ err, ": ", Rope.Substr[base: rope, len: vicinity], "<>", Rope.Substr[base: rope, start: vicinity] ]; CONTINUE; }; ]; IF err # NIL THEN cmd.err.PutRope[err] ELSE cmd.out.PutRope[MakeRope[time: t, includeDayOfWeek: TRUE]]; cmd.out.PutRope["\n"]; <> <> <<};>> }; <> < CONTINUE]; >> <> < CONTINUE]; -- redefines printproc in basic system to include day of week.>> Commander.Register["WhenIs", WhenIs, "For testing time.parse"]; END.