summaryrefslogtreecommitdiff
path: root/gcc/cpphash.h
diff options
context:
space:
mode:
authorNeil Booth <neilb@earthling.net>2000-07-09 09:19:44 +0000
committerNeil Booth <neil@gcc.gnu.org>2000-07-09 09:19:44 +0000
commit91fcd1584b47b95f35043b1ac1c4f8ca92a6e16f (patch)
treeda206aace0d455cab3fa91f129af3841c667f84d /gcc/cpphash.h
parent8514e31898f206915bbae2970285b1f35cd192ad (diff)
downloadgcc-91fcd1584b47b95f35043b1ac1c4f8ca92a6e16f.tar.gz
cpphash.h: ISvspace, is_vspace, is_nvspace: New.
* cpphash.h: ISvspace, is_vspace, is_nvspace: New. IShspace, ISspace: Update. * cppinit.c: ISTABLE: Update. V: New. * cpplex.c (IS_HSPACE, S_NEWLINE): Remove. (IS_DIRECTIVE): Rename KNOWN_DIRECTIVE. (skip_block_comment, skip_line_comment, parse_string, lex_line): Use is_vspace rather than IS_NEWLINE. (skip_whitespace, lex_line): Clean up to use is_nvspace. (lex_line): Use KNOWN_DIRECTIVE. Any kind of directive gets a BOL flag. (lex_next): Unconditionally stop if within a directive. Treat directives within macro invocations as directives (after parse_args emits error), not as the argument. * testsuite/gcc.dg/cpp/directiv.c: New tests. * testsuite/gcc.dg/cpp/undef1.c: Update. From-SVN: r34933
Diffstat (limited to 'gcc/cpphash.h')
-rw-r--r--gcc/cpphash.h13
1 files changed, 10 insertions, 3 deletions
diff --git a/gcc/cpphash.h b/gcc/cpphash.h
index 22481639a67..5cfd5a335f0 100644
--- a/gcc/cpphash.h
+++ b/gcc/cpphash.h
@@ -141,12 +141,17 @@ struct spec_nodes
/* Character classes.
If the definition of `numchar' looks odd to you, please look up the
- definition of a pp-number in the C standard [section 6.4.8 of C99] */
+ definition of a pp-number in the C standard [section 6.4.8 of C99].
+
+ In the unlikely event that characters other than \r and \n enter
+ the set is_vspace, the macro handle_newline() in cpplex.c must be
+ updated. */
#define ISidnum 0x01 /* a-zA-Z0-9_ */
#define ISidstart 0x02 /* _a-zA-Z */
#define ISnumstart 0x04 /* 0-9 */
-#define IShspace 0x08 /* ' ' \t \f \v */
-#define ISspace 0x10 /* ' ' \t \f \v \n */
+#define IShspace 0x08 /* ' ' \t */
+#define ISvspace 0x10 /* \r \n */
+#define ISspace 0x20 /* ' ' \t \r \n \f \v \0 */
#define _dollar_ok(x) ((x) == '$' && CPP_OPTION (pfile, dollars_in_ident))
@@ -155,6 +160,8 @@ struct spec_nodes
#define is_numchar(x) (_cpp_IStable[x] & ISidnum)
#define is_numstart(x) (_cpp_IStable[x] & ISnumstart)
#define is_hspace(x) (_cpp_IStable[x] & IShspace)
+#define is_vspace(x) (_cpp_IStable[x] & ISvspace)
+#define is_nvspace(x) ((_cpp_IStable[x] & (ISspace | ISvspace)) == ISspace)
#define is_space(x) (_cpp_IStable[x] & ISspace)
/* This table is constant if it can be initialized at compile time,