SaffronCompiler: Commander.CommandProc ~ {
ENABLE {
ThreeC4Support.GetReportStream => RESUME[cmd.out];
OneCasabaParser.GetReportStream => { result ← $Failure; RESUME[cmd.out] };
assumes command line contains a file name with no extension
args: IO.STREAM ← IO.RIS[cmd.commandLine];
fname: Rope.ROPE ← IO.GetTokenRope[args, IO.IDProc].token;
root: SaffronATDef.ModulePNode ← SaffronATDef.ModulePVal[SaffronBaseDef.ReadDefFile[fname]];
env: SaffronBaseDef.EnvironmentNode ← NIL;
if: SaffronBaseDef.InterfaceValNode ← NIL;
result ← $Success; -- bad assumption?
IF ( result = $Failure )
THEN { IO.PutF[cmd.out, "Syntax Errors Detected.\n"]; RETURN; }
ELSE { IO.PutF[cmd.out, "No Syntax Errors Detected.\n"]; };
[env, if] ← root.procs.MakeEnvironment[root, "ShouldBeAFileName", SaffronBaseDef.CreateEmptyEnvironment[]
! SaffronContext.ErrorSignal => { ERROR };
];
SaffronContext.ShowEnvironment[cmd.out, 0, env];
};
}.