| Conditions | 4 |
| Total Lines | 34 |
| Lines | 0 |
| Ratio | 0 % |
| 1 | from coalib.misc.Decorators import generate_ordering, generate_repr |
||
| 40 | Returns the position where the text was matched (zero-based). |
||
| 41 | |||
| 42 | :returns: The position. |
||
| 43 | """ |
||
| 44 | return self._position |
||
| 45 | |||
| 46 | @property |
||
| 47 | def end_position(self): |
||
| 48 | """ |
||
| 49 | Marks the end position of the matched text (zero-based). |
||
| 50 | |||
| 51 | :returns: The end-position. |
||
| 52 | """ |
||
| 53 | return len(self) + self.position |
||
| 54 | |||
| 55 | @property |
||
| 56 | def range(self): |
||
| 57 | """ |
||
| 58 | Returns the position range where the text was matched. |
||
| 59 | |||
| 60 | :returns: A pair indicating the position range. The first element is |
||
| 61 | the start position, the second one the end position. |
||
| 62 | """ |
||
| 63 | return (self.position, self.end_position) |
||
| 64 |