From fb7f70112fd80f13a8f124f51c4992fe290d3836 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Wed, 24 Nov 2021 09:10:32 +0100 Subject: Improve some comments in scanner files Reviewed-by: John Naylor Discussion: https://www.postgresql.org/message-id/flat/b239564c-cad0-b23e-c57e-166d883cb97d@enterprisedb.com --- src/backend/parser/scan.l | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/backend/parser') diff --git a/src/backend/parser/scan.l b/src/backend/parser/scan.l index 6e6824faebd..76fd6996eda 100644 --- a/src/backend/parser/scan.l +++ b/src/backend/parser/scan.l @@ -174,7 +174,7 @@ extern void core_yyset_column(int column_no, yyscan_t yyscanner); * bit string literal * extended C-style comments * delimited identifiers (double-quoted identifiers) - * hexadecimal numeric string + * hexadecimal byte string * standard quoted strings * quote stop (detect continued strings) * extended quoted strings (support backslash escape sequences) @@ -262,7 +262,7 @@ quotecontinuefail {whitespace}*"-"? xbstart [bB]{quote} xbinside [^']* -/* Hexadecimal number */ +/* Hexadecimal byte string */ xhstart [xX]{quote} xhinside [^']* @@ -341,7 +341,6 @@ xcstart \/\*{op_chars}* xcstop \*+\/ xcinside [^*/]+ -digit [0-9] ident_start [A-Za-z\200-\377_] ident_cont [A-Za-z\200-\377_0-9\$] @@ -380,15 +379,18 @@ self [,()\[\].;\:\+\-\*\/\%\^\<\>\=] op_chars [\~\!\@\#\^\&\|\`\?\+\-\*\/\%\<\>\=] operator {op_chars}+ -/* we no longer allow unary minus in numbers. - * instead we pass it separately to parser. there it gets - * coerced via doNegate() -- Leon aug 20 1999 +/* + * Numbers + * + * Unary minus is not part of a number here. Instead we pass it separately to + * the parser, and there it gets coerced via doNegate(). * * {decimalfail} is used because we would like "1..10" to lex as 1, dot_dot, 10. * * {realfail1} and {realfail2} are added to prevent the need for scanner * backup when the {real} rule fails to match completely. */ +digit [0-9] integer {digit}+ decimal (({digit}*\.{digit}+)|({digit}+\.{digit}*)) -- cgit v1.2.3