* gettext-tools/src/x-awk.c (SE_QUOTES): Renamed from P7_QUOTES.
(get_string_element): Renamed from phase7_getc.
(x_awk_lex): Update.
* gettext-tools/src/x-c.c (SE_EOF): Renamed from P7_EOF.
(SE_QUOTES): Renamed from P7_QUOTES.
(SE_QUOTE): Renamed from P7_QUOTE.
(SE_NEWLINE): Renamed from P7_NEWLINE.
(get_string_element): Renamed from phase7_getc.
(unget_string_element): Renamed from phase7_ungetc.
(phase5_get): Update.
* gettext-tools/src/x-vala.c (SE_EOF): Renamed from P7_EOF.
(SE_QUOTES): Renamed from P7_QUOTES.
(SE_QUOTE): Renamed from P7_QUOTE.
(SE_NEWLINE): Renamed from P7_NEWLINE.
(get_string_element): Renamed from phase7_getc.
(unget_string_element): Renamed from phase7_ungetc.
(phase3_get): Update.
* gettext-tools/src/x-ycp.c (SE_QUOTES): Renamed from P7_QUOTES.
(get_string_element): Renamed from phase7_getc.
(phase5_get): Update.
};
-/* 7. Replace escape sequences within character strings with their
+/* Replace escape sequences within character strings with their
single character equivalents. */
-#define P7_QUOTES (1000 + '"')
+#define SE_QUOTES (1000 + '"')
static int
-phase7_getc ()
+get_string_element ()
{
int c;
if (c == EOF || c == '\n')
break;
if (c == '"')
- return P7_QUOTES;
+ return SE_QUOTES;
if (c != '\\')
return c;
c = phase1_getc ();
if_error (IF_SEVERITY_WARNING,
logical_file_name, line_number, (size_t)(-1), false,
_("unterminated string"));
- return P7_QUOTES;
+ return SE_QUOTES;
}
bufpos = 0;
for (;;)
{
- c = phase7_getc ();
- if (c == EOF || c == P7_QUOTES)
+ c = get_string_element ();
+ if (c == EOF || c == SE_QUOTES)
break;
if (bufpos >= bufmax)
{
};
-/* 7. Replace escape sequences within character strings with their
+/* Replace escape sequences within character strings with their
single character equivalents. This is called from phase 5, because
we don't have to worry about the #include argument. There are
pathological cases which could bite us (like the DOS directory
separator), but just pretend it can't happen. */
-/* Return value of phase7_getc when EOF is reached. */
-#define P7_EOF (-1)
+/* Return value of get_string_element when EOF is reached. */
+#define SE_EOF (-1)
/* Replace escape sequences within character strings with their single
character equivalents. */
-#define P7_QUOTES (-3)
-#define P7_QUOTE (-4)
-#define P7_NEWLINE (-5)
+#define SE_QUOTES (-3)
+#define SE_QUOTE (-4)
+#define SE_NEWLINE (-5)
/* Convert an UTF-16 or UTF-32 code point to a return value that can be
distinguished from a single-byte return value. */
static int
-phase7_getc ()
+get_string_element ()
{
int c, j;
c = phase3_getc ();
if (c == EOF)
- return P7_EOF;
+ return SE_EOF;
/* Return a magic newline indicator, so that we can distinguish
between the user requesting a newline in the string (e.g. using
you may not embed newlines in character constants; try it, you get
a useful diagnostic. --PMiller */
if (c == '\n')
- return P7_NEWLINE;
+ return SE_NEWLINE;
if (c == '"')
- return P7_QUOTES;
+ return SE_QUOTES;
if (c == '\'')
- return P7_QUOTE;
+ return SE_QUOTE;
if (c != '\\')
return c;
c = phase3_getc ();
static void
-phase7_ungetc (int c)
+unget_string_element (int c)
{
phase3_ungetc (c);
}
remember the character constant. */
for (;;)
{
- c = phase7_getc ();
- if (c == P7_NEWLINE)
+ c = get_string_element ();
+ if (c == SE_NEWLINE)
{
if_error (IF_SEVERITY_WARNING,
logical_file_name, line_number - 1, (size_t)(-1), false,
_("unterminated character constant"));
- phase7_ungetc ('\n');
+ unget_string_element ('\n');
break;
}
- if (c == P7_EOF || c == P7_QUOTE)
+ if (c == SE_EOF || c == SE_QUOTE)
break;
}
tp->type = token_type_character_constant;
for (;;)
{
- c = phase7_getc ();
+ c = get_string_element ();
/* Keep line_number in sync. */
msb.line_number = line_number;
- if (c == P7_NEWLINE)
+ if (c == SE_NEWLINE)
{
if_error (IF_SEVERITY_WARNING,
logical_file_name, line_number - 1, (size_t)(-1), false,
_("unterminated string literal"));
- phase7_ungetc ('\n');
+ unget_string_element ('\n');
break;
}
- if (c == P7_EOF || c == P7_QUOTES)
+ if (c == SE_EOF || c == SE_QUOTES)
break;
- if (c == P7_QUOTE)
+ if (c == SE_QUOTE)
c = '\'';
if (IS_UNICODE (c))
{
}
-/* Return value of phase7_getc when EOF is reached. */
-#define P7_EOF (-1)
+/* Return value of get_string_element when EOF is reached. */
+#define SE_EOF (-1)
/* Replace escape sequences within character strings with their single
character equivalents. */
-#define P7_QUOTES (-3)
-#define P7_QUOTE (-4)
-#define P7_NEWLINE (-5)
+#define SE_QUOTES (-3)
+#define SE_QUOTE (-4)
+#define SE_NEWLINE (-5)
/* Convert an UTF-16 or UTF-32 code point to a return value that can be
distinguished from a single-byte return value. */
static int
-phase7_getc ()
+get_string_element ()
{
int c, j;
c = phase1_getc ();
if (c == EOF)
- return P7_EOF;
+ return SE_EOF;
/* Return a magic newline indicator, so that we can distinguish
between the user requesting a newline in the string (e.g. using
you may not embed newlines in character constants; try it, you get
a useful diagnostic. --PMiller */
if (c == '\n')
- return P7_NEWLINE;
+ return SE_NEWLINE;
if (c == '"')
- return P7_QUOTES;
+ return SE_QUOTES;
if (c == '\'')
- return P7_QUOTE;
+ return SE_QUOTE;
if (c != '\\')
return c;
c = phase1_getc ();
static void
-phase7_ungetc (int c)
+unget_string_element (int c)
{
phase1_ungetc (c);
}
case '\'':
for (;;)
{
- c = phase7_getc ();
- if (c == P7_NEWLINE)
+ c = get_string_element ();
+ if (c == SE_NEWLINE)
{
if_error (IF_SEVERITY_WARNING,
logical_file_name, line_number - 1, (size_t)(-1), false,
_("unterminated character constant"));
- phase7_ungetc ('\n');
+ unget_string_element ('\n');
break;
}
- if (c == P7_EOF || c == P7_QUOTE)
+ if (c == SE_EOF || c == SE_QUOTE)
break;
}
tp->type = last_token_type = token_type_character_constant;
else
for (;;)
{
- c = phase7_getc ();
+ c = get_string_element ();
/* Keep line_number in sync. */
msb.line_number = line_number;
- if (c == P7_NEWLINE)
+ if (c == SE_NEWLINE)
{
if_error (IF_SEVERITY_WARNING,
logical_file_name, line_number - 1, (size_t)(-1), false,
_("unterminated string literal"));
- phase7_ungetc ('\n');
+ unget_string_element ('\n');
break;
}
- if (c == P7_QUOTES)
+ if (c == SE_QUOTES)
break;
- if (c == P7_EOF)
+ if (c == SE_EOF)
break;
- if (c == P7_QUOTE)
+ if (c == SE_QUOTE)
c = '\'';
if (IS_UNICODE (c))
{
};
-/* 7. Replace escape sequences within character strings with their
+/* Replace escape sequences within character strings with their
single character equivalents. */
-#define P7_QUOTES (1000 + '"')
+#define SE_QUOTES (1000 + '"')
static int
-phase7_getc ()
+get_string_element ()
{
int c;
c = phase1_getc ();
if (c == '"')
- return P7_QUOTES;
+ return SE_QUOTES;
if (c != '\\')
return c;
c = phase1_getc ();
bufpos = 0;
for (;;)
{
- c = phase7_getc ();
- if (c == EOF || c == P7_QUOTES)
+ c = get_string_element ();
+ if (c == EOF || c == SE_QUOTES)
break;
if (bufpos >= bufmax)
{