types/serializer: add HasAttrNode binary encoding for ? operator
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: Ibfb89151eb80ab1ae1d8878b6849d2c96a6a6964
This commit is contained in:
parent
3441853eef
commit
f4135a5dca
2 changed files with 12 additions and 4 deletions
|
|
@ -271,7 +271,14 @@ struct Deserializer::Impl {
|
|||
case NodeType::SELECT: {
|
||||
auto expr = read_node();
|
||||
auto attr = read_node();
|
||||
return std::make_shared<Node>(SelectNode(expr, attr, line));
|
||||
uint8_t has_default = read_u8();
|
||||
std::optional<std::shared_ptr<Node>> default_expr;
|
||||
if (has_default) {
|
||||
default_expr = read_node();
|
||||
}
|
||||
SelectNode select_node(expr, attr, line);
|
||||
select_node.default_expr = default_expr;
|
||||
return std::make_shared<Node>(std::move(select_node));
|
||||
}
|
||||
case NodeType::HAS_ATTR: {
|
||||
auto expr = read_node();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue