diff options
author | axel <axel@liljencrantz.se> | 2006-07-20 23:02:46 +1000 |
---|---|---|
committer | axel <axel@liljencrantz.se> | 2006-07-20 23:02:46 +1000 |
commit | 5c8d9bd13c82c66fcb0b15d2844359dc3c306d96 (patch) | |
tree | 26624c5003f1467b4411b453c775e8b229de3223 /expand.h | |
parent | 1c9a173b3dbb2f89658ad26cc6ede6fe9afed706 (diff) |
Minor duplicate code removal
darcs-hash:20060720130246-ac50b-b41daebb302e1cbadf2a4cf812d936edbda85926.gz
Diffstat (limited to 'expand.h')
-rw-r--r-- | expand.h | 33 |
1 files changed, 13 insertions, 20 deletions
@@ -113,26 +113,6 @@ enum #define ARRAY_SEP_STR L"\x1e" /** - Error issued on invalid variable name -*/ -#define COMPLETE_VAR_DESC _( L"The '$' character begins a variable name. The character '%lc', which directly followed a '$', is not allowed as a part of a variable name, and variable names may not be zero characters long. To learn more about variable expansion in fish, type 'help expand-variable'.") - -/** - Error issued on invalid variable name -*/ -#define COMPLETE_VAR_NULL_DESC _( L"The '$' begins a variable name. It was given at the end of an argument. Variable names may not be zero characters long. To learn more about variable expansion in fish, type 'help expand-variable'.") - -/** - Error issued on invalid variable name -*/ -#define COMPLETE_VAR_BRACKET_DESC _( L"Did you mean {$VARIABLE}? The '$' character begins a variable name. A bracket, which directly followed a '$', is not allowed as a part of a variable name, and variable names may not be zero characters long. To learn more about variable expansion in fish, type 'help expand-variable'." ) - -/** - Error issued on invalid variable name -*/ -#define COMPLETE_VAR_PARAN_DESC _( L"Did you mean (COMMAND)? In fish, the '$' character is only used for accessing variables. To learn more about command substitution in fish, type 'help expand-command-substitution'.") - -/** Error issued on array out of bounds */ #define ARRAY_BOUNDS_ERR _(L"Array index out of bounds") @@ -207,4 +187,17 @@ wchar_t *expand_tilde(wchar_t *in); */ int expand_is_clean( const wchar_t *in ); +/** + Perform error reporting for a syntax error related to the variable + expansion beginning at the specified character of the specified + token. This function will call the error function with an + explanatory string about what is wrong with the specified token. + + \param token The token containing the error + \param token_pos The position where the expansion begins + \param error_pos The position on the line to report to the error function. +*/ +void expand_variable_error( const wchar_t *token, int token_pos, int error_pos ); + + #endif |