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

Safe HaskellNone
LanguageHaskell98

Puppet.Parser

Contents

Description

Parse puppet source code from text.

Synopsis

Runner

runPuppetParser :: String -> Text -> Either PuppetParseError (Vector Statement) #

Run a puppet parser against some Text input.

Parsers

puppetParser :: Parser (Vector Statement) #

Parse a collection of puppet Statement.

prettyParseError :: Text -> ParseError Char Void -> PrettyError #

Build a PrettyError from a ParseError given the text source. The source is used to display the line on which the error occurs.

exposed to ease testing

Pretty Print

ppStatements :: Vector Statement -> Doc #

Pretty print a series of statements.

Expressions

data Expression #

Instances
IsList Expression # 
Instance details

Defined in Puppet.Parser.Types

Associated Types

type Item Expression :: * #

Eq Expression # 
Instance details

Defined in Puppet.Parser.Types

Fractional Expression # 
Instance details

Defined in Puppet.Parser.Types

Num Expression # 
Instance details

Defined in Puppet.Parser.Types

Show Expression # 
Instance details

Defined in Puppet.Parser.Types

IsString Expression # 
Instance details

Defined in Puppet.Parser.Types

Pretty Expression # 
Instance details

Defined in Puppet.Parser.PrettyPrinter

type Item Expression # 
Instance details

Defined in Puppet.Parser.Types

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 
UDataType UDataType 

data LambdaFunc #

High Order lambdas.

Instances
Eq LambdaFunc # 
Instance details

Defined in Puppet.Parser.Types

Show LambdaFunc # 
Instance details

Defined in Puppet.Parser.Types

Pretty LambdaFunc # 
Instance details

Defined in Puppet.Parser.PrettyPrinter

data LambdaParameters #

Lambda block parameters:

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

data CompRegex #

Constructors

CompRegex !Text !Regex 
Instances
Eq CompRegex # 
Instance details

Defined in Puppet.Language.Core

Show CompRegex # 
Instance details

Defined in Puppet.Language.Core

ToJSON CompRegex # 
Instance details

Defined in Puppet.Language.Core

FromJSON CompRegex # 
Instance details

Defined in Puppet.Language.Core

Pretty CompRegex # 
Instance details

Defined in Puppet.Language.Core

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 realized in the catalog.

Instances
Eq Virtuality # 
Instance details

Defined in Puppet.Language.Resource

Show Virtuality # 
Instance details

Defined in Puppet.Language.Resource

data NodeDesc #

Instances
Eq NodeDesc # 
Instance details

Defined in Puppet.Parser.Types

Show NodeDesc # 
Instance details

Defined in Puppet.Parser.Types

Pretty NodeDesc # 
Instance details

Defined in Puppet.Parser.PrettyPrinter

Methods

pretty :: NodeDesc -> Doc #

prettyList :: [NodeDesc] -> Doc #

data LinkType #

Relationship/ordering between resources.

Constructors

RRequire

Applies a resource after the target resource.

RBefore

Applies a resource before the target resource.

RNotify

Applies a resource before the target resource. The target resource refreshes if the notifying resource changes.

RSubscribe

Applies a resource after the target resource. The subscribing resource refreshes if the target resource changes.

Instances
Eq LinkType # 
Instance details

Defined in Puppet.Language.Resource

Show LinkType # 
Instance details

Defined in Puppet.Language.Resource

Generic LinkType # 
Instance details

Defined in Puppet.Language.Resource

Associated Types

type Rep LinkType :: * -> * #

Methods

from :: LinkType -> Rep LinkType x #

to :: Rep LinkType x -> LinkType #

Hashable LinkType # 
Instance details

Defined in Puppet.Language.Resource

Methods

hashWithSalt :: Int -> LinkType -> Int #

hash :: LinkType -> Int #

ToJSON LinkType # 
Instance details

Defined in Puppet.Language.Resource

FromJSON LinkType # 
Instance details

Defined in Puppet.Language.Resource

Pretty LinkType # 
Instance details

Defined in Puppet.Language.Resource

Methods

pretty :: LinkType -> Doc #

prettyList :: [LinkType] -> Doc #

type Rep LinkType # 
Instance details

Defined in Puppet.Language.Resource

type Rep LinkType = D1 (MetaData "LinkType" "Puppet.Language.Resource" "language-puppet-1.3.19-6UDNik9BeMl8D41nYcdUxM" False) ((C1 (MetaCons "RRequire" PrefixI False) (U1 :: * -> *) :+: C1 (MetaCons "RBefore" PrefixI False) (U1 :: * -> *)) :+: (C1 (MetaCons "RNotify" PrefixI False) (U1 :: * -> *) :+: C1 (MetaCons "RSubscribe" PrefixI False) (U1 :: * -> *)))

Datatypes

Search Expressions

Declaration

data ArrowOp #

Constructors

AppendArrow

+>

AssignArrow

`=>`

Instances
Eq ArrowOp # 
Instance details

Defined in Puppet.Parser.Types

Methods

(==) :: ArrowOp -> ArrowOp -> Bool #

(/=) :: ArrowOp -> ArrowOp -> Bool #

Show ArrowOp # 
Instance details

Defined in Puppet.Parser.Types

Pretty ArrowOp # 
Instance details

Defined in Puppet.Parser.PrettyPrinter

Methods

pretty :: ArrowOp -> Doc #

prettyList :: [ArrowOp] -> Doc #

data ConditionalDecl #

All types of conditional statements : case, if, ...

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 ClassDecl #

Instances
Eq ClassDecl # 
Instance details

Defined in Puppet.Parser.Types

Show ClassDecl # 
Instance details

Defined in Puppet.Parser.Types

data ResDefaultDecl #

Resource default:

 File { mode => 755 }

puppet reference.

data DepDecl #

Instances
Eq DepDecl # 
Instance details

Defined in Puppet.Parser.Types

Methods

(==) :: DepDecl -> DepDecl -> Bool #

(/=) :: DepDecl -> DepDecl -> Bool #

Show DepDecl # 
Instance details

Defined in Puppet.Parser.Types

data ResDecl #

Resource declaration:

 file { mode => 755}
Instances
Eq ResDecl # 
Instance details

Defined in Puppet.Parser.Types

Methods

(==) :: ResDecl -> ResDecl -> Bool #

(/=) :: ResDecl -> ResDecl -> Bool #

Show ResDecl # 
Instance details

Defined in Puppet.Parser.Types

data ResOverrideDecl #

Resource override:

 File[title] { mode => 755}

See puppet reference.

data DefineDecl #

Instances
Eq DefineDecl # 
Instance details

Defined in Puppet.Parser.Types

Show DefineDecl # 
Instance details

Defined in Puppet.Parser.Types

data NodeDecl #

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

Instances
Eq NodeDecl # 
Instance details

Defined in Puppet.Parser.Types

Show NodeDecl # 
Instance details

Defined in Puppet.Parser.Types

data VarAssignDecl #

 $newvar = world

data ResCollDecl #

Resource Collector including exported collector (`<<| |>>`)

 User <| title == jenkins |> { groups +> "docker"}

See puppet reference

Instances
Eq ResCollDecl # 
Instance details

Defined in Puppet.Parser.Types

Show ResCollDecl # 
Instance details

Defined in Puppet.Parser.Types

Prism for Statements

Prism for Expressions