makefile-0.1.0.2: Simple Makefile parser

Safe HaskellNone
LanguageHaskell2010

Data.Makefile.Parse.Internal

Synopsis

Documentation

>>> :set -XOverloadedStrings

parseMakefile :: IO (Either String Makefile) Source #

Parse makefile.

Tries to open and parse a file name Makefile in the current directory.

parseAsMakefile :: FilePath -> IO (Either String Makefile) Source #

Parse the specified file as a makefile.

makefile :: Parser Makefile Source #

Parser for a makefile

entry :: Parser Entry Source #

Parser for a makefile entry (either a rule or a variable assignment)

assignment :: Parser Entry Source #

Parser of variable assignment

rule :: Parser Entry Source #

Parser for an entire rule

command :: Parser Command Source #

Parser for a command

target :: Parser Target Source #

Parser for a (rule) target

dependency :: Parser Dependency Source #

Parser for a (rule) dependency

lazyVar :: Parser ByteString Source #

Parser for variable name in declaration (lazy set, var = x)

>>> Atto.parseOnly lazyVar "CFLAGS=-c -Wall"
Right "CFLAGS"

immVar :: Parser ByteString Source #

Parser for variable name in declaration (immediate set, var := x)

>>> Atto.parseOnly immVar "CFLAGS:=-c -Wall"
Right "CFLAGS"

comment :: Parser ByteString Source #

Parser for a comment (the comment starts with the hashtag)

>>> Atto.parseOnly comment "# I AM A COMMENT"
Right " I AM A COMMENT"

nextLine :: Parser () Source #

Consume a newline character ('\n')

emptyLine :: Parser () Source #

Consume an empty line (potentially containing spaces and/or tabs).

>>> Atto.parseOnly emptyLine "\t\t   \t   \t\n"
Right ()