struct variable type checking, refactoring to avoid circular dependencies

This commit is contained in:
vegowotenks 2025-01-02 10:54:15 +01:00
parent 9f2fad1507
commit 1c1e25a881
15 changed files with 224 additions and 140 deletions

16
src/Ubc/Parse/Scope.hs Normal file
View file

@ -0,0 +1,16 @@
module Ubc.Parse.Scope
( Scope(..)
, expectScopeStruct
)
where
import Ubc.Parse.Scope.FileScope (FileScope)
import Ubc.Parse.Scope.StructScope (StructScope)
data Scope =
ScopeFile FileScope
| ScopeStruct StructScope
expectScopeStruct :: Scope -> StructScope
expectScopeStruct (ScopeStruct s) = s
expectScopeStruct _ = error "Internal Error: Top Scope is not Scope Struct"