Copyright | (c) roki 2019 |
---|---|
License | MIT |
Maintainer | falgon53@yahoo.co.jp |
Stability | experimental |
Portability | POSIX |
Safe Haskell | None |
Language | Haskell2010 |
The Data type of variables and its utilities used in parsing
Documentation
The data type of a tag
Tag | The constructor of a tag |
|
Instances
Eq i => Eq (Tag i) Source # | |
Ord i => Ord (Tag i) Source # | |
Show i => Show (Tag i) Source # | |
Generic (Tag i) Source # | |
NFData i => NFData (Tag i) Source # | |
Defined in Htcc.Parser.ConstructionData.Scope.Tag | |
ManagedScope (Tag i) Source # | |
type Rep (Tag i) Source # | |
Defined in Htcc.Parser.ConstructionData.Scope.Tag type Rep (Tag i) = D1 ('MetaData "Tag" "Htcc.Parser.ConstructionData.Scope.Tag" "htcc-0.0.0.1-I8tHuOdNzco4DzUthNftqr" 'False) (C1 ('MetaCons "Tag" 'PrefixI 'True) (S1 ('MetaSel ('Just "sttype") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (StorageClass i)) :*: S1 ('MetaSel ('Just "stNestDepth") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Natural))) |
add :: Num i => Natural -> StorageClass i -> TokenLC i -> Tags i -> Either (ASTError i) (Tags i) Source #
Given the current nesting number, type, identifier token, and Tags
, if the specified identifier already exists in the same scope,
return an error message and its location as a pair.
Otherwise, add a new tag to Tags
and return it.
If the token does not indicate an identifier, an error indicating internal compiler error is returned.