if (body.errors.size()>0) throw body.errors.pick(); else return body;
}
/** Throw an exception if the name is already used, or has @ or /, or is univ/Int/none. */
private void dup(Pos pos, String name, boolean checkSig) throws Err {
if (name.length()==0) throw new ErrorSyntax(pos, "Name cannot be empty");
if (name.indexOf('@')>=0) throw new ErrorSyntax(pos, "Name cannot contain the \'@\' character");
if (name.indexOf('/')>=0) throw new ErrorSyntax(pos, "Name cannot contain the \'/\' character");
if (name.equals("univ")) throw new ErrorSyntax(pos, "\'univ\' is a reserved keyword.");
if (name.equals("Int")) throw new ErrorSyntax(pos, "\'Int\' is a reserved keyword.");
if (name.equals("none")) throw new ErrorSyntax(pos, "\'none\' is a reserved keyword.");
if (checkSig && (params.containsKey(name) || sigs.containsKey(name)))
throw new ErrorSyntax(pos, "\""+name+"\" is already the name of a sig/parameter in this module.");
}