Unify debugging API for parsing and lexing
Fix build warnings in document spec