| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Language.Oberon.Reserializer
Description
This module exports functions for reserializing the parsed tree from the tokens stored with every node.
Synopsis
- adjustPositions :: (Foldable (g (Const (Sum Int) :: Type -> Type)), Foldable (Fold Parsed (Sum Int)) g, Traversable PositionAdjustment g) => Parsed (g Parsed Parsed) -> Parsed (g Parsed Parsed)
- reserialize :: Foldable Serialization g => Parsed (g Parsed Parsed) -> Text
- sourceLength :: (Foldable (g (Const (Sum Int) :: Type -> Type)), Foldable (Fold Parsed (Sum Int)) g) => Parsed (g Parsed Parsed) -> Int
- data PositionAdjustment
- data Serialization
Documentation
adjustPositions :: (Foldable (g (Const (Sum Int) :: Type -> Type)), Foldable (Fold Parsed (Sum Int)) g, Traversable PositionAdjustment g) => Parsed (g Parsed Parsed) -> Parsed (g Parsed Parsed) Source #
Re-calculates the position of every node in the parse tree from the tokens stored with it and its children.
reserialize :: Foldable Serialization g => Parsed (g Parsed Parsed) -> Text Source #
Serializes the tree back into the text it was parsed from.
sourceLength :: (Foldable (g (Const (Sum Int) :: Type -> Type)), Foldable (Fold Parsed (Sum Int)) g) => Parsed (g Parsed Parsed) -> Int Source #
The length of the source code parsed into the argument node
data PositionAdjustment Source #
Transformation type used by adjustPositions
Instances
| Transformation PositionAdjustment Source # | |||||||||
Defined in Language.Oberon.Reserializer Associated Types
| |||||||||
| (Foldable (g (Const (Sum Int) :: Type -> Type)), Traversable (g Parsed), Foldable (Fold Parsed (Sum Int)) g, Traversable PositionAdjustment g) => Traversable PositionAdjustment g Source # | |||||||||
Defined in Language.Oberon.Reserializer Methods traverse :: Codomain PositionAdjustment ~ Compose m f => PositionAdjustment -> Domain PositionAdjustment (g (Domain PositionAdjustment) (Domain PositionAdjustment)) -> m (f (g f f)) # | |||||||||
| type Codomain PositionAdjustment Source # | |||||||||
Defined in Language.Oberon.Reserializer | |||||||||
| type Domain PositionAdjustment Source # | |||||||||
Defined in Language.Oberon.Reserializer | |||||||||
data Serialization Source #
Transformation type used by reserialize
Instances
| Transformation Serialization Source # | |||||||||
Defined in Language.Oberon.Reserializer Associated Types
| |||||||||
| (Foldable (g Parsed), Foldable Serialization g) => Foldable Serialization g Source # | |||||||||
Defined in Language.Oberon.Reserializer Methods foldMap :: (Codomain Serialization ~ (Const m :: Type -> Type), Monoid m) => Serialization -> Domain Serialization (g (Domain Serialization) (Domain Serialization)) -> m # | |||||||||
| type Codomain Serialization Source # | |||||||||
| type Domain Serialization Source # | |||||||||
Defined in Language.Oberon.Reserializer | |||||||||