plotnik_bytecode/bytecode/
mod.rs

1//! Bytecode module for compiled Plotnik queries.
2//!
3//! Implements the binary format specified in `docs/binary-format/`.
4
5mod aligned_vec;
6mod constants;
7mod dump;
8mod effects;
9mod entrypoint;
10mod format;
11mod header;
12mod ids;
13mod instructions;
14mod module;
15mod nav;
16mod node_type_ir;
17mod sections;
18mod type_meta;
19
20pub use aligned_vec::AlignedVec;
21
22pub use constants::{
23    MAGIC, MAX_MATCH_PAYLOAD_SLOTS, MAX_PRE_EFFECTS, SECTION_ALIGN, STEP_SIZE, VERSION,
24};
25
26pub use ids::{StringId, TypeId};
27
28pub use header::{Header, SectionOffsets};
29
30pub use sections::{FieldSymbol, NodeSymbol, Slice, TriviaEntry};
31
32pub use entrypoint::Entrypoint;
33
34pub use type_meta::{TypeData, TypeDef, TypeKind, TypeMember, TypeName};
35
36pub use nav::Nav;
37
38pub use effects::{EffectOp, EffectOpcode};
39
40pub use instructions::{
41    Call, Match, Opcode, Return, StepAddr, StepId, Trampoline, align_to_section,
42    select_match_opcode,
43};
44
45pub use module::{
46    ByteStorage, EntrypointsView, Instruction, Module, ModuleError, RegexView, StringsView,
47    SymbolsView, TriviaView, TypesView,
48};
49
50pub use dump::dump;
51
52pub use format::{
53    LineBuilder, Symbol, cols, format_effect, nav_symbol, superscript, trace, truncate_text,
54    width_for_count,
55};
56
57pub use node_type_ir::NodeTypeIR;
58
59#[cfg(test)]
60mod aligned_vec_tests;
61#[cfg(test)]
62mod effects_tests;
63#[cfg(test)]
64mod entrypoint_tests;
65#[cfg(test)]
66mod format_tests;
67#[cfg(test)]
68mod header_tests;
69#[cfg(test)]
70mod instructions_tests;
71#[cfg(test)]
72mod module_tests;
73#[cfg(test)]
74mod nav_tests;
75#[cfg(test)]
76mod node_type_ir_tests;
77#[cfg(test)]
78mod sections_tests;
79#[cfg(test)]
80mod type_meta_tests;