Expand description
This crate exists because of limitations with proc-macro
crates. We need
to be able to test errors returned from the code generation function while
also being able to test the macros themselves. This might also be reused by
people who have new storage types.
This is also available as a hidden reexport from the main awint
crate if
the “std” feature is enabled
Re-exports§
pub use awint_ext;
pub use awint_ext::awint_core;
pub use triple_arena;
Structs§
- Ast
- CCMacro
Error - CWidth
- For concatenation widths
- CodeGen
- Note: the type must be unambiguous for the construction functions
- Component
- Concatenation
- FnNames
- Lower
- Names
- Prefixes used for codegen names and functions. Most of these should be prefixed with two underscores and the crate name to prevent collisions.
- PBind
- PCWidth
- PText
- PVal
- PWidth
- Usb
- Usize and/or String Bound. If
s.is_empty()
, then there is no arbitrary string in the bound and the base value is 0.x
is added on to the value. - Usbr
Enums§
- Bind
- Component
Type - Delimiter
- Filler
Align - Text
- Value
- Width
- Bitwidth as described by a single value or one value minus another
Constants§
- AWINT_
FN_ NAMES - AWINT_
NAMES - Default names for
awint
Functions§
- awi_
construction_ fn - awi_s
- awint_
awi_ lit_ construction_ fn - awint_
bits_ const_ wrapper - awint_
bits_ lit_ construction_ fn - awint_
extawi_ lit_ construction_ fn - awint_
inlawi_ lit_ construction_ fn - awint_
macro_ awi - awint_
macro_ bits - awint_
macro_ cc - awint_
macro_ extawi - awint_
macro_ inlawi - awint_
must_ use - awint_
static_ construction_ fn - awint_
unreachable_ construction_ fn - cc_
construction_ fn - cc_
macro - Input parsing and code generation function for corresponding concatenations of components macros.
- cc_
macro_ code_ gen - Lowering of the parsed structs into Rust code.
- chars_
to_ string - color_
text - Wrap
s
in ANSI delimiters for terminal colors. {90..=97} => {grey, red, green, yellow, blue, purple, cyan, white} - error_
and_ help - extawi_
construction_ fn - extawi_
s - i128_
to_ nonzerousize - i128_
to_ usize - i128_
try_ parse - Tries parsing as hexadecimal, octal, binary, and decimal
- identity_
const_ wrapper - inlawi_
construction_ fn - inlawi_
s - parse_
range - Tries to parse raw
input
as a range. - parse_
usb - In ranges we commonly see stuff like
(x + y)
or(x - y)
with one of them being a constant we can parse, which passes upward theUsb
andUsbr
chain to get calculated into a static width. - stage1
- Looks for the existence of a top level “[]” delimited group and uses the last one as a bit range.
- stage2
- stage3
- stage4
- stage5
- token_
stream_ to_ ast - Parses
input
TokenStream
into “raw” concatenations of components inVec<char>
strings - unstable_
native_ bits - unstable_
native_ inlawi - Returns architecture-independent Rust code that returns an
InlAwi
preset with the value ofbits
. - unstable_
native_ inlawi_ ty - Returns architecture-independent Rust code that returns an
InlAwi
type with bitwidthw
. - usize_
to_ i128