Crate erg_common

Source
Expand description

provides utilities for parser, compiler, and vm crate.

Re-exports§

pub use crate::str::Str;
pub use crate::triple::Triple;

Modules§

cache
config
defines a command-line parser for ergc.
consts
datetime
dict
env
erg_util
error
provides common components for error handling.
fresh
fxhash
Fast, non-cryptographic hash used by rustc and Firefox.
help_messages
io
lang
levenshtein
macros
opcode
defines Opcode (represents Python bytecode opcodes).
opcode308
defines Opcode (represents Python bytecode opcodes).
opcode309
defines Opcode (represents Python bytecode opcodes).
opcode310
defines Opcode (represents Python bytecode opcodes).
opcode311
defines Opcode (represents Python bytecode opcodes).
pathutil
python_util
utilities for calling CPython.
random
serialize
オブジェクトのシリアライズ(バイナリ列化)のためのユーティリティーを定義・実装する
set
shared
spawn
stdin
str
style
traits
defines common traits used in the compiler.
triple
tsort
Topological sort
vfs

Macros§

addr
Once the argument is parsed into String, so use addr_eq! or AddrEq trait if you want to compare addresses
addr_eq
do not use for reference types
assume_unreachable
caused_by
debug_enum_assert
debug_info
debug_power_assert
dict
enable_overflow_stacktrace
enum_unwrap
Supports up to double unwrap : is a dummy token to bypass restrictions
fmt_dbg
fmt_option
fmt_option_map
fn_name
fn_name_full
indicates the current invoked function.
impl_display_and_error
impl_display_for_enum
impl_display_for_enum_with_variant
impl_display_for_single_struct
impl_display_from_debug
impl_display_from_nested
impl<T: NestedDisplay> Display for T NestedDisplayはorphan-ruleに違反するので個別定義する
impl_displayable_deque_stream_for_wrapper
impl_displayable_stream_for_wrapper
impl_from_trait_for_enum
impl_locational
impl_locational_for_enum
impl_nested_display_for_chunk_enum
For Decl, Def, Call, etc., which can occupy a line by itself
impl_nested_display_for_enum
impl_no_type_display_for_enum
impl_stream
impl_traversable_for_enum
impl_try_from_trait_for_enum
impl_u8_enum
log
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
log_with_time
lsp_log
option_enum_unwrap
power_assert
ref_addr_eq
set
set_recursion_limit
switch_lang
More languages will be added … Macros do not expand parameters, eliminating the cost of format!
switch_unreachable

Functions§

cheap_canonicalize_path
chomp
cut \n
debug_fmt_iter
deepen_indent
failable_map_mut
fmt_indent
fmt_iter
fmt_iter_split_with
fmt_set_split_with
fmt_slice
fmt_vec
fmt_vec_split_with
get_hash
If you want to get a hash consisting of multiple objects, pass it as a tuple or array
normalize_newline
\r\n (Windows), \r (old MacOS) -> \n (Unix)
normalize_path
at least, this is necessary for Windows and macOS
open_read
read_file
trim_eliminate_top_indent
try_map
try_map_mut
unique_in_place

Type Aliases§

ArcArray