Expand native Unicode character primitives and definitions
This commit is contained in:
1 parent
d17680fcd8
commit
651fab42f1
7 files changed
+227
-31
No files matched your search
@@ -59,7 +59,7 @@ impl Executor {
|
||||
Meaning::Character(TokenKind::Character(c, CatCode::Letter | CatCode::Other)) => {
|
||||
Some(i32::try_from(u32::from(c)).expect("a Unicode scalar fits i32"))
|
||||
}
|
||||
Meaning::CharGiven(c) => Some(i32::from(c)),
|
||||
Meaning::CharGiven(c) => Some(c as i32),
|
||||
Meaning::Primitive(Primitive::Char) => Some(self.integer(files)?),
|
||||
_ => None,
|
||||
};
|
||||
@@ -716,7 +716,7 @@ impl Executor {
|
||||
continue;
|
||||
}
|
||||
Meaning::Character(TokenKind::Character(c, CatCode::Letter | CatCode::Other)) => c,
|
||||
Meaning::CharGiven(c) => char::from(c),
|
||||
Meaning::CharGiven(c) => self.scalar_character(c, t.span)?,
|
||||
Meaning::Primitive(Primitive::Char) => {
|
||||
let n = self.integer(files)?;
|
||||
char::from(u8::try_from(n).map_err(|_| {
|
||||
|
||||
Reference in new issue
Block a user