This looks suspicious. This is the only place where we set currentLocation but we read it in two places in ParseTreeMapWriter and ParseTreeWriter. They need to be updated too.