Copyright | Copyright 2011-2017 Neil Mitchell |
---|---|
License | BSD3 |
Maintainer | opensource@awakesecurity.com |
Stability | experimental |
Safe Haskell | None |
Language | Haskell2010 |
Lexing is a slow point, the code below is optimised.
Since: 0.1.0
- type Parser m a = ParsecT Dec Text m a
- type Ann = Spans
- data Lexeme ann
- data LName ann = MkLName {
- _lnameAnn :: !ann
- _lnameBS :: !ByteString
- newtype LFile ann = MkLFile {
- _lfileExpr :: Expr ann
- data LBind ann = MkLBind {
- _lbindAnn :: !ann
- _lbindName :: !(LName ann)
- _lbindValue :: !(Expr ann)
- data LBuild ann = MkLBuild {
- _lbuildAnn :: !ann
- _lbuildOuts :: ![Expr ann]
- _lbuildRule :: !(LName ann)
- _lbuildDeps :: ![Expr ann]
- makeLBuild :: forall ann. ann -> [Expr ann] -> LName ann -> [Expr ann] -> LBuild ann
- type LexemeConstraint c ann = (LBindConstraint c ann, LFileConstraint c ann, LBuildConstraint c ann, LNameConstraint c ann, c [Expr ann], c ann)
- type LNameConstraint c ann = (c Text, c ann)
- type LFileConstraint c ann = (c Text, c ann)
- type LBindConstraint c ann = (c Text, c ann)
- type LBuildConstraint c ann = (c Text, c ann)
- class Monad m => PositionParsing m where
- spanned :: PositionParsing m => m a -> m (Spans, a)
Type aliases
Lexeme
and friends
Lex each line separately, rather than each lexeme.
Since: 0.1.0
LexDefine !ann !(LBind ann) | foo = bar Since: 0.1.0 |
LexBind !ann !(LBind ann) | [indent]foo = bar Since: 0.1.0 |
LexInclude !ann !(LFile ann) | include file Since: 0.1.0 |
LexSubninja !ann !(LFile ann) | subninja file Since: 0.1.0 |
LexBuild !ann !(LBuild ann) | build foo: bar | baz || qux Since: 0.1.0 |
LexRule !ann !(LName ann) | rule name Since: 0.1.0 |
LexPool !ann !(LName ann) | pool name Since: 0.1.0 |
LexDefault !ann ![Expr ann] | default foo bar Since: 0.1.0 |
Functor Lexeme Source # | |
Foldable Lexeme Source # | |
Traversable Lexeme Source # | |
Annotated Lexeme Source # | The usual definition for Since: 0.1.0 |
(Monad m, LexemeConstraint (Serial m) ann) => Serial m (Lexeme ann) Source # | Default Since: 0.1.0 |
(Monad m, LexemeConstraint (CoSerial m) ann) => CoSerial m (Lexeme ann) Source # | Default Since: 0.1.0 |
Eq ann => Eq (Lexeme ann) Source # | |
Show ann => Show (Lexeme ann) Source # | |
Generic (Lexeme ann) Source # | |
Hashable ann => Hashable (Lexeme ann) Source # | Default Since: 0.1.0 |
ToJSON ann => ToJSON (Lexeme ann) Source # | Converts to Since: 0.1.0 |
FromJSON ann => FromJSON (Lexeme ann) Source # | Inverse of the Since: 0.1.0 |
NFData ann => NFData (Lexeme ann) Source # | Default Since: 0.1.0 |
type Rep (Lexeme ann) Source # | |
The name of a Ninja rule or pool.
Since: 0.1.0
MkLName | |
|
Functor LName Source # | |
Foldable LName Source # | |
Traversable LName Source # | |
Annotated LName Source # | The usual definition for Since: 0.1.0 |
(Monad m, LNameConstraint (Serial m) ann) => Serial m (LName ann) Source # | Uses the underlying Since: 0.1.0 |
(Monad m, LNameConstraint (CoSerial m) ann) => CoSerial m (LName ann) Source # | Default Since: 0.1.0 |
Eq ann => Eq (LName ann) Source # | |
Show ann => Show (LName ann) Source # | |
Generic (LName ann) Source # | |
Hashable ann => Hashable (LName ann) Source # | Default Since: 0.1.0 |
ToJSON ann => ToJSON (LName ann) Source # | Converts to Since: 0.1.0 |
FromJSON ann => FromJSON (LName ann) Source # | Inverse of the Since: 0.1.0 |
NFData ann => NFData (LName ann) Source # | Default Since: 0.1.0 |
type Rep (LName ann) Source # | |
A reference to a file in an include
or subninja
declaration.
Since: 0.1.0
MkLFile | |
|
Functor LFile Source # | |
Foldable LFile Source # | |
Traversable LFile Source # | |
(Monad m, LFileConstraint (Serial m) ann) => Serial m (LFile ann) Source # | Default Since: 0.1.0 |
(Monad m, LFileConstraint (CoSerial m) ann) => CoSerial m (LFile ann) Source # | Default Since: 0.1.0 |
Eq ann => Eq (LFile ann) Source # | |
Show ann => Show (LFile ann) Source # | |
Generic (LFile ann) Source # | |
Hashable ann => Hashable (LFile ann) Source # | Default Since: 0.1.0 |
ToJSON ann => ToJSON (LFile ann) Source # | Converts to Since: 0.1.0 |
FromJSON ann => FromJSON (LFile ann) Source # | Inverse of the Since: 0.1.0 |
NFData ann => NFData (LFile ann) Source # | Default Since: 0.1.0 |
type Rep (LFile ann) Source # | |
A Ninja variable binding, top-level or otherwise.
Since: 0.1.0
MkLBind | |
|
Functor LBind Source # | |
Foldable LBind Source # | |
Traversable LBind Source # | |
(Monad m, LBindConstraint (Serial m) ann) => Serial m (LBind ann) Source # | Default Since: 0.1.0 |
(Monad m, LBindConstraint (CoSerial m) ann) => CoSerial m (LBind ann) Source # | Default Since: 0.1.0 |
Eq ann => Eq (LBind ann) Source # | |
Show ann => Show (LBind ann) Source # | |
Generic (LBind ann) Source # | |
Hashable ann => Hashable (LBind ann) Source # | Default Since: 0.1.0 |
ToJSON ann => ToJSON (LBind ann) Source # | Converts to Since: 0.1.0 |
FromJSON ann => FromJSON (LBind ann) Source # | Inverse of the Since: 0.1.0 |
NFData ann => NFData (LBind ann) Source # | Default Since: 0.1.0 |
type Rep (LBind ann) Source # | |
The data contained within a Ninja build
declaration.
Since: 0.1.0
MkLBuild | |
|
Functor LBuild Source # | |
Foldable LBuild Source # | |
Traversable LBuild Source # | |
Annotated LBuild Source # | The usual definition for Since: 0.1.0 |
(Monad m, LBuildConstraint (Serial m) ann) => Serial m (LBuild ann) Source # | Uses the underlying Since: 0.1.0 |
(Monad m, LBuildConstraint (CoSerial m) ann) => CoSerial m (LBuild ann) Source # | Default Since: 0.1.0 |
Eq ann => Eq (LBuild ann) Source # | |
Show ann => Show (LBuild ann) Source # | |
Generic (LBuild ann) Source # | |
Hashable ann => Hashable (LBuild ann) Source # | Default Since: 0.1.0 |
ToJSON ann => ToJSON (LBuild ann) Source # | Converts to Since: 0.1.0 |
FromJSON ann => FromJSON (LBuild ann) Source # | Inverse of the Since: 0.1.0 |
NFData ann => NFData (LBuild ann) Source # | Default Since: 0.1.0 |
type Rep (LBuild ann) Source # | |
:: ann | The build annotation |
-> [Expr ann] | The build outputs |
-> LName ann | The rule name |
-> [Expr ann] | The build dependencies |
-> LBuild ann |
Constructor for an LBuild
.
Since: 0.1.0
type LexemeConstraint c ann = (LBindConstraint c ann, LFileConstraint c ann, LBuildConstraint c ann, LNameConstraint c ann, c [Expr ann], c ann) Source #
The set of constraints required for a given constraint to be automatically
computed for an Lexeme
.
Since: 0.1.0
type LNameConstraint c ann = (c Text, c ann) Source #
The set of constraints required for a given constraint to be automatically
computed for an LName
.
Since: 0.1.0
type LFileConstraint c ann = (c Text, c ann) Source #
The set of constraints required for a given constraint to be automatically
computed for an LFile
.
Since: 0.1.0
type LBindConstraint c ann = (c Text, c ann) Source #
The set of constraints required for a given constraint to be automatically
computed for an LBind
.
Since: 0.1.0
type LBuildConstraint c ann = (c Text, c ann) Source #
The set of constraints required for a given constraint to be automatically
computed for an LBuild
.
Since: 0.1.0
PositionParsing
class Monad m => PositionParsing m where Source #
This class is kind of like DeltaParsing
from trifecta
.
Since: 0.1.0
getPosition :: m Position Source #
spanned :: PositionParsing m => m a -> m (Spans, a) Source #
Surround a section of parsers in getPosition
calls and return the
associated Spans
. Note that if a call of this function wraps over
a parser that somehow goes over multiple files, it will fail
.
Since: 0.1.0