Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failing tests for the identifier parser #815

Closed
wants to merge 2 commits into from

Conversation

sjakobi
Copy link
Member

@sjakobi sjakobi commented May 8, 2018

While extending the identifier parser identifier parser tests I found the following test cases that I thought should pass.

If someone can confirm that they should pass, I'll try to fix the parser.

@@ -86,6 +86,9 @@ spec = do
it "parses identifiers enclosed within backticks" $ do
"`foo`" `shouldParseTo` DocIdentifier "foo"

it "doesn't parse a composed function as an identifier" $ do
"'foo.bar'" `shouldParseTo` "'foo.bar'"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks potentially problematic: qualified identifiers should still be identified as DocIdentifier, no?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But this is not a valid and qualified haskell identifier, right?

"``infix``" `shouldParseTo` "`" <> DocIdentifier "infix" <> "`"

it "can parse identifiers in infix notation enclosed within single quotes" $ do
"'`infix`'" `shouldParseTo` "`" <> DocIdentifier "infix" <> "`"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is the most problematic of all of these test failures, as exactly this syntax is described http://haskell-haddock.readthedocs.io/en/latest/markup.html#hyperlinked-identifiers.

Here's the test output:

   expected: DocAppend (DocString "`") (DocAppend (DocIdentifier "infix") (DocString "`"))
    but got: DocAppend (DocString "'") (DocAppend (DocIdentifier "infix") (DocString "'"))

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just saw that this has been reported in #780.

@sjakobi
Copy link
Member Author

sjakobi commented Jul 20, 2018

I should add a test for #848 here.

@harpocrates
Copy link
Collaborator

@sjakobi It would be nice to rebase this onto the 8.8 branch. I'm pretty sure almost all of these would now pass (except perhaps 'foo.bar' - but even fixing that should be now be pretty easy).

If you want to wait until after 8.8 is released, that's OK too (building all the deps is a pain...).

@Kleidukos
Copy link
Member

Hi, thank you for this PR, but Haddock now lives full-time in the GHC repository!
Read more at https://discourse.haskell.org/t/haddock-now-lives-in-the-ghc-repository/9576.

Let me know if you feel it is still needed, and I'll migrate it. :)

@Kleidukos Kleidukos closed this May 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants