Initial texrra engine
Rename the crate, binary, core crate, font families, env vars, and internal commands from texcraft/tex-engine to texrra. Serve the separately versioned texrra-web frontend from TEXRRA_WEB_DIR, ../web, or ./web instead of embedding index.html. Add starred section heading support and an arXiv template conformance fixture.
This commit is contained in:
commit
bb1d9e0561
147 files changed
+66719
No files matched your search
Vendored
+26
@@ -0,0 +1,26 @@
|
||||
//! Primitive that pauses execution for a duration of time
|
||||
|
||||
use std::thread;
|
||||
use std::time;
|
||||
use texlang::prelude as txl;
|
||||
use texlang::traits::*;
|
||||
use texlang::*;
|
||||
use texlang_common as common;
|
||||
|
||||
pub const SLEEP_DOC: &str = "Sleep for a number of milliseconds";
|
||||
|
||||
/// Get the `\sleep` expansion primitive.
|
||||
pub fn get_sleep<S: TexlangState + common::HasLogging>() -> command::BuiltIn<S> {
|
||||
command::BuiltIn::new_execution(
|
||||
|_: token::Token, input: &mut vm::ExecutionInput<S>| -> txl::Result<()> {
|
||||
let milliseconds = parse::Uint::<{ parse::Uint::MAX }>::parse(input)?.0;
|
||||
writeln![
|
||||
input.state().terminal_out().borrow_mut(),
|
||||
"\\sleep: sleeping for {milliseconds}ms",
|
||||
]
|
||||
.unwrap();
|
||||
thread::sleep(time::Duration::from_millis(milliseconds as u64));
|
||||
Ok(())
|
||||
},
|
||||
)
|
||||
}
|
||||
Reference in new issue
Block a user