godot-megaparsec-0.2.1.0: Megaparsec parser for Godot `tscn` and `gdns` files.
Copyright(c) Winston Hartnett 2021
LicenseGPL-3
Maintainerwhartnett@gmail.com
Stabilityexperimental
PortabilityPOSIX
Safe HaskellSafe-Inferred
LanguageHaskell2010

Godot.Parser.Resource

Description

A parser for Godot resource file formats. Currently only supports auto-generated tscn and gdns files.

Synopsis

Documentation

data GodotValue Source #

Values parsed from a Tscn file.

Constructors are `(constructor name, constructor args)`.

Instances

Instances details
Eq GodotValue Source # 
Instance details

Defined in Godot.Parser.Resource

Show GodotValue Source # 
Instance details

Defined in Godot.Parser.Resource

Generic GodotValue Source # 
Instance details

Defined in Godot.Parser.Resource

Associated Types

type Rep GodotValue :: Type -> Type #

type Rep GodotValue Source # 
Instance details

Defined in Godot.Parser.Resource

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

ExtResourceSection 
SubResourceSection 
NodeSection 

Fields

ConnectionSection 
ResourceSection 
OtherSection 

Instances

Instances details
Show GodotSection Source # 
Instance details

Defined in Godot.Parser.Resource

Generic GodotSection Source # 
Instance details

Defined in Godot.Parser.Resource

Associated Types

type Rep GodotSection :: Type -> Type #

type Rep GodotSection Source # 
Instance details

Defined in Godot.Parser.Resource

type Rep GodotSection = D1 ('MetaData "GodotSection" "Godot.Parser.Resource" "godot-megaparsec-0.2.1.0-EbERUixCJDx7jOrFLshw0V" 'False) ((C1 ('MetaCons "ExtResourceSection" 'PrefixI 'True) ((S1 ('MetaSel ('Just "_extResourceSectionPath") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Just "_extResourceSectionTy") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)) :*: (S1 ('MetaSel ('Just "_extResourceSectionId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int) :*: (S1 ('MetaSel ('Just "_extResourceSectionHeaders") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (HashMap Text GodotValue)) :*: S1 ('MetaSel ('Just "_extResourceSectionEntries") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (HashMap Text GodotValue))))) :+: (C1 ('MetaCons "SubResourceSection" 'PrefixI 'True) ((S1 ('MetaSel ('Just "_subResourceSectionTy") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Just "_subResourceSectionId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int)) :*: (S1 ('MetaSel ('Just "_subResourceSectionHeaders") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (HashMap Text GodotValue)) :*: S1 ('MetaSel ('Just "_subResourceSectionEntries") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (HashMap Text GodotValue)))) :+: C1 ('MetaCons "NodeSection" 'PrefixI 'True) (((S1 ('MetaSel ('Just "_nodeSectionTy") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "_nodeSectionName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)) :*: (S1 ('MetaSel ('Just "_nodeSectionParent") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Text)) :*: (S1 ('MetaSel ('Just "_nodeSectionInst") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Int)) :*: S1 ('MetaSel ('Just "_nodeSectionInstPlaceholder") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Text))))) :*: ((S1 ('MetaSel ('Just "_nodeSectionOwner") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "_nodeSectionIndex") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Int))) :*: (S1 ('MetaSel ('Just "_nodeSectionGroups") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe [Text])) :*: (S1 ('MetaSel ('Just "_nodeSectionHeaders") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (HashMap Text GodotValue)) :*: S1 ('MetaSel ('Just "_nodeSectionEntries") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (HashMap Text GodotValue)))))))) :+: (C1 ('MetaCons "ConnectionSection" 'PrefixI 'True) ((S1 ('MetaSel ('Just "_connectionSectionSignal") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: (S1 ('MetaSel ('Just "_connectionSectionFrom") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Just "_connectionSectionTo") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text))) :*: (S1 ('MetaSel ('Just "_connectionSectionMethod") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: (S1 ('MetaSel ('Just "_connectionSectionHeaders") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (HashMap Text GodotValue)) :*: S1 ('MetaSel ('Just "_connectionSectionEntries") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (HashMap Text GodotValue))))) :+: (C1 ('MetaCons "ResourceSection" 'PrefixI 'True) (S1 ('MetaSel ('Just "_resourceSectionResourceName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Text)) :*: (S1 ('MetaSel ('Just "_resourceSectionClassName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "_resourceSectionLibrary") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe (Text, [GodotValue]))))) :+: C1 ('MetaCons "OtherSection" 'PrefixI 'True) (S1 ('MetaSel ('Just "_otherSectionHeader") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: (S1 ('MetaSel ('Just "_otherSectionHeaders") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (HashMap Text GodotValue)) :*: S1 ('MetaSel ('Just "_otherSectionEntries") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (HashMap Text GodotValue)))))))

data TscnDescriptor Source #

tscn file descriptor.

Instances

Instances details
Show TscnDescriptor Source # 
Instance details

Defined in Godot.Parser.Resource

Generic TscnDescriptor Source # 
Instance details

Defined in Godot.Parser.Resource

Associated Types

type Rep TscnDescriptor :: Type -> Type #

type Rep TscnDescriptor Source # 
Instance details

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.

Instances

Instances details
Show TscnParsed Source # 
Instance details

Defined in Godot.Parser.Resource

Generic TscnParsed Source # 
Instance details

Defined in Godot.Parser.Resource

Associated Types

type Rep TscnParsed :: Type -> Type #

type Rep TscnParsed Source # 
Instance details

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.

Instances

Instances details
Show OtherDescriptor Source # 
Instance details

Defined in Godot.Parser.Resource

Generic OtherDescriptor Source # 
Instance details

Defined in Godot.Parser.Resource

Associated Types

type Rep OtherDescriptor :: Type -> Type #

type Rep OtherDescriptor Source # 
Instance details

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.

Instances

Instances details
Show OtherParsed Source # 
Instance details

Defined in Godot.Parser.Resource

Generic OtherParsed Source # 
Instance details

Defined in Godot.Parser.Resource

Associated Types

type Rep OtherParsed :: Type -> Type #

type Rep OtherParsed Source # 
Instance details

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.

Instances

Instances details
Show GdnsDescriptor Source # 
Instance details

Defined in Godot.Parser.Resource

Generic GdnsDescriptor Source # 
Instance details

Defined in Godot.Parser.Resource

Associated Types

type Rep GdnsDescriptor :: Type -> Type #

type Rep GdnsDescriptor Source # 
Instance details

Defined in Godot.Parser.Resource

type Rep GdnsDescriptor = D1 ('MetaData "GdnsDescriptor" "Godot.Parser.Resource" "godot-megaparsec-0.2.1.0-EbERUixCJDx7jOrFLshw0V" '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

Instances details
Show GdnsParsed Source # 
Instance details

Defined in Godot.Parser.Resource

Generic GdnsParsed Source # 
Instance details

Defined in Godot.Parser.Resource

Associated Types

type Rep GdnsParsed :: Type -> Type #

type Rep GdnsParsed Source # 
Instance details

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.

Instances

Instances details
Show GodotParsed Source # 
Instance details

Defined in Godot.Parser.Resource

Generic GodotParsed Source # 
Instance details

Defined in Godot.Parser.Resource

Associated Types

type Rep GodotParsed :: Type -> Type #

type Rep GodotParsed Source # 
Instance details

Defined in Godot.Parser.Resource

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.