doc(lexer): explain the use of incSourceColumn

I think it is clearer to phrase it this way so it is clear that we are
not unconsuming (i.e. changing the state of the parser).
This commit is contained in:
Primrose 2025-09-24 21:21:59 +08:00
parent 75c4817166
commit 6c0b4a4288
Signed by: primrose
GPG key ID: 4E887A4CA9714ADA

View file

@ -221,7 +221,7 @@ link :: Lexer
link = do link = do
pos <- getPosition pos <- getPosition
l <- linkRaw l <- linkRaw
-- "unconsume" the last token -- register the position of the last token
pos' <- flip incSourceColumn (-1) <$> getPosition pos' <- flip incSourceColumn (-1) <$> getPosition
pure $ (pos, LinkOpen) : l <> [(pos', LinkClose)] pure $ (pos, LinkOpen) : l <> [(pos', LinkClose)]