Fix parsing struct types
This commit is contained in:
parent
8e7facc593
commit
1265040f29
@ -549,6 +549,13 @@ namespace parsing {
|
|||||||
auto ty = parse_type(inner, scope).unwrap();
|
auto ty = parse_type(inner, scope).unwrap();
|
||||||
inner.expect(token::Type::Symbol, ";");
|
inner.expect(token::Type::Symbol, ";");
|
||||||
|
|
||||||
|
if (ty->m_kind == types::TypeKind::Struct) {
|
||||||
|
auto struct_ty = dynamic_cast<types::StructType*>(ty.get());
|
||||||
|
if (!struct_ty->m_is_ref && struct_ty->m_name) {
|
||||||
|
scope.structs[*struct_ty->m_name] = ty;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
stream.m_position = inner.m_position;
|
stream.m_position = inner.m_position;
|
||||||
auto tl_typedef = new AST::TopLevelTypedef{
|
auto tl_typedef = new AST::TopLevelTypedef{
|
||||||
before_meta + stream.metadata(), ty
|
before_meta + stream.metadata(), ty
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user