diff options
Diffstat (limited to 'src/backend/parser/scansup.c')
| -rw-r--r-- | src/backend/parser/scansup.c | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/src/backend/parser/scansup.c b/src/backend/parser/scansup.c index c326ef0e3ab..807338652b4 100644 --- a/src/backend/parser/scansup.c +++ b/src/backend/parser/scansup.c @@ -9,7 +9,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/parser/scansup.c,v 1.33 2006/07/14 14:52:22 momjian Exp $ + * $PostgreSQL: pgsql/src/backend/parser/scansup.c,v 1.34 2006/09/22 21:39:57 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -183,3 +183,26 @@ truncate_identifier(char *ident, int len, bool warn) ident[len] = '\0'; } } + +/* + * scanner_isspace() --- return TRUE if flex scanner considers char whitespace + * + * This should be used instead of the potentially locale-dependent isspace() + * function when it's important to match the lexer's behavior. + * + * In principle we might need similar functions for isalnum etc, but for the + * moment only isspace seems needed. + */ +bool +scanner_isspace(char ch) +{ + /* This must match scan.l's list of {space} characters */ + /* and plpgsql's scan.l as well */ + if (ch == ' ' || + ch == '\t' || + ch == '\n' || + ch == '\r' || + ch == '\f') + return true; + return false; +} |
