add #inline

This commit is contained in:
Bruce A. MacNaughton 2022-07-20 16:13:54 -07:00
parent e5d4de3912
commit 5d048eb69d
2 changed files with 2 additions and 0 deletions

View File

@ -555,6 +555,7 @@ pub mod white_space {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0,
];
#[inline]
pub fn lookup(c: char) -> bool {
match c as u32 >> 8 {
0 => WHITESPACE_MAP[c as usize & 0xff] & 1 != 0,

View File

@ -63,6 +63,7 @@ pub fn emit_cascading_map(&mut self, ranges: &[Range<u32>]) -> bool {
.unwrap();
self.bytes_used += 256;
writeln!(&mut self.file, "#[inline]").unwrap();
writeln!(&mut self.file, "pub fn lookup(c: char) -> bool {{").unwrap();
writeln!(&mut self.file, " match c as u32 >> 8 {{").unwrap();
for arm in arms {