marcusaram / snakeyaml

Automatically exported from code.google.com/p/snakeyaml
Apache License 2.0
1 stars 0 forks source link

Line numbers reported in Exceptions are Zero based, should be 1 based #24

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
In files, counting lines for poor folks looking at files, starts at 1 and
not zero.

The column count seems to be correct with starting at 1.

Original issue reported on code.google.com by shr...@gmail.com on 29 Sep 2009 at 4:44

GoogleCodeExporter commented 9 years ago
It seems to occur when processing an error in the midst of a mapping parse.

Original comment by shr...@gmail.com on 29 Sep 2009 at 5:56

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
May I ask you to provide a test to see the problem ?
(what is the YAML document? What is the code you parse with?)

Original comment by py4fun@gmail.com on 29 Sep 2009 at 8:43

GoogleCodeExporter commented 9 years ago
Sorry.  I was getting off by one line errors all the time I thought it was 
obvious.

I have been playing with yaml to see what is possible and getting into cases 
where
inside a mapping, I do something wrong.  I have them.  I experiment again to 
find
another.

For example, replacing the : after peppery to , makes it possible to get past 
the
error.  Indicating the error is on the wrong line.  

expected ',' or '}', but got :
line 3, column 11

- options:
  - pop : &tasty {
    banana: coconut
    peppery: salty
    }

  - &toppings
    peanut: almond
    berry: cream

  - &yummny
    <<: *tasty
    others:
      <<: *toppings
      toast: cinamon
      berry: jam

Original comment by shr...@gmail.com on 29 Sep 2009 at 9:32

GoogleCodeExporter commented 9 years ago
Another mistake makes interesting claims of line numbers.

- options:
  - pop : &tasty
    banana: coconut
    peppery: salty

  - &toppings
    peanut: almond
    berry: cream

  - &yummny
    <<: *tasty
    others:
      <<: *toppings
      toast: cinamon
      berry: jam

Original comment by shr...@gmail.com on 29 Sep 2009 at 9:34

GoogleCodeExporter commented 9 years ago

Original comment by py4fun@gmail.com on 8 Oct 2009 at 8:14

GoogleCodeExporter commented 9 years ago

Original comment by py4fun@gmail.com on 12 Oct 2009 at 8:44