MCPcopy Index your code
hub / github.com/RustPython/RustPython / parse_unicode_name

Method parse_unicode_name

crates/codegen/src/string_parser.rs:104–117  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

102 }
103
104 fn parse_unicode_name(&mut self) -> Result<char, LexicalError> {
105 let Some('{') = self.next_char() else {
106 unreachable!()
107 };
108
109 let Some(close_idx) = self.source[self.cursor..].find('}') else {
110 unreachable!()
111 };
112
113 let name_and_ending = self.skip_bytes(close_idx + 1);
114 let name = &name_and_ending[..name_and_ending.len() - 1];
115
116 unicode_names2::character(name).ok_or_else(|| unreachable!())
117 }
118
119 /// Parse an escaped character, returning the new character.
120 fn parse_escaped_char(&mut self) -> Result<Option<EscapedChar>, LexicalError> {

Callers 1

parse_escaped_charMethod · 0.80

Calls 5

next_charMethod · 0.80
skip_bytesMethod · 0.80
ok_or_elseMethod · 0.80
findMethod · 0.45
lenMethod · 0.45

Tested by

no test coverage detected