/* Name of output file, for error messages. */
static char *out_fname;
-/* Zero means dollar signs are punctuation.
- -$ stores 0; -traditional may store 1. Default is 1 for VMS, 0 otherwise.
- This must be 0 for correct processing of this ANSI C program:
- #define foo(a) #a
- #define lose(b) foo (b)
- #define test$
- lose (test) */
-static int dollars_in_ident;
-#ifndef DOLLARS_IN_IDENTIFIERS
-#define DOLLARS_IN_IDENTIFIERS 1
-#endif
-
/* Stack of conditionals currently in progress
(including both successful and failing conditionals). */
in_fname = NULL;
out_fname = NULL;
- /* Initialize is_idchar to allow $. */
- dollars_in_ident = 1;
+ /* Initialize is_idchar. */
initialize_char_syntax ();
- dollars_in_ident = DOLLARS_IN_IDENTIFIERS > 0;
no_line_directives = 0;
no_trigraphs = 1;
if (!strcmp (argv[i], "-traditional")) {
traditional = 1;
cplusplus_comments = 0;
- if (dollars_in_ident > 0)
- dollars_in_ident = 1;
} else if (!strcmp (argv[i], "-trigraphs")) {
no_trigraphs = 0;
}
break;
case '$': /* Don't include $ in identifiers. */
- dollars_in_ident = 0;
+ is_idchar['$'] = is_idstart['$'] = 0;
break;
case 'I': /* Add directory to path for includes. */
if (cp && ! no_standard_includes)
path_include (cp);
- /* Now that dollars_in_ident is known, initialize is_idchar. */
- initialize_char_syntax ();
-
/* Initialize output buffer */
outbuf.buf = (U_CHAR *) xmalloc (OUTBUF_SIZE);
break;
case '$':
- if (!dollars_in_ident)
+ if (! is_idchar['$'])
goto randomchar;
+ if (pedantic)
+ pedwarn ("`$' in identifier");
goto letter;
case '0': case '1': case '2': case '3': case '4':
is_idchar[i] = 1;
is_idchar['_'] = 1;
is_idstart['_'] = 1;
- is_idchar['$'] = dollars_in_ident;
- is_idstart['$'] = dollars_in_ident;
+ is_idchar['$'] = 1;
+ is_idstart['$'] = 1;
/* horizontal space table */
is_hor_space[' '] = 1;