sun::serialization
namespace · Source (opens in a new tab)
Converts syntax trees to and from the compiler protobuf representation.
Classes
- sun::serialization::ASTDeserializer (public)
- sun::serialization::ASTSerializer (public)
Structs
- sun::serialization::DeserializerConfig (public)
- sun::serialization::SerializerConfig (public)
Functions
- fromProto
- fromProtoTokenKind
- loadedSourceFileId
- remapSourceFiles
- toLifetimeParameters
- toProto
- toProtoTokenKind
- toStringVector
- visitDeclarationKeys
fromProto
public · function · Source (opens in a new tab)
Visibility sun::serialization::fromProto(pbc::Visibility v)Converts a serialized visibility value to the compiler representation.
Related: Visibility
fromProtoTokenKind
public · function · Source (opens in a new tab)
TokenKind sun::serialization::fromProtoTokenKind(pbc::TokenKind kind)Converts a protobuf token category to the lexer representation.
Related: TokenKind
loadedSourceFileId
public · function · Source (opens in a new tab)
SourceFileId sun::serialization::loadedSourceFileId(const std::string &bundle, SourceFileId local)Give a bundle-local file a stable, distinct identity in this process.
Related: SourceFileId
remapSourceFiles
public · function · Source (opens in a new tab)
template <typename Remap>
void sun::serialization::remapSourceFiles(google::protobuf::Message &message, Remap &&remap)Remap source identities throughout a serialized tree.
toLifetimeParameters
public · function · static · Source (opens in a new tab)
template <typename Owner>
static std::vector< sun::ast::LifetimeParameter > sun::serialization::toLifetimeParameters(const Owner &owner)Lifetime parameters, from the names the bundle carries.
Bundles written before lifetimes existed have none, which reads back as fully elided.
Related: sun::ast::LifetimeParameter
toProto
public · function · Source (opens in a new tab)
pbc::Visibility sun::serialization::toProto(sun::semantic_analysis::Visibility v)Converts compiler visibility to its serialized representation.
Related: sun::semantic_analysis::Visibility
toProtoTokenKind
public · function · Source (opens in a new tab)
pbc::TokenKind sun::serialization::toProtoTokenKind(TokenKind kind)Converts a lexer token category to its protobuf representation.
Related: TokenKind
toStringVector
public · function · static · Source (opens in a new tab)
template <typename Repeated>
static std::vector< std::string > sun::serialization::toStringVector(const Repeated &field)Copy a repeated string field into a plain vector.
visitDeclarationKeys
public · function · Source (opens in a new tab)
void sun::serialization::visitDeclarationKeys(const google::protobuf::Message &message, const std::function< void(const sun::semantic_analysis::PortableDeclarationKey &, std::optional< sun::types::Type::Kind >, const std::string &)> &visit)Visit portable nominal references, retaining names only for diagnostics.
Related: sun::semantic_analysis::PortableDeclarationKey, sun::types::Type::Kind
Variables
kTokenKindProtoMap
public · variable · Source (opens in a new tab)
std::pair<TokenKind, pbc::TokenKind> sun::serialization::kTokenKindProtoMap[][]No documentation comment.
Related: TokenKind