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

Safe HaskellNone

Puppet.Parser.Types

Contents

Description

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

Synopsis

Position management

type Position = SourcePosSource

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

type PPosition = Pair Position PositionSource

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

initialPPos :: Text -> PPositionSource

Generates an initial position based on a filename.

toPPos :: Text -> Int -> PPositionSource

Generates a PPosition based on a filename and line number.

Lenses

Helpers

capitalizeRT :: Text -> TextSource

Properly capitalizes resource types

array :: [Expression] -> UValueSource

A helper function for writing arrays.

toBool :: UValue -> BoolSource

Tries to turn an unresolved value into a Bool without any context.

Types

Expressions

data UValue Source

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 UValue)

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 !Text !Regex

The regular expression compilation is performed during parsing.

UVariableReference !Text 
UFunctionCall !Text !(Vector Expression) 
UHFunctionCall !HFunctionCall 

Instances

data HigherFuncType Source

The distinct Puppet higher order functions

data BlockParameters Source

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

Constructors

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

data Virtuality Source

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 catalog

Search Expressions

Statements

data Statement Source

All the possible statements