mirror of
https://gitee.com/openharmony/third_party_rust_unicode-ident
synced 2024-11-23 07:29:52 +00:00
Merge pull request #16 from dtolnay/write
Pull out static generated file heading into one string literal
This commit is contained in:
commit
38acd92a4b
@ -1,30 +1,25 @@
|
||||
use crate::output::Output;
|
||||
use crate::{is_xid_continue, is_xid_start, CHUNK};
|
||||
|
||||
const HEAD: &str = "\
|
||||
// \x40generated by ../generate. To regenerate, run the following in the repo root:
|
||||
//
|
||||
// $ curl -LO https://www.unicode.org/Public/zipped/14.0.0/UCD.zip
|
||||
// $ unzip UCD.zip -d UCD
|
||||
// $ cargo run --manifest-path generate/Cargo.toml
|
||||
|
||||
const T: bool = true;
|
||||
const F: bool = false;
|
||||
|
||||
#[repr(C, align(8))]
|
||||
pub(crate) struct Align8<T>(pub(crate) T);
|
||||
#[repr(C, align(64))]
|
||||
pub(crate) struct Align64<T>(pub(crate) T);
|
||||
";
|
||||
|
||||
pub fn output(index_start: &[u8], index_continue: &[u8], halfdense: &[u8]) -> Output {
|
||||
let mut out = Output::new();
|
||||
writeln!(
|
||||
out,
|
||||
"// \x40generated by ../generate. To regenerate, run the following in the repo root:",
|
||||
);
|
||||
writeln!(out, "//");
|
||||
writeln!(
|
||||
out,
|
||||
"// $ curl -LO https://www.unicode.org/Public/zipped/14.0.0/UCD.zip",
|
||||
);
|
||||
writeln!(out, "// $ unzip UCD.zip -d UCD");
|
||||
writeln!(out, "// $ cargo run --manifest-path generate/Cargo.toml");
|
||||
writeln!(out);
|
||||
|
||||
writeln!(out, "const T: bool = true;");
|
||||
writeln!(out, "const F: bool = false;");
|
||||
writeln!(out);
|
||||
|
||||
writeln!(out, "#[repr(C, align(8))]");
|
||||
writeln!(out, "pub(crate) struct Align8<T>(pub(crate) T);");
|
||||
writeln!(out, "#[repr(C, align(64))]");
|
||||
writeln!(out, "pub(crate) struct Align64<T>(pub(crate) T);");
|
||||
writeln!(out);
|
||||
writeln!(out, "{}", HEAD);
|
||||
|
||||
writeln!(
|
||||
out,
|
||||
|
Loading…
Reference in New Issue
Block a user