fix(parser, formatter): check for valid input in default parser and default formatter