[Hackage] #478: allow comments on any line, don't require '.' for blank lines

Hackage trac at galois.com
Sat Dec 19 18:55:04 EST 2009


#478: allow comments on any line, don't require '.' for blank lines
----------------------------+-----------------------------------------------
  Reporter:  duncan         |        Owner:           
      Type:  enhancement    |       Status:  new      
  Priority:  normal         |    Milestone:  Cabal-1.8
 Component:  Cabal library  |      Version:  1.6.0.1  
  Severity:  normal         |   Resolution:           
  Keywords:                 |   Difficulty:  unknown  
Ghcversion:                 |     Platform:           
----------------------------+-----------------------------------------------
Comment (by duncan):

 Replying to [comment:2 creswick]:
 > The error output for this could at least mention that comments aren't
 allowed at the end of lines.

 This is tricky because we do not know they are there.

 > There is also an inconsistency in the syntax for build-depends and some
 other lists (eg: extra-source-files).  Comments at the end of a line in an
 extra-source-files list do not cause a parse error, yet they do when added
 to the end of a line in a build-depends list.

 It's not actually inconsistent. Remember that "-- blah" in a field is
 considered as part of the field. So for build-depends, that does not
 parse, but it's perfectly ok to have a source file called "--" and "blah".
 Of course it will fail when trying to sdist because the files do not
 exist.

 > In my opinion, the simplest solution is to require that -- be escaped.
 (eg: \-\-, or \-- ) when it is not used as a comment delimiter.

 That's fairly ugly and will not reduce confusion because people will not
 know that they can or should use that syntax.

 As I mention in the original description, I think the thing to do is to
 consider whether allowing "-- " as the start of a comment could possibly
 cause problems in fields like ghc-options, since "--" is a valid value to
 pass to a program.

-- 
Ticket URL: <http://hackage.haskell.org/trac/hackage/ticket/478#comment:3>
Hackage <http://haskell.org/cabal/>
Hackage: Cabal and related projects


More information about the cabal-devel mailing list