ComputeOffset calculates the 0-based character offset from a 1-based line and 0-based column.
(line, col int32)
| 417 | |
| 418 | // ComputeOffset calculates the 0-based character offset from a 1-based line and 0-based column. |
| 419 | func (s *SourceInfo) ComputeOffset(line, col int32) int32 { |
| 420 | if s != nil { |
| 421 | line = s.baseLine + line |
| 422 | col = s.baseCol + col |
| 423 | } |
| 424 | return s.ComputeOffsetAbsolute(line, col) |
| 425 | } |
| 426 | |
| 427 | // ComputeOffsetAbsolute calculates the 0-based character offset from a 1-based line and 0-based column |
| 428 | // based on the absolute line and column of the SourceInfo. |