Struct Parsing continued, ditched multiple-errors support
This commit is contained in:
parent
0adef12173
commit
9f2fad1507
10 changed files with 70 additions and 48 deletions
|
@ -1,11 +1,19 @@
|
|||
module Data.String.Ubc.Parse.StructScope
|
||||
( StructScope(..)
|
||||
, modifyVariables
|
||||
)
|
||||
where
|
||||
|
||||
import Data.String.Ubc.Parse.Error.StructError (StructError)
|
||||
import Data.Map (Map)
|
||||
|
||||
import Data.String.Ubc.Parse.StructVariable (StructVariable)
|
||||
|
||||
data StructScope = StructScope
|
||||
{ structName :: Maybe String
|
||||
, errors :: [StructError]
|
||||
{ structName :: String
|
||||
, variables :: Map String StructVariable
|
||||
}
|
||||
|
||||
modifyVariables :: (Map String StructVariable -> Map String StructVariable) -> StructScope -> StructScope
|
||||
modifyVariables f scope@StructScope{variables = oldVariables} = scope{variables = newVariables}
|
||||
where
|
||||
newVariables = f oldVariables
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue