environment opaque_hint_cmd(parser & p) { environment env = p.env(); bool found = false; while (p.curr_is_token(g_lparen)) { p.next(); bool hiding; auto pos = p.pos(); if (p.curr_is_token_or_id(g_hiding)) hiding = true; else if (p.curr_is_token_or_id(g_exposing)) hiding = false; else throw parser_error("invalid 'opaque_hint', 'hiding' or 'exposing' expected", pos); p.next(); while (!p.curr_is_token(g_rparen)) { if (p.curr_is_token(g_module)) { found = true; p.next(); env = set_hide_main_opaque(env, hiding); } else { name c = p.check_constant_next("invalid 'opaque_hint', constant expected"); found = true; if (hiding) env = hide_definition(env, c); else env = expose_definition(env, c); } } p.next(); } if (!found) throw exception("invalid empty 'opaque_hint' command"); return env; }