/* Return true if STR looks like the end of a raw string that had N
hashes at the start. */
-static int
+static bool
ends_raw_string (const char *str, int n)
{
int i;
gdb_assert (str[0] == '"');
for (i = 0; i < n; ++i)
if (str[i + 1] != '#')
- return 0;
- return 1;
+ return false;
+ return true;
}
/* Lex a string constant. */
/* Return true if STRING starts with whitespace followed by a digit. */
-static int
+static bool
space_then_number (const char *string)
{
const char *p = string;
while (p[0] == ' ' || p[0] == '\t')
++p;
if (p == string)
- return 0;
+ return false;
return *p >= '0' && *p <= '9';
}
/* Return true if C can start an identifier. */
-static int
+static bool
rust_identifier_start_p (char c)
{
return ((c >= 'a' && c <= 'z')
/* The parser error handler. */
void
-rustyyerror (char *msg)
+rustyyerror (const char *msg)
{
const char *where = prev_lexptr ? prev_lexptr : lexptr;
error (_("%s in expression, near `%s'."), (msg ? msg : "Error"), where);