1#ifndef SPUDPLATE_BINARY_SERIALIZER_H
2#define SPUDPLATE_BINARY_SERIALIZER_H
10#include "spudplate/ast.h"
24enum class ExprTag : std::uint8_t {
36enum class StmtTag : std::uint8_t {
50enum class PathSegTag : std::uint8_t {
57enum class FileSrcTag : std::uint8_t {
63enum class TemplatePartTag : std::uint8_t {
71 using std::runtime_error::runtime_error;
86 std::size_t
offset() const noexcept {
return offset_; }
105std::vector<std::uint8_t> serialize_program(
const Program& program);
122Program deserialize_program(
const std::uint8_t* data, std::size_t size,
123 std::uint8_t pack_version = 4);
Raised when the byte stream cannot be decoded.
Definition binary_serializer.h:80
std::size_t offset() const noexcept
Byte offset within the decoded buffer where the failure occurred.
Definition binary_serializer.h:86
Raised when an AST cannot be encoded (e.g.
Definition binary_serializer.h:69