Opened 3 years ago

Closed 3 years ago

#10277 closed bug (fixed)

ApiAnnotations : lexer discards comment close in nested comment

Reported by: alanz Owned by: alanz
Priority: normal Milestone: 7.10.2
Component: Compiler (Parser) Version: 7.10.1
Keywords: ApiAnnotations Cc: mpickering
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s): Phab:D829
Wiki Page:

Description

When parsing a nested comment, such as

{-
  {-  nested comment  -}
  {-# nested pragma  #-}
-}

The lexer returns the comment annotation as

{-
  {-  nested comment  
  {-# nested pragma  #
-}

Restore the missing comment end markers in the annotation.

Change History (4)

comment:1 Changed 3 years ago by alanz

Differential Rev(s): Phab:D829

comment:2 Changed 3 years ago by alanz

Status: newpatch

comment:3 Changed 3 years ago by Austin Seipp <austin@…>

In 5fded20c51ae61770f909351c851aaca3d3e331c/ghc:

ApiAnnotations : lexer discards comment close in nested comment

When parsing a nested comment, such as

{-
  {-  nested comment  -}
  {-# nested pragma  #-}
-}

The lexer returns the comment annotation as

{-
  {-  nested comment
  {-# nested pragma  #
-}

Restore the missing comment end markers in the annotation.

Reviewed By: austin

Differential Revision: https://phabricator.haskell.org/D829

GHC Trac Issues: #10277

comment:4 Changed 3 years ago by thoughtpolice

Resolution: fixed
Status: patchclosed

Merged to ghc-7.10.

Note: See TracTickets for help on using tickets.