Original Ruby parser ported to pure JavaScript