diff --git a/docs/sly.rst b/docs/sly.rst index 8ee47a0..4a2affe 100644 --- a/docs/sly.rst +++ b/docs/sly.rst @@ -301,13 +301,11 @@ column information as a separate step. For instance, you can search backwards until you reach the previous newline:: # Compute column. - # input is the input text string + # text is the input text string # token is a token instance def find_column(text, token): last_cr = text.rfind('\n', 0, token.index) - if last_cr < 0: - last_cr = 0 - column = (token.index - last_cr) + 1 + column = token.index - last_cr return column Since column information is often only useful in the context of error