(cls, msg, doc, line, col)
| 30 | # RUSTPYTHON SPECIFIC |
| 31 | @classmethod |
| 32 | def _from_serde(cls, msg, doc, line, col): |
| 33 | pos = 0 |
| 34 | # 0-indexed |
| 35 | line -= 1 |
| 36 | col -= 1 |
| 37 | while line > 0: |
| 38 | i = doc.index('\n', pos) |
| 39 | line -= 1 |
| 40 | pos = i |
| 41 | pos += col |
| 42 | return cls(msg, doc, pos) |
| 43 | |
| 44 | # Note that this exception is used from _json |
| 45 | def __init__(self, msg, doc, pos): |