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

Hackage trac at galois.com
Sat Jan 24 10:27:22 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         |     Keywords:           
Difficulty:  unknown        |   Ghcversion:           
  Platform:                 |  
----------------------------+-----------------------------------------------
 It confuses people that in `.cabal` files, comments can only appear on
 lines on their own, and not at the end of other lines.

 We should consider relaxing this as long as it can be done in a backwards
 compatible way.

 The only thing to worry about is command line flags like:
 {{{
   cc-options: --some-flag
 }}}

 If we required a space after the `--` that might be sufficient. There are
 some tools that interpret `--` on its own as an argument, but usually only
 as a separator between flag arguments and non-flag arguments and we do not
 expect those to be given in .cabal files.

 We might like to allow `--` within quotes eg `"--"` however that's also
 not easy because of the syntax and format of .cabal files. They have no
 consistent lexical syntax, each field is parsed separately. The overall
 structure is parsed based on layout without parsing individual fields. In
 particular .cabal files are not tokenised.

 The second issue is easier. The original specification required that blank
 lines within a field include a leading `.` character. This applies to
 multi-paragraph descriptions. This syntax is totally unnecessary. The
 parser could cope fine without it. We should accept the convention for
 backwards compatibility but also allow ordinary blank lines. Multiple
 blank lines within a field should still be collapsed to one, and trailing
 blank lines within a field should be trimmed.

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


More information about the cabal-devel mailing list