diff options
author | Neil Booth <neilb@earthling.net> | 2000-05-18 11:09:27 +0000 |
---|---|---|
committer | Neil Booth <neil@gcc.gnu.org> | 2000-05-18 11:09:27 +0000 |
commit | 6ab3e7dde0bb5e0ebae56b7182b049c6a3626955 (patch) | |
tree | 183a804a4d784ff0a4492f7cc32f7ac45a78527e /gcc/cpplib.h | |
parent | fc5b21380eee9b33e07a59dbdb91c05cfe18a3cf (diff) | |
download | gcc-6ab3e7dde0bb5e0ebae56b7182b049c6a3626955.zip gcc-6ab3e7dde0bb5e0ebae56b7182b049c6a3626955.tar.gz gcc-6ab3e7dde0bb5e0ebae56b7182b049c6a3626955.tar.bz2 |
cppinit.c (cpp_reader_init): Initialise col_adjust and default tab stop size.
* cppinit.c (cpp_reader_init): Initialise col_adjust and
default tab stop size.
(no_num, OPT_ftabstop): New.
(handle_option): Handle "ftabstop=" command-line option.
(print_help): Document it.
* cpplex.c (COLUMN): Remove.
(handle_newline): Reset col_adjust.
(skip_whitespace): Update col_adjust as tabs encountered.
(_cpp_lex_line): Update to use col_adjust. Call
skip_whitespace for all whitespace.
* cpplib.h (struct cpp_options): New member tabstop.
(struct cpp_reader): New member col_adjust.
(CPP_BUF_COL): Update.
(CPP_BUF_COLUMN): New.
* cpp.texi: Document "-ftabstop=" command line option.
From-SVN: r33982
Diffstat (limited to 'gcc/cpplib.h')
-rw-r--r-- | gcc/cpplib.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/gcc/cpplib.h b/gcc/cpplib.h index a538887..a46ada3 100644 --- a/gcc/cpplib.h +++ b/gcc/cpplib.h @@ -302,6 +302,9 @@ struct cpp_options const char *in_fname; const char *out_fname; + /* Characters between tab stops. */ + unsigned int tabstop; + /* Pending options - -D, -U, -A, -I, -ixxx. */ struct cpp_pending *pending; @@ -510,6 +513,9 @@ struct cpp_reader struct if_stack *if_stack; const unsigned char *potential_control_macro; + /* Token column position adjustment owing to tabs in whitespace. */ + unsigned int col_adjust; + /* Buffer of -M output. */ struct deps *deps; @@ -586,7 +592,8 @@ struct cpp_printer #define CPP_OPTION(PFILE, OPTION) ((PFILE)->opts.OPTION) #define CPP_BUFFER(PFILE) ((PFILE)->buffer) #define CPP_BUF_LINE(BUF) ((BUF)->lineno) -#define CPP_BUF_COL(BUF) ((BUF)->cur - (BUF)->line_base) +#define CPP_BUF_COLUMN(BUF, CUR) ((CUR) - (BUF)->line_base + pfile->col_adjust) +#define CPP_BUF_COL(BUF) CPP_BUF_COLUMN(BUF, (BUF)->cur) /* Name under which this program was invoked. */ extern const char *progname; |