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
- data TscnDescriptor = TscnDescriptor {}
- data TscnParsed = TscnParsed {}
- data OtherDescriptor = OtherDescriptor {}
- data OtherParsed = OtherParsed {}
- data GdnsDescriptor = GdnsDescriptor {}
- data GdnsParsed = GdnsParsed {}
- data GodotParsed
- data ExtResource = ExtResource {}
- data SubResource = SubResource {}
- data Node = Node {}
- data Connection = Connection {}
- data Resource = Resource {}
- 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.
ExtResourceSection ExtResource | |
SubResourceSection SubResource | |
NodeSection Node | |
ConnectionSection Connection | |
ResourceSection Resource | |
OtherSection | |
Instances
data TscnDescriptor Source #
tscn
file descriptor.
Instances
Show TscnDescriptor Source # | |
Defined in Godot.Parser.Resource showsPrec :: Int -> TscnDescriptor -> ShowS # show :: TscnDescriptor -> String # showList :: [TscnDescriptor] -> ShowS # | |
Generic TscnDescriptor Source # | |
Defined in Godot.Parser.Resource type Rep TscnDescriptor :: Type -> Type # from :: TscnDescriptor -> Rep TscnDescriptor x # to :: Rep TscnDescriptor x -> TscnDescriptor # | |
type Rep TscnDescriptor Source # | |
Defined in Godot.Parser.Resource type Rep TscnDescriptor = D1 ('MetaData "TscnDescriptor" "Godot.Parser.Resource" "godot-megaparsec-0.2.2.0-J361sL0jUeeDE22PIJ5Ttf" 'False) (C1 ('MetaCons "TscnDescriptor" 'PrefixI 'True) (S1 ('MetaSel ('Just "_tscnDescriptorLoadSteps") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int) :*: S1 ('MetaSel ('Just "_tscnDescriptorFormat") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int))) |
data TscnParsed Source #
Parsed tscn
file.
Instances
Show TscnParsed Source # | |
Defined in Godot.Parser.Resource showsPrec :: Int -> TscnParsed -> ShowS # show :: TscnParsed -> String # showList :: [TscnParsed] -> ShowS # | |
Generic TscnParsed Source # | |
Defined in Godot.Parser.Resource type Rep TscnParsed :: Type -> Type # from :: TscnParsed -> Rep TscnParsed x # to :: Rep TscnParsed x -> TscnParsed # | |
type Rep TscnParsed Source # | |
Defined in Godot.Parser.Resource type Rep TscnParsed = D1 ('MetaData "TscnParsed" "Godot.Parser.Resource" "godot-megaparsec-0.2.2.0-J361sL0jUeeDE22PIJ5Ttf" '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.
Instances
Show OtherDescriptor Source # | |
Defined in Godot.Parser.Resource showsPrec :: Int -> OtherDescriptor -> ShowS # show :: OtherDescriptor -> String # showList :: [OtherDescriptor] -> ShowS # | |
Generic OtherDescriptor Source # | |
Defined in Godot.Parser.Resource type Rep OtherDescriptor :: Type -> Type # from :: OtherDescriptor -> Rep OtherDescriptor x # to :: Rep OtherDescriptor x -> OtherDescriptor # | |
type Rep OtherDescriptor Source # | |
Defined in Godot.Parser.Resource type Rep OtherDescriptor = D1 ('MetaData "OtherDescriptor" "Godot.Parser.Resource" "godot-megaparsec-0.2.2.0-J361sL0jUeeDE22PIJ5Ttf" 'False) (C1 ('MetaCons "OtherDescriptor" 'PrefixI 'True) (S1 ('MetaSel ('Just "_otherDescriptorHeaderName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Just "_otherDescriptorHeaders") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (HashMap Text GodotValue)))) |
data OtherParsed Source #
An unknown file parsing result.
Instances
Show OtherParsed Source # | |
Defined in Godot.Parser.Resource showsPrec :: Int -> OtherParsed -> ShowS # show :: OtherParsed -> String # showList :: [OtherParsed] -> ShowS # | |
Generic OtherParsed Source # | |
Defined in Godot.Parser.Resource type Rep OtherParsed :: Type -> Type # from :: OtherParsed -> Rep OtherParsed x # to :: Rep OtherParsed x -> OtherParsed # | |
type Rep OtherParsed Source # | |
Defined in Godot.Parser.Resource type Rep OtherParsed = D1 ('MetaData "OtherParsed" "Godot.Parser.Resource" "godot-megaparsec-0.2.2.0-J361sL0jUeeDE22PIJ5Ttf" '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.
Instances
Show GdnsDescriptor Source # | |
Defined in Godot.Parser.Resource showsPrec :: Int -> GdnsDescriptor -> ShowS # show :: GdnsDescriptor -> String # showList :: [GdnsDescriptor] -> ShowS # | |
Generic GdnsDescriptor Source # | |
Defined in Godot.Parser.Resource type Rep GdnsDescriptor :: Type -> Type # from :: GdnsDescriptor -> Rep GdnsDescriptor x # to :: Rep GdnsDescriptor x -> GdnsDescriptor # | |
type Rep GdnsDescriptor Source # | |
Defined in Godot.Parser.Resource type Rep GdnsDescriptor = D1 ('MetaData "GdnsDescriptor" "Godot.Parser.Resource" "godot-megaparsec-0.2.2.0-J361sL0jUeeDE22PIJ5Ttf" 'False) (C1 ('MetaCons "GdnsDescriptor" 'PrefixI 'True) (S1 ('MetaSel ('Just "_gdnsDescriptorTy") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: (S1 ('MetaSel ('Just "_gdnsDescriptorLoadSteps") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int) :*: S1 ('MetaSel ('Just "_gdnsDescriptorFormat") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int)))) |
data GdnsParsed Source #
Parsed gdns
file.
Instances
Show GdnsParsed Source # | |
Defined in Godot.Parser.Resource showsPrec :: Int -> GdnsParsed -> ShowS # show :: GdnsParsed -> String # showList :: [GdnsParsed] -> ShowS # | |
Generic GdnsParsed Source # | |
Defined in Godot.Parser.Resource type Rep GdnsParsed :: Type -> Type # from :: GdnsParsed -> Rep GdnsParsed x # to :: Rep GdnsParsed x -> GdnsParsed # | |
type Rep GdnsParsed Source # | |
Defined in Godot.Parser.Resource type Rep GdnsParsed = D1 ('MetaData "GdnsParsed" "Godot.Parser.Resource" "godot-megaparsec-0.2.2.0-J361sL0jUeeDE22PIJ5Ttf" '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.
Instances
data ExtResource Source #
ExtResource | |
|
Instances
data SubResource Source #
SubResource | |
|
Instances
Node | |
|
Instances
data Connection Source #
Connection | |
|
Instances
Resource | |
|
Instances
Show Resource Source # | |
Generic Resource Source # | |
type Rep Resource Source # | |
Defined in Godot.Parser.Resource type Rep Resource = D1 ('MetaData "Resource" "Godot.Parser.Resource" "godot-megaparsec-0.2.2.0-J361sL0jUeeDE22PIJ5Ttf" 'False) (C1 ('MetaCons "Resource" 'PrefixI 'True) (S1 ('MetaSel ('Just "_resourceResourceName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Text)) :*: (S1 ('MetaSel ('Just "_resourceClassName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "_resourceLibrary") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe (Text, [GodotValue])))))) |
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.