Skip to content

v.gen.wasm.serialise #

fn eval_escape_codes #

fn eval_escape_codes(str_lit ast.StringLiteral) !string

fn eval_escape_codes_raw #

fn eval_escape_codes_raw(str string) !string

fn new_pool #

fn new_pool(table &ast.Table, opts PoolOpts) Pool

struct Pool #

@[noinit]
struct Pool {
mut:
	table &ast.Table
	// eval    eval.Eval
	structs map[ast.Type]StructInfo
	strings []StringInfo // string intern
pub:
	null_terminated bool
	intern_strings  bool
	store_relocs    bool
pub mut:
	buf               []u8
	relocs            []Reloc
	highest_alignment int
}

fn (Pool) type_struct_info #

fn (mut p Pool) type_struct_info(typ ast.Type) ?StructInfo

fn (Pool) type_size #

fn (mut p Pool) type_size(typ ast.Type) (int, int)

fn (Pool) append_string #

fn (mut p Pool) append_string(val string) int

fn (Pool) append #

fn (mut p Pool) append(init ast.Expr, typ ast.Type) (int, bool)

struct PoolOpts #

@[params]
struct PoolOpts {
pub:
	null_terminated bool = true
	intern_strings  bool = true
	store_relocs    bool = true
}

struct Reloc #

struct Reloc {
pub:
	pos    int
	offset int
}

struct StructInfo #

struct StructInfo {
pub mut:
	offsets []int
}