Initial work towards rewriting detect_errors to use new parser.

Low-level tests currently pass; high level tests fail.
This commit is contained in:
ridiculousfish
2013-12-11 18:34:28 -08:00
parent 383b6aabf5
commit d5d9b9284a
7 changed files with 316 additions and 28 deletions

View File

@@ -420,7 +420,7 @@ class parser_t
\param p The character offset at which the error occured
\param str The printf-style error message filter
*/
void error(int ec, int p, const wchar_t *str, ...);
void error(int ec, size_t p, const wchar_t *str, ...);
/**
Returns a string describing the current parser pisition in the format 'FILENAME (line LINE_NUMBER): LINE'.
@@ -488,6 +488,7 @@ class parser_t
\param prefix the prefix string to prepend to each error message written to the \c out buffer
*/
parser_test_error_bits_t detect_errors(const wchar_t * buff, wcstring *out = NULL, const wchar_t *prefix = NULL);
parser_test_error_bits_t detect_errors2(const wchar_t * buff, wcstring *out = NULL, const wchar_t *prefix = NULL);
/**
Test if the specified string can be parsed as an argument list,
@@ -524,7 +525,7 @@ class parser_t
\param s the string to test
\param min_match is the minimum number of characters that must match in a long style option, i.e. the longest common prefix between --help and any other option. If less than 3, 3 will be assumed.
*/
int is_help(const wchar_t *s, int min_match) const;
static int is_help(const wchar_t *s, int min_match);
/**
Returns the file currently evaluated by the parser. This can be