screp-0.1.0.0: grep-like CLI using Parsec parsers instead of regex
Safe HaskellSafe-Inferred
LanguageHaskell2010

Scrappy.Grep.DSL

Synopsis

Documentation

data ParserExpr Source #

AST representation of the parsec-grep DSL

Instances

Instances details
Generic ParserExpr Source # 
Instance details

Defined in Scrappy.Grep.DSL

Associated Types

type Rep ParserExpr 
Instance details

Defined in Scrappy.Grep.DSL

type Rep ParserExpr = D1 ('MetaData "ParserExpr" "Scrappy.Grep.DSL" "screp-0.1.0.0-GFQWpPufVrK2mJv5Te6tFS" 'False) ((((C1 ('MetaCons "PChar" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Char)) :+: C1 ('MetaCons "PString" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String))) :+: (C1 ('MetaCons "PAnyChar" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "PDigit" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "PLetter" 'PrefixI 'False) (U1 :: Type -> Type)))) :+: ((C1 ('MetaCons "PAlphaNum" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "PSpace" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "PSpaces" 'PrefixI 'False) (U1 :: Type -> Type))) :+: (C1 ('MetaCons "PNewline" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "POneOf" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String)) :+: C1 ('MetaCons "PNoneOf" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String)))))) :+: (((C1 ('MetaCons "PSeq" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ParserExpr) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ParserExpr)) :+: C1 ('MetaCons "PSeqConcat" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ParserExpr) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ParserExpr))) :+: (C1 ('MetaCons "PAlt" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ParserExpr) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ParserExpr)) :+: (C1 ('MetaCons "PMany" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ParserExpr)) :+: C1 ('MetaCons "PSome" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ParserExpr))))) :+: ((C1 ('MetaCons "POptional" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ParserExpr)) :+: (C1 ('MetaCons "PTry" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ParserExpr)) :+: C1 ('MetaCons "PBetween" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Char) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Char) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ParserExpr))))) :+: (C1 ('MetaCons "PCount" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ParserExpr)) :+: (C1 ('MetaCons "PManyTill" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ParserExpr) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ParserExpr)) :+: C1 ('MetaCons "PRef" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String)))))))
Show ParserExpr Source # 
Instance details

Defined in Scrappy.Grep.DSL

Eq ParserExpr Source # 
Instance details

Defined in Scrappy.Grep.DSL

type Rep ParserExpr Source # 
Instance details

Defined in Scrappy.Grep.DSL

type Rep ParserExpr = D1 ('MetaData "ParserExpr" "Scrappy.Grep.DSL" "screp-0.1.0.0-GFQWpPufVrK2mJv5Te6tFS" 'False) ((((C1 ('MetaCons "PChar" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Char)) :+: C1 ('MetaCons "PString" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String))) :+: (C1 ('MetaCons "PAnyChar" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "PDigit" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "PLetter" 'PrefixI 'False) (U1 :: Type -> Type)))) :+: ((C1 ('MetaCons "PAlphaNum" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "PSpace" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "PSpaces" 'PrefixI 'False) (U1 :: Type -> Type))) :+: (C1 ('MetaCons "PNewline" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "POneOf" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String)) :+: C1 ('MetaCons "PNoneOf" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String)))))) :+: (((C1 ('MetaCons "PSeq" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ParserExpr) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ParserExpr)) :+: C1 ('MetaCons "PSeqConcat" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ParserExpr) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ParserExpr))) :+: (C1 ('MetaCons "PAlt" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ParserExpr) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ParserExpr)) :+: (C1 ('MetaCons "PMany" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ParserExpr)) :+: C1 ('MetaCons "PSome" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ParserExpr))))) :+: ((C1 ('MetaCons "POptional" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ParserExpr)) :+: (C1 ('MetaCons "PTry" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ParserExpr)) :+: C1 ('MetaCons "PBetween" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Char) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Char) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ParserExpr))))) :+: (C1 ('MetaCons "PCount" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ParserExpr)) :+: (C1 ('MetaCons "PManyTill" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ParserExpr) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ParserExpr)) :+: C1 ('MetaCons "PRef" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String)))))))

data MatchResult Source #

A match result with position information

Constructors

MatchResult 

Instances

Instances details
Generic MatchResult Source # 
Instance details

Defined in Scrappy.Grep.DSL

Associated Types

type Rep MatchResult 
Instance details

Defined in Scrappy.Grep.DSL

type Rep MatchResult = D1 ('MetaData "MatchResult" "Scrappy.Grep.DSL" "screp-0.1.0.0-GFQWpPufVrK2mJv5Te6tFS" 'False) (C1 ('MetaCons "MatchResult" 'PrefixI 'True) ((S1 ('MetaSel ('Just "mrFilePath") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FilePath) :*: S1 ('MetaSel ('Just "mrLine") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int)) :*: (S1 ('MetaSel ('Just "mrCol") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int) :*: S1 ('MetaSel ('Just "mrMatchText") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String))))
Show MatchResult Source # 
Instance details

Defined in Scrappy.Grep.DSL

Eq MatchResult Source # 
Instance details

Defined in Scrappy.Grep.DSL

type Rep MatchResult Source # 
Instance details

Defined in Scrappy.Grep.DSL

type Rep MatchResult = D1 ('MetaData "MatchResult" "Scrappy.Grep.DSL" "screp-0.1.0.0-GFQWpPufVrK2mJv5Te6tFS" 'False) (C1 ('MetaCons "MatchResult" 'PrefixI 'True) ((S1 ('MetaSel ('Just "mrFilePath") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FilePath) :*: S1 ('MetaSel ('Just "mrLine") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int)) :*: (S1 ('MetaSel ('Just "mrCol") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int) :*: S1 ('MetaSel ('Just "mrMatchText") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String))))

containsRef :: ParserExpr -> Bool Source #

Check if a ParserExpr contains any PRef nodes

extractRefs :: ParserExpr -> [String] Source #

Extract all ref names from a ParserExpr