CommentParser: replace map method with for loop