Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
gargantext-ihaskell
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gargantext
gargantext-ihaskell
Commits
2081c717
Commit
2081c717
authored
Feb 06, 2018
by
Vaibhav Sagar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ghc-parser: update
parent
d4a754b3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
61 additions
and
2 deletions
+61
-2
Parser.hs
ghc-parser/generic-src/Language/Haskell/GHC/Parser.hs
+13
-0
ghc-parser.cabal
ghc-parser/ghc-parser.cabal
+6
-2
HappyParser.hs
ghc-parser/src-8.4/Language/Haskell/GHC/HappyParser.hs
+42
-0
No files found.
ghc-parser/generic-src/Language/Haskell/GHC/Parser.hs
View file @
2081c717
{-# LANGUAGE CPP #-}
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE DeriveFunctor #-}
module
Language.Haskell.GHC.Parser
(
module
Language.Haskell.GHC.Parser
(
-- Parser handling
-- Parser handling
...
@@ -29,7 +30,11 @@ import Data.Char (isAlphaNum)
...
@@ -29,7 +30,11 @@ import Data.Char (isAlphaNum)
import
Bag
import
Bag
import
ErrUtils
hiding
(
ErrMsg
)
import
ErrUtils
hiding
(
ErrMsg
)
import
FastString
import
FastString
#
if
MIN_VERSION_ghc
(
8
,
4
,
0
)
import
GHC
hiding
(
Located
,
Parsed
)
#
else
import
GHC
hiding
(
Located
)
import
GHC
hiding
(
Located
)
#
endif
import
Lexer
import
Lexer
import
OrdList
import
OrdList
import
Outputable
hiding
((
<>
))
import
Outputable
hiding
((
<>
))
...
@@ -89,13 +94,21 @@ runParser flags (Parser parser) str =
...
@@ -89,13 +94,21 @@ runParser flags (Parser parser) str =
toParseOut
$
unP
parser
parseState
toParseOut
$
unP
parser
parseState
where
where
toParseOut
::
ParseResult
a
->
ParseOutput
a
toParseOut
::
ParseResult
a
->
ParseOutput
a
#
if
MIN_VERSION_ghc
(
8
,
4
,
0
)
toParseOut
(
PFailed
_
span
@
(
RealSrcSpan
realSpan
)
err
)
=
#
else
toParseOut
(
PFailed
span
@
(
RealSrcSpan
realSpan
)
err
)
=
toParseOut
(
PFailed
span
@
(
RealSrcSpan
realSpan
)
err
)
=
#
endif
let
errMsg
=
printErrorBag
$
unitBag
$
mkPlainErrMsg
flags
span
err
let
errMsg
=
printErrorBag
$
unitBag
$
mkPlainErrMsg
flags
span
err
line
=
srcLocLine
$
realSrcSpanStart
realSpan
line
=
srcLocLine
$
realSrcSpanStart
realSpan
col
=
srcLocCol
$
realSrcSpanStart
realSpan
col
=
srcLocCol
$
realSrcSpanStart
realSpan
in
Failure
errMsg
$
Loc
line
col
in
Failure
errMsg
$
Loc
line
col
#
if
MIN_VERSION_ghc
(
8
,
4
,
0
)
toParseOut
(
PFailed
_
span
err
)
=
#
else
toParseOut
(
PFailed
span
err
)
=
toParseOut
(
PFailed
span
err
)
=
#
endif
let
errMsg
=
printErrorBag
$
unitBag
$
mkPlainErrMsg
flags
span
err
let
errMsg
=
printErrorBag
$
unitBag
$
mkPlainErrMsg
flags
span
err
in
Failure
errMsg
$
Loc
0
0
in
Failure
errMsg
$
Loc
0
0
...
...
ghc-parser/ghc-parser.cabal
View file @
2081c717
...
@@ -33,7 +33,7 @@ library
...
@@ -33,7 +33,7 @@ library
-- other-modules:
-- other-modules:
-- other-extensions:
-- other-extensions:
build-depends: base >=4.6 && < 5,
build-depends: base >=4.6 && < 5,
ghc >=7.6 && <8.
3
ghc >=7.6 && <8.
5
if impl(ghc >= 7.6) && impl(ghc < 7.8)
if impl(ghc >= 7.6) && impl(ghc < 7.8)
hs-source-dirs: generic-src src-7.6
hs-source-dirs: generic-src src-7.6
...
@@ -47,6 +47,10 @@ library
...
@@ -47,6 +47,10 @@ library
if impl(ghc < 8.0)
if impl(ghc < 8.0)
hs-source-dirs: generic-src src-7.10
hs-source-dirs: generic-src src-7.10
else
else
hs-source-dirs: generic-src src-8.0
if impl(ghc >= 8.0) && impl(ghc < 8.4)
hs-source-dirs: generic-src src-8.0
else
hs-source-dirs: generic-src src-8.4
default-language: Haskell2010
default-language: Haskell2010
ghc-parser/src-8.4/Language/Haskell/GHC/HappyParser.hs
0 → 100644
View file @
2081c717
module
Language.Haskell.GHC.HappyParser
(
fullStatement
,
fullImport
,
fullDeclaration
,
fullExpression
,
fullTypeSignature
,
fullModule
)
where
import
Parser
import
SrcLoc
-- compiler/hsSyn
import
HsSyn
-- compiler/utils
import
OrdList
-- compiler/parser
import
RdrHsSyn
import
Lexer
-- compiler/basicTypes
import
RdrName
fullStatement
::
P
(
Maybe
(
LStmt
GhcPs
(
LHsExpr
GhcPs
)))
fullStatement
=
parseStmt
fullImport
::
P
(
LImportDecl
GhcPs
)
fullImport
=
parseImport
fullDeclaration
::
P
(
OrdList
(
LHsDecl
GhcPs
))
fullDeclaration
=
fmap
unitOL
parseDeclaration
fullExpression
::
P
(
LHsExpr
GhcPs
)
fullExpression
=
parseExpression
fullTypeSignature
::
P
(
Located
(
OrdList
(
LHsDecl
GhcPs
)))
fullTypeSignature
=
fmap
(
noLoc
.
unitOL
)
parseTypeSignature
fullModule
::
P
(
Located
(
HsModule
GhcPs
))
fullModule
=
parseModule
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment