Crate erg_common
source · [−]Expand description
provides utilities for parser, compiler, and vm crate.
Re-exports
pub use crate::str::Str;
Modules
Escape sequences change the color of the terminal
defines a command-line parser for ergc
.
provides common components for error handling.
Fast, non-cryptographic hash used by rustc and Firefox.
defines Opcode
(represents Python bytecode opcodes).
utilities for calling CPython.
オブジェクトのシリアライズ(バイナリ列化)のためのユーティリティーを定義・実装する
defines common traits used in the compiler.
Macros
一度文字列をパースするので アドレスの比較をしたい場合はaddr_eq!またはAddrEq traitを使うこと
2重のunwrapまでサポート :は制限を回避するためのdummy token
indicates the current invoked function.
impl<T: NestedDisplay> Display for T NestedDisplay
はorphan-ruleに違反するので個別定義する
For Decl, Def, Call, etc., which can occupy a line by itself
Debug log utility. directives: c: colored output f: file specified f+c: file specified and colored (e.g. colored output to stderr) info: info logging, (comprehensive shorthand for “c GREEN”) info_f: file version of info err: error logging, (comprehensive shorthand for “c RED”) err_f: file version of err
More languages will be added … マクロはパラメータを展開しないので、format!のロスがなくなる
Functions
cut \n
複数のオブジェクトからなるハッシュを得たい場合はタプルか配列で渡す
\r\n (Windows), \r (old MacOS) -> \n (Unix)