Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
H
haddock
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Marcin Szamotulski
haddock
Commits
81c379da
Commit
81c379da
authored
11 years ago
by
Mateusz Kowalczyk
Browse files
Options
Downloads
Patches
Plain Diff
Parse identifiers with ^ and ⋆ in them.
Fixes #298.
parent
99e37051
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
CHANGES
+4
-0
4 additions, 0 deletions
CHANGES
html-test/ref/Bug298.html
+133
-0
133 additions, 0 deletions
html-test/ref/Bug298.html
html-test/src/Bug298.hs
+22
-0
22 additions, 0 deletions
html-test/src/Bug298.hs
src/Haddock/Parser.hs
+9
-1
9 additions, 1 deletion
src/Haddock/Parser.hs
with
168 additions
and
1 deletion
CHANGES
+
4
−
0
View file @
81c379da
Changes in version 2.14.3
* Fix parsing of identifiers with ^ or ⋆ in them (#298)
Changes in version 2.14.2
Changes in version 2.14.2
* Always drop --split-objs GHC flag for performance reasons (#292)
* Always drop --split-objs GHC flag for performance reasons (#292)
...
...
This diff is collapsed.
Click to expand it.
html-test/ref/Bug298.html
0 → 100644
+
133
−
0
View file @
81c379da
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html
xmlns=
"http://www.w3.org/1999/xhtml"
><head
><meta
http-equiv=
"Content-Type"
content=
"text/html; charset=UTF-8"
/><title
>
Bug298
</title
><link
href=
"ocean.css"
rel=
"stylesheet"
type=
"text/css"
title=
"Ocean"
/><script
src=
"haddock-util.js"
type=
"text/javascript"
></script
><script
type=
"text/javascript"
>
//
<!
[
CDATA
[
window
.
onload
=
function
()
{
pageLoad
();
setSynopsis
(
"
mini_Bug298.html
"
);};
//]]>
</script
></head
><body
><div
id=
"package-header"
><ul
class=
"links"
id=
"page-menu"
><li
><a
href=
""
>
Contents
</a
></li
><li
><a
href=
""
>
Index
</a
></li
></ul
><p
class=
"caption empty"
>
</p
></div
><div
id=
"content"
><div
id=
"module-header"
><table
class=
"info"
><tr
><th
>
Safe Haskell
</th
><td
>
Safe-Inferred
</td
></tr
></table
><p
class=
"caption"
>
Bug298
</p
></div
><div
id=
"synopsis"
><p
id=
"control.syn"
class=
"caption expander"
onclick=
"toggleSection('syn')"
>
Synopsis
</p
><ul
id=
"section.syn"
class=
"hide"
onclick=
"toggleSection('syn')"
><li
class=
"src short"
><a
href=
""
>
(
<
^
>
)
</a
>
:: (a -
>
a) -
>
a -
>
a
</li
><li
class=
"src short"
><a
href=
""
>
(
<
^)
</a
>
:: a -
>
a -
>
a
</li
><li
class=
"src short"
><a
href=
""
>
(^
>
)
</a
>
:: a -
>
a -
>
a
</li
><li
class=
"src short"
><a
href=
""
>
(
⋆
^)
</a
>
:: a -
>
a -
>
a
</li
><li
class=
"src short"
><a
href=
""
>
f
</a
>
:: ()
</li
></ul
></div
><div
id=
"interface"
><h1
>
Documentation
</h1
><div
class=
"top"
><p
class=
"src"
><a
name=
"v:-60--94--62-"
class=
"def"
>
(
<
^
>
)
</a
>
:: (a -
>
a) -
>
a -
>
a
</p
></div
><div
class=
"top"
><p
class=
"src"
><a
name=
"v:-60--94-"
class=
"def"
>
(
<
^)
</a
>
:: a -
>
a -
>
a
</p
></div
><div
class=
"top"
><p
class=
"src"
><a
name=
"v:-94--62-"
class=
"def"
>
(^
>
)
</a
>
:: a -
>
a -
>
a
</p
></div
><div
class=
"top"
><p
class=
"src"
><a
name=
"v:-8902--94-"
class=
"def"
>
(
⋆
^)
</a
>
:: a -
>
a -
>
a
</p
></div
><div
class=
"top"
><p
class=
"src"
><a
name=
"v:f"
class=
"def"
>
f
</a
>
:: ()
</p
><div
class=
"doc"
><p
>
Links to
<code
><a
href=
""
>
<
^
>
</a
></code
>
and
<code
><a
href=
""
>
^
>
</a
></code
>
,
<code
><a
href=
""
>
<
^
</a
></code
>
and
<code
><a
href=
""
>
⋆
^
</a
></code
>
.
</p
></div
></div
></div
></div
><div
id=
"footer"
><p
>
Produced by
<a
href=
""
>
Haddock
</a
>
version 2.15.0
</p
></div
></body
></html
>
This diff is collapsed.
Click to expand it.
html-test/src/Bug298.hs
0 → 100644
+
22
−
0
View file @
81c379da
-- We introduced a regression in 2.14.x where we don't consider
-- identifiers with ^ as valid. We test that the regression goes away
-- here. It's a silly typo in the parser, really. Same with ★ which is a valid
-- symbol according to the 2010 report.
module
Bug298
where
(
<^>
)
::
(
a
->
a
)
->
a
->
a
x
<^>
y
=
x
y
(
<^
)
::
a
->
a
->
a
x
<^
y
=
x
(
^>
)
::
a
->
a
->
a
x
^>
y
=
y
(
⋆
^
)
::
a
->
a
->
a
x
⋆
^
y
=
y
-- | Links to '<^>' and '^>', '<^' and '⋆^'.
f
::
()
f
=
()
This diff is collapsed.
Click to expand it.
src/Haddock/Parser.hs
+
9
−
1
View file @
81c379da
...
@@ -419,13 +419,21 @@ autoUrl = mkLink <$> url
...
@@ -419,13 +419,21 @@ autoUrl = mkLink <$> url
-- characters and does no actual validation itself.
-- characters and does no actual validation itself.
parseValid
::
Parser
String
parseValid
::
Parser
String
parseValid
=
do
parseValid
=
do
vs
<-
many'
$
satisfy
(`
elem
`
"_.!#$%&*+/<=>?@
\\
|-~:"
)
<|>
digit
<|>
letter_ascii
vs'
<-
many'
$
utf8String
"⋆"
<|>
return
<$>
idChar
let
vs
=
concat
vs'
c
<-
peekChar
c
<-
peekChar
case
c
of
case
c
of
Just
'`'
->
return
vs
Just
'`'
->
return
vs
Just
'
\'
'
->
(
\
x
->
vs
++
"'"
++
x
)
<$>
(
"'"
*>
parseValid
)
Just
'
\'
'
->
(
\
x
->
vs
++
"'"
++
x
)
<$>
(
"'"
*>
parseValid
)
<|>
return
vs
<|>
return
vs
_
->
fail
"outofvalid"
_
->
fail
"outofvalid"
where
idChar
=
satisfy
(`
elem
`
"_.!#$%&*+/<=>?@
\\
|-~:^"
)
<|>
digit
<|>
letter_ascii
-- | Parses UTF8 strings from ByteString streams.
utf8String
::
String
->
Parser
String
utf8String
x
=
decodeUtf8
<$>
string
(
encodeUtf8
x
)
-- | Parses identifiers with help of 'parseValid'. Asks GHC for 'RdrName' from the
-- | Parses identifiers with help of 'parseValid'. Asks GHC for 'RdrName' from the
-- string it deems valid.
-- string it deems valid.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment