()
| 80 | } |
| 81 | } |
| 82 | func (e *ParseError) ToProto() *opl.ParseError { |
| 83 | start := e.toSrcPos(e.item.Start) |
| 84 | end := e.toSrcPos(e.item.End) |
| 85 | return &opl.ParseError{ |
| 86 | Message: e.msg, |
| 87 | Start: &opl.SourcePosition{ |
| 88 | Line: clampUint32(start.Line), |
| 89 | Column: clampUint32(start.Col), |
| 90 | }, |
| 91 | End: &opl.SourcePosition{ |
| 92 | Line: clampUint32(end.Line), |
| 93 | Column: clampUint32(end.Col), |
| 94 | }, |
| 95 | } |
| 96 | } |
| 97 | |
| 98 | // toSrcPos converts the given position in the input to a Line and column |
| 99 | // number. |
nothing calls this directly
no test coverage detected