Fix redundancy in parser.py

Provided function for removing comments used