I'm working a parser for Protobuf and recently I am working with 
SourceLocationInfo.
I've been noticing something weird when using options. However, I'm not 
sure if my understanding is not complete or if its a bug.

I have the following enum:

enum Test {
option deprecated = true;

TEST_UNSPECIFIED = 0;
}

And I get the following FileDescriptorSet (simplified):

file {
  ...
  source_code_info {
    location {
      span: 0
      span: 0
      span: 4
      span: 1
    }
    location {
      path: 5
      path: 0
      span: 0
      span: 0
      span: 4
      span: 1
    }
    location {
      path: 5
      path: 0
      path: 1
      span: 0
      span: 5
      span: 9
    }
    location {
      path: 5
      path: 0
      path: 3
      span: 1
      span: 8
      span: 33
    }
    location {
      path: 5
      path: 0
      path: 3
      path: 3
      span: 1
      span: 8
      span: 33
    }
    location {
      path: 5
      path: 0
      path: 2
      path: 0
      span: 3
      span: 8
      span: 29
    }
    location {
      path: 5
      path: 0
      path: 2
      path: 0
      path: 1
      span: 3
      span: 8
      span: 24
    }
    location {
      path: 5
      path: 0
      path: 2
      path: 0
      path: 2
      span: 3
      span: 27
      span: 28
    }
  }
}

I'm confused by the ones I wrote in red. These doesn't seem to be correct.
An example is span: 1 span: 8 span: 33. To the best of my knowledge, this 
means
that we have an element at line 1 (2 in an IDE) column 8 (9 in IDE) that 
finishes on the same line (third span omitted) and at column 33. However, 
the option line is only 27 characters long...

Is my mental model about SourceCodeInfo wrong? Or is it a bug?

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/protobuf/671b2d32-d3d9-416e-b6e7-ff03e5140f6bn%40googlegroups.com.

Reply via email to