elm / parser

A parsing library, focused on simplicity and great error messages
https://package.elm-lang.org/packages/elm/parser/latest
BSD 3-Clause "New" or "Revised" License
230 stars 46 forks source link

Fix comment in `findSubString` #37

Open Janiczek opened 5 years ago

Janiczek commented 5 years ago

This comment isn't in line with what the code actually does, and given code can't lie but comments can, the place to fix is probably the comment.

See findSubString - the newOffset + smallString.length means the target is pointed at the end of the found substring, not at its beginning.

--    v = newOffset
  "Is 42 the answer?"
--      ^ = newOffset + smallString.length
-- 1234567...