(refactor) updated parser to handle comment whitespace