diff options
author | axel <axel@liljencrantz.se> | 2006-10-07 10:56:25 +1000 |
---|---|---|
committer | axel <axel@liljencrantz.se> | 2006-10-07 10:56:25 +1000 |
commit | 560e53fd5f79be68a81cc4680ab91657e20e3002 (patch) | |
tree | 1807aadd45e70c61de5882dc1ad2f40a67d8a5c8 /tokenizer.h | |
parent | 184d58cd360569fa44aa088dab3421b832313424 (diff) |
Add autoindentation support
darcs-hash:20061007005625-ac50b-11873654797eb1e98fd17893022bdf995be3e2aa.gz
Diffstat (limited to 'tokenizer.h')
-rw-r--r-- | tokenizer.h | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/tokenizer.h b/tokenizer.h index 2a0ad513..bced30e5 100644 --- a/tokenizer.h +++ b/tokenizer.h @@ -29,7 +29,20 @@ enum token_type TOK_BACKGROUND,/**< send job to bg token */ TOK_COMMENT/**< comment token */ } -; + ; + +/** + Tokenizer error types +*/ +enum tokenizer_error +{ + TOK_UNTERMINATED_QUOTE, + TOK_UNTERMINATED_SUBSHELL, + TOK_UNTERMINATED_ESCAPE, + TOK_OTHER +} + ; + /** Flag telling the tokenizer to accept incomplete parameters, @@ -73,6 +86,8 @@ typedef struct int free_orig; /** Type of last quote, can be either ' or ".*/ wchar_t last_quote; + /** Last error */ + int error; } tokenizer; @@ -151,4 +166,10 @@ void tok_set_pos( tokenizer *tok, int pos ); */ const wchar_t *tok_get_desc( int type ); +/** + Get tokenizer error type. Should only be called if tok_last_tope returns TOK_ERROR. +*/ +int tok_get_error( tokenizer *tok ); + + #endif |