[jira] [Commented] (CSV-84) Clarify comment handling

2012-03-27 Thread Sebb (Commented) (JIRA)

[ 
https://issues.apache.org/jira/browse/CSV-84?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13240074#comment-13240074
 ] 

Sebb commented on CSV-84:
-

OK, so we should only allow comments at the start of a record.

This may be a bit tricky to achieve, as the lexer knows about tokens, not 
records.

 Clarify comment handling
 

 Key: CSV-84
 URL: https://issues.apache.org/jira/browse/CSV-84
 Project: Commons CSV
  Issue Type: Improvement
Reporter: Sebb
 Fix For: 1.0


 Comment handling is not currently fully documented / tested.
 There are several possible situations:
 1) trailing comment following one or more values
 2) comment marker starts in the first column
 3) comment marker starts in the first non-whitespace column
 How should these be handled?
 1) The trailing comment should be ignored
 2) Entire line should be ignored, i.e. don't treat it as a blank line
 3) This is trickier: if whitespace is being trimmed, treat as 2, else treat 
 as 1, i.e. there is a single value containing whitespace
 It might also be useful to consider returning comments to the application 
 program as part of CSVRecord.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira




[jira] [Commented] (CSV-84) Clarify comment handling

2012-03-27 Thread Sebb (Commented) (JIRA)

[ 
https://issues.apache.org/jira/browse/CSV-84?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13240089#comment-13240089
 ] 

Sebb commented on CSV-84:
-

bq. This case is not covered by the tests,

In fact - as I discovered when I tried to fix the code - it is tested.
The test CSVParserTest.testDefaultFormat() includes the CSV source:

{code}
a,b\n
\n, \n
,#\n
{code}

Note that the comment follows the empty quoted value.

However, I think this is mistake.

 Clarify comment handling
 

 Key: CSV-84
 URL: https://issues.apache.org/jira/browse/CSV-84
 Project: Commons CSV
  Issue Type: Improvement
Reporter: Sebb
 Fix For: 1.0


 Comment handling is not currently fully documented / tested.
 There are several possible situations:
 1) trailing comment following one or more values
 2) comment marker starts in the first column
 3) comment marker starts in the first non-whitespace column
 How should these be handled?
 1) The trailing comment should be ignored
 2) Entire line should be ignored, i.e. don't treat it as a blank line
 3) This is trickier: if whitespace is being trimmed, treat as 2, else treat 
 as 1, i.e. there is a single value containing whitespace
 It might also be useful to consider returning comments to the application 
 program as part of CSVRecord.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira