more robust GASMS parser