JavaScript snippet parser