Copyright | (c) Winston Hartnett 2021 |
---|---|
License | GPL-3 |
Maintainer | whartnett@gmail.com |
Stability | experimental |
Portability | POSIX |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
A parser for Godot resource file formats. Currently only supports auto-generated
tscn
and gdns
files.
Synopsis
- data GodotValue
- data GodotSection
- = ExtResourceSection { }
- | SubResourceSection { }
- | NodeSection {
- _nodeSectionTy :: Maybe Text
- _nodeSectionName :: Text
- _nodeSectionParent :: Maybe Text
- _nodeSectionInst :: Maybe Int
- _nodeSectionInstPlaceholder :: Maybe Text
- _nodeSectionOwner :: Maybe Text
- _nodeSectionIndex :: Maybe Int
- _nodeSectionGroups :: Maybe [Text]
- _nodeSectionHeaders :: HashMap Text GodotValue
- _nodeSectionEntries :: HashMap Text GodotValue
- | ConnectionSection { }
- | ResourceSection { }
- | OtherSection { }
- data TscnDescriptor = TscnDescriptor {}
- data TscnParsed = TscnParsed {}
- data OtherDescriptor = OtherDescriptor {}
- data OtherParsed = OtherParsed {}
- data GdnsDescriptor = GdnsDescriptor {}
- data GdnsParsed = GdnsParsed {}
- data GodotParsed
- tscnParser :: Parser TscnParsed
- gdnsParser :: Parser GdnsParsed
- otherParser :: Parser OtherParsed
- godotParser :: Parser GodotParsed
Documentation
data GodotValue Source #
Values parsed from a Tscn file.
Constructors are `(constructor name, constructor args)`.
GodotConstructor (Text, [GodotValue]) | |
GodotInt Int | |
GodotFloat Float | |
GodotBool Bool | |
GodotString Text | |
GodotDict (HashMap Text GodotValue) | |
GodotArr [GodotValue] | |
GodotNull |
Instances
data GodotSection Source #
Godot resource section prefixed with a bracket-enclosed header, optionally with body entries.
Header entries not specified in a record are accessed with the relevant headers
field.
Likewise, body entries not specified are accessed with the entries
field.
Note that explicitly specified section fields are not duplicated in headers
and
entries
fields.
Instances
data TscnDescriptor Source #
tscn
file descriptor.
Instances
data TscnParsed Source #
Parsed tscn
file.
Instances
data OtherDescriptor Source #
An unknown file descriptor.
Instances
data OtherParsed Source #
An unknown file parsing result.
Instances
data GdnsDescriptor Source #
gdns
file descriptor.
Instances
data GdnsParsed Source #
Parsed gdns
file.
Instances
data GodotParsed Source #
Parsed godot resource file.
Instances
tscnParser :: Parser TscnParsed Source #
Parse a tscn
file.
gdnsParser :: Parser GdnsParsed Source #
Parse a gdns
file.
otherParser :: Parser OtherParsed Source #
Parse an unknown resource file.
godotParser :: Parser GodotParsed Source #
Parse some Godot resource file.