Merge create_document() function into parse() in ffi-parse.lua