Expand description
provides utilities for parser, compiler, and vm crate.
Re-exports§
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!
orAddrEq
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