language-puppet-1.3.8.1: Tools to parse and evaluate the Puppet DSL.

Safe HaskellNone
LanguageHaskell98

Puppet.Parser.Types

Contents

Description

All the types used for parsing, and helpers working on these types.

Synopsis

Position management

type Position = SourcePos #

Position in a puppet file. Currently an alias to SourcePos.

type PPosition = Pair Position Position #

A pair containing the start and end of a given token.

initialPPos :: Text -> PPosition #

Generates an initial position based on a filename.

toPPos :: Text -> Int -> PPosition #

Generates a PPosition based on a filename and line number.

Lenses

Helpers

capitalizeRT :: Text -> Text #

Properly capitalizes resource types

Types

Expressions

data Expression #

data UnresolvedValue #

An unresolved value, typically the parser's output.

Constructors

UBoolean !Bool

Special tokens generated when parsing the true or false literals.

UString !Text

Raw string.

UInterpolable !(Vector Expression)

A string that might contain variable references. The type should be refined at one point.

UUndef

Special token that is generated when parsing the undef literal.

UResourceReference !Text !Expression

A Resource[reference]

UArray !(Vector Expression) 
UHash !(Vector (Pair Expression Expression)) 
URegexp !CompRegex

The regular expression compilation is performed during parsing.

UVariableReference !Text 
UFunctionCall !Text !(Vector Expression) 
UHOLambdaCall !HOLambdaCall 
UNumber !Scientific 

data LambdaParameters #

Lambda block parameters: Currently only two types of block parameters are supported: single values and pairs.

Constructors

BPSingle !Text
|k|
BPPair !Text !Text
|k,v|

data Virtuality #

Constructors

Normal

Normal resource, that will be included in the catalog

Virtual

Type for virtual resources

Exported

Type for exported resources

ExportedRealized

These are resources that are exported AND included in the catalogderiving (Generic, Eq, Show)

data LinkType #

Relationship link type.

Instances

Eq LinkType # 
Show LinkType # 
Generic LinkType # 

Associated Types

type Rep LinkType :: * -> * #

Methods

from :: LinkType -> Rep LinkType x #

to :: Rep LinkType x -> LinkType #

Hashable LinkType # 

Methods

hashWithSalt :: Int -> LinkType -> Int #

hash :: LinkType -> Int #

ToJSON LinkType # 
FromJSON LinkType # 
type Rep LinkType # 
type Rep LinkType = D1 (MetaData "LinkType" "Puppet.Parser.Types" "language-puppet-1.3.8.1-8QqTcwoaqzC7L0SDySpOdh" False) ((:+:) ((:+:) (C1 (MetaCons "RNotify" PrefixI False) U1) (C1 (MetaCons "RRequire" PrefixI False) U1)) ((:+:) (C1 (MetaCons "RBefore" PrefixI False) U1) (C1 (MetaCons "RSubscribe" PrefixI False) U1)))

Datatypes

Search Expressions

Statements

data ArrowOp #

Constructors

AppendArrow

+>

AssignArrow

`=>`

Instances

data ConditionalDecl #

All types of conditional statements (case, if, etc.) are stored as an ordered list of pair (condition, statements) (interpreted as "if first cond is true, choose first statements, else take the next pair, check the condition ...")

data ResDecl #

Resource declaration: e.g `file { mode => 755}`

Instances

data NodeDecl #

A node is a collection of statements + maybe an inherit node