Copyright | (c) Winston Hartnett 2021 |
---|---|
License | GPL-3 |
Maintainer | whartnett@gmail.com |
Stability | experimental |
Portability | POSIX |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Godot.Parser.Resource
Description
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)`.
Constructors
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.
Constructors
Instances
data TscnDescriptor Source #
tscn
file descriptor.
Constructors
TscnDescriptor | |
Fields |
Instances
data TscnParsed Source #
Parsed tscn
file.
Constructors
TscnParsed | |
Fields |
Instances
Show TscnParsed Source # | |
Defined in Godot.Parser.Resource Methods showsPrec :: Int -> TscnParsed -> ShowS # show :: TscnParsed -> String # showList :: [TscnParsed] -> ShowS # | |
Generic TscnParsed Source # | |
Defined in Godot.Parser.Resource Associated Types type Rep TscnParsed :: Type -> Type # | |
HasDescriptor TscnParsed TscnDescriptor Source # | |
Defined in Godot.Parser.Resource.Lens Methods | |
HasSections TscnParsed [GodotSection] Source # | |
Defined in Godot.Parser.Resource.Lens Methods | |
type Rep TscnParsed Source # | |
Defined in Godot.Parser.Resource type Rep TscnParsed = D1 ('MetaData "TscnParsed" "Godot.Parser.Resource" "godot-megaparsec-0.2.0.0-FBhSGlekAk9AK9PskErylb" 'False) (C1 ('MetaCons "TscnParsed" 'PrefixI 'True) (S1 ('MetaSel ('Just "_tscnParsedDescriptor") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 TscnDescriptor) :*: S1 ('MetaSel ('Just "_tscnParsedSections") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [GodotSection]))) |
data OtherDescriptor Source #
An unknown file descriptor.
Constructors
OtherDescriptor | |
Instances
data OtherParsed Source #
An unknown file parsing result.
Constructors
OtherParsed | |
Instances
Show OtherParsed Source # | |
Defined in Godot.Parser.Resource Methods showsPrec :: Int -> OtherParsed -> ShowS # show :: OtherParsed -> String # showList :: [OtherParsed] -> ShowS # | |
Generic OtherParsed Source # | |
Defined in Godot.Parser.Resource Associated Types type Rep OtherParsed :: Type -> Type # | |
HasDescriptor OtherParsed OtherDescriptor Source # | |
Defined in Godot.Parser.Resource.Lens Methods | |
HasSections OtherParsed [GodotSection] Source # | |
Defined in Godot.Parser.Resource.Lens Methods | |
type Rep OtherParsed Source # | |
Defined in Godot.Parser.Resource type Rep OtherParsed = D1 ('MetaData "OtherParsed" "Godot.Parser.Resource" "godot-megaparsec-0.2.0.0-FBhSGlekAk9AK9PskErylb" 'False) (C1 ('MetaCons "OtherParsed" 'PrefixI 'True) (S1 ('MetaSel ('Just "_otherParsedDescriptor") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 OtherDescriptor) :*: S1 ('MetaSel ('Just "_otherParsedSections") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [GodotSection]))) |
data GdnsDescriptor Source #
gdns
file descriptor.
Constructors
GdnsDescriptor | |
Fields |
Instances
data GdnsParsed Source #
Parsed gdns
file.
Constructors
GdnsParsed | |
Fields |
Instances
Show GdnsParsed Source # | |
Defined in Godot.Parser.Resource Methods showsPrec :: Int -> GdnsParsed -> ShowS # show :: GdnsParsed -> String # showList :: [GdnsParsed] -> ShowS # | |
Generic GdnsParsed Source # | |
Defined in Godot.Parser.Resource Associated Types type Rep GdnsParsed :: Type -> Type # | |
HasDescriptor GdnsParsed GdnsDescriptor Source # | |
Defined in Godot.Parser.Resource.Lens Methods | |
HasSections GdnsParsed [GodotSection] Source # | |
Defined in Godot.Parser.Resource.Lens Methods | |
type Rep GdnsParsed Source # | |
Defined in Godot.Parser.Resource type Rep GdnsParsed = D1 ('MetaData "GdnsParsed" "Godot.Parser.Resource" "godot-megaparsec-0.2.0.0-FBhSGlekAk9AK9PskErylb" 'False) (C1 ('MetaCons "GdnsParsed" 'PrefixI 'True) (S1 ('MetaSel ('Just "_gdnsParsedDescriptor") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 GdnsDescriptor) :*: S1 ('MetaSel ('Just "_gdnsParsedSections") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [GodotSection]))) |
data GodotParsed Source #
Parsed godot resource file.
Constructors
Tscn TscnParsed | |
Gdns GdnsParsed | |
Other OtherParsed |
Instances
Show GodotParsed Source # | |
Defined in Godot.Parser.Resource Methods showsPrec :: Int -> GodotParsed -> ShowS # show :: GodotParsed -> String # showList :: [GodotParsed] -> ShowS # | |
Generic GodotParsed Source # | |
Defined in Godot.Parser.Resource Associated Types type Rep GodotParsed :: Type -> Type # | |
type Rep GodotParsed Source # | |
Defined in Godot.Parser.Resource type Rep GodotParsed = D1 ('MetaData "GodotParsed" "Godot.Parser.Resource" "godot-megaparsec-0.2.0.0-FBhSGlekAk9AK9PskErylb" 'False) (C1 ('MetaCons "Tscn" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 TscnParsed)) :+: (C1 ('MetaCons "Gdns" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 GdnsParsed)) :+: C1 ('MetaCons "Other" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 OtherParsed)))) |
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.