Commit 3a753101 authored by Unknown's avatar Unknown
Browse files

Merge remote-tracking branch 'origin/master' into NoForeign

parents c40d834c 3c527530
......@@ -15,8 +15,8 @@ module Curry.Syntax
( module Curry.Syntax.Type
, module Curry.Syntax.Utils
, L.Token (..), L.Category (..), L.Attributes (..)
, unlit, unlitLexSource, unlitParseHeader, unlitParseModule
, lexSource, parseInterface, parseHeader, parseModule, parseGoal
, unlit, unlitLexSource, unlitParseHeader, unlitParsePragmas, unlitParseModule
, lexSource, parseInterface, parseHeader, parsePragmas, parseModule, parseGoal
, ppModule, ppInterface, ppIDecl
, showModule
) where
......@@ -42,6 +42,10 @@ unlit = U.unlit
unlitLexSource :: FilePath -> String -> CYM [(Span, L.Token)]
unlitLexSource fn src = U.unlit fn src >>= L.lexSource fn
-- |Unliterate and parse only pragmas of a Curry 'Module'
unlitParsePragmas :: FilePath -> String -> CYM (Module ())
unlitParsePragmas fn src = U.unlit fn src >>= P.parsePragmas fn
-- |Unliterate and parse a Curry 'Module' header
unlitParseHeader :: FilePath -> String -> CYM (Module ())
unlitParseHeader fn src = U.unlit fn src >>= P.parseHeader fn
......@@ -59,6 +63,10 @@ lexSource = L.lexSource
parseInterface :: FilePath -> String -> CYM Interface
parseInterface = P.parseInterface
-- |Parse only pragmas of a Curry 'Module'
parsePragmas :: FilePath -> String -> CYM (Module ())
parsePragmas = P.parsePragmas
-- |Parse a Curry 'Module' header
parseHeader :: FilePath -> String -> CYM (Module ())
parseHeader = P.parseHeader
......
......@@ -4,7 +4,7 @@
Copyright : (c) 1999 - 2004 Wolfgang Lux
2005 Martin Engelke
2011 - 2015 Björn Peemöller
2016 Finn Teegen
2016 - 2017 Finn Teegen
License : BSD-3-clause
Maintainer : bjp@informatik.uni-kiel.de
......@@ -15,7 +15,7 @@
combinators implemented in 'Curry.Base.LLParseComb'.
-}
module Curry.Syntax.Parser
( parseSource, parseHeader, parseInterface, parseGoal
( parseSource, parseHeader, parsePragmas, parseInterface, parseGoal
) where
import Curry.Base.Ident
......@@ -32,6 +32,12 @@ parseSource :: FilePath -> String -> CYM (Module ())
parseSource fn
= fullParser (uncurry <$> moduleHeader <*> layout moduleDecls) lexer fn
-- |Parse only pragmas of a 'Module'
parsePragmas :: FilePath -> String -> CYM (Module ())
parsePragmas
= prefixParser ((\ps -> Module ps mainMIdent Nothing [] []) <$> modulePragmas)
lexer
-- |Parse a 'Module' header
parseHeader :: FilePath -> String -> CYM (Module ())
parseHeader
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment