Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- collection :: Stream s m Word8 => ParsecT s u m (Collection, [Warning])
- clipDate :: PartialDate -> PartialDate
- data PropertyType
- properties :: GameType -> PropertyType -> [String]
- extraProperties :: GameType -> PropertyType -> [String]
- data Property = Property {}
- data Warning
- = DuplicatePropertyOmitted Property
- | SquareSizeSpecifiedAsRectangle SourcePos
- | DanglingEscapeCharacterOmitted SourcePos
- | PropValueForNonePropertyOmitted Property
- | UnknownPropertyPreserved String
- | PointSpecifiedAsPointRange Property
- | DuplicatePointsOmitted Property [Point]
- | InvalidDatesClipped (Set PartialDate)
- | AnnotationWithNoMoveOmitted Property
- | ExtraGameInfoOmitted Property
- | NestedRootPropertyOmitted Property
- | MovelessAnnotationOmitted Property
- | DuplicateSetupOperationsOmitted [Point]
- | ExtraPositionalJudgmentOmitted (Judgment, Emphasis)
- | DuplicateMarkupOmitted (Mark, Point)
- | ExtraPropertyValuesOmitted Property
- | DuplicateLabelOmitted (Point, String)
- | UnknownNumberingIgnored Integer
- data ErrorType
- data Error
- = KnownError { }
- | UnknownError { }
Documentation
collection :: Stream s m Word8 => ParsecT s u m (Collection, [Warning]) Source #
Parse a Word8
stream into an SGF collection. A collection is a list of
games; the documentation for Game
has more details. There are generally
two kinds of errors in SGF files: recoverable ones (which will be
accumulated in the [Warning
] return) and unrecoverable ones (which will
result in parse errors).
clipDate :: PartialDate -> PartialDate Source #
Clip to a valid, representable date. Years are clipped to the 0000-9999 range; months are clipped to the 1-12 range, and days are clipped to the 1-<number of days in the given month> range (accounting for leap years in the case of February).
If a parsed date is changed by this function, a warning is emitted.
data PropertyType Source #
Types of properties, as given in the SGF specification.
Move | |
Setup | |
Root | |
GameInfo | |
Inherit | Technically, these properties have type "none" and attribute "inherit", but the property index lists them as properties of type "inherit" with no attributes, so we follow that lead. |
None |
Instances
properties :: GameType -> PropertyType -> [String] Source #
All properties of each type listed in the SGF specification.
extraProperties :: GameType -> PropertyType -> [String] Source #
Just the properties associated with specific games.
Property | |
|
Warnings signify recoverable errors.
Instances
Bounded ErrorType Source # | |
Enum ErrorType Source # | |
Defined in Data.SGF.Parse.Util succ :: ErrorType -> ErrorType # pred :: ErrorType -> ErrorType # fromEnum :: ErrorType -> Int # enumFrom :: ErrorType -> [ErrorType] # enumFromThen :: ErrorType -> ErrorType -> [ErrorType] # enumFromTo :: ErrorType -> ErrorType -> [ErrorType] # enumFromThenTo :: ErrorType -> ErrorType -> ErrorType -> [ErrorType] # | |
Read ErrorType Source # | |
Show ErrorType Source # | |
Eq ErrorType Source # | |
Ord ErrorType Source # | |
Defined in Data.SGF.Parse.Util |