| 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
| Show TscnDescriptor Source # | |
Defined in Godot.Parser.Resource Methods showsPrec :: Int -> TscnDescriptor -> ShowS # show :: TscnDescriptor -> String # showList :: [TscnDescriptor] -> ShowS # | |
| Generic TscnDescriptor Source # | |
Defined in Godot.Parser.Resource Associated Types type Rep TscnDescriptor :: Type -> Type # Methods 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.1.0-EbERUixCJDx7jOrFLshw0V" '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.
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 # | |
| type Rep TscnParsed Source # | |
Defined in Godot.Parser.Resource type Rep TscnParsed = D1 ('MetaData "TscnParsed" "Godot.Parser.Resource" "godot-megaparsec-0.2.1.0-EbERUixCJDx7jOrFLshw0V" '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
| Show OtherDescriptor Source # | |
Defined in Godot.Parser.Resource Methods showsPrec :: Int -> OtherDescriptor -> ShowS # show :: OtherDescriptor -> String # showList :: [OtherDescriptor] -> ShowS # | |
| Generic OtherDescriptor Source # | |
Defined in Godot.Parser.Resource Associated Types type Rep OtherDescriptor :: Type -> Type # Methods 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.1.0-EbERUixCJDx7jOrFLshw0V" '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.
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 # | |
| type Rep OtherParsed Source # | |
Defined in Godot.Parser.Resource type Rep OtherParsed = D1 ('MetaData "OtherParsed" "Godot.Parser.Resource" "godot-megaparsec-0.2.1.0-EbERUixCJDx7jOrFLshw0V" '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 # | |
| type Rep GdnsParsed Source # | |
Defined in Godot.Parser.Resource type Rep GdnsParsed = D1 ('MetaData "GdnsParsed" "Godot.Parser.Resource" "godot-megaparsec-0.2.1.0-EbERUixCJDx7jOrFLshw0V" '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.1.0-EbERUixCJDx7jOrFLshw0V" '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.