def _read_namespaced(<EOL>ctx: ReaderContext, allowed_suffix: Optional[str] = None<EOL>) -> Tuple[Optional[str], str]:
ns: List[str] = []<EOL>name: List[str] = []<EOL>reader = ctx.reader<EOL>has_ns = False<EOL>while True:<EOL><INDENT>token = reader.peek()<EOL>if token == "<STR_LIT:/>":<EOL><INDENT>reader.next_token()<EOL>if has_ns:<EOL><INDENT>raise SyntaxError("<STR_LIT>")<EOL><DEDENT>elif len(name) == <NUM_LIT:0>:<EOL><INDENT>name.append("<STR_LIT:/>")<EOL><DEDENT>else:<EOL><INDENT>if "<STR_LIT:/>" in name:<EOL><INDENT>raise SyntaxError("<STR_LIT>")<EOL><DEDENT>has_ns = True<EOL>ns = name<EOL>name = []<EOL><DEDENT><DEDENT>elif ns_name_chars.match(token):<EOL><INDENT>reader.next_token()<EOL>name.append(token)<EOL><DEDENT>elif allowed_suffix is not None and token == allowed_suffix:<EOL><INDENT>reader.next_token()<EOL>name.append(token)<EOL><DEDENT>else:<EOL><INDENT>break<EOL><DEDENT><DEDENT>ns_str = None if not has_ns else "<STR_LIT>".join(ns)<EOL>name_str = "<STR_LIT>".join(name)<EOL>if ns_str is None:<EOL><INDENT>if "<STR_LIT:/>" in name_str and name_str != "<STR_LIT:/>":<EOL><INDENT>raise SyntaxError("<STR_LIT>")<EOL><DEDENT><DEDENT>assert ns_str is None or len(ns_str) > <NUM_LIT:0><EOL>return ns_str, name_str<EOL>
Read a namespaced token from the input stream.