swap if/else into switch/case in Parser.prototype.parse in Parse.js