ComputeOffset calculates the 0-based character offset from a 1-based line and 0-based column.
(line, col int32)
| 409 | |
| 410 | // ComputeOffset calculates the 0-based character offset from a 1-based line and 0-based column. |
| 411 | func (s *SourceInfo) ComputeOffset(line, col int32) int32 { |
| 412 | if s != nil { |
| 413 | line = s.baseLine + line |
| 414 | col = s.baseCol + col |
| 415 | } |
| 416 | return s.ComputeOffsetAbsolute(line, col) |
| 417 | } |
| 418 | |
| 419 | // ComputeOffsetAbsolute calculates the 0-based character offset from a 1-based line and 0-based column |
| 420 | // based on the absolute line and column of the SourceInfo. |