script/lexer: properly calculate source_range in `scan`

Fix off-by-one error when calculating offsets in `scan`.