Clean up the mess from => patch.

Commit 865f14a2d3 was quite a few bricks
shy of a load: psql, ecpg, and plpgsql were all left out-of-step with
the core lexer.  Of these only the last was likely to be a fatal
problem; but still, a minimal amount of grepping, or even just reading
the comments adjacent to the places that were changed, would have found
the other places that needed to be changed.
This commit is contained in:
Tom Lane 2015-03-10 11:48:34 -04:00
parent bb7b35caf7
commit 2fbb286647
5 changed files with 11 additions and 3 deletions

View File

@ -358,6 +358,7 @@ identifier {ident_start}{ident_cont}*
typecast "::"
dot_dot \.\.
colon_equals ":="
equals_greater "=>"
/*
* "self" is the set of chars that should be returned as single-character
@ -669,6 +670,10 @@ other .
ECHO;
}
{equals_greater} {
ECHO;
}
/*
* These rules are specific to psql --- they implement parenthesis
* counting and detection of command-ending semicolon. These must

View File

@ -50,7 +50,7 @@ typedef union core_YYSTYPE
* the ASCII characters plus these:
* %token <str> IDENT FCONST SCONST BCONST XCONST Op
* %token <ival> ICONST PARAM
* %token TYPECAST DOT_DOT COLON_EQUALS
* %token TYPECAST DOT_DOT COLON_EQUALS EQUALS_GREATER
* The above token definitions *must* be the first ones declared in any
* bison parser built atop this scanner, so that they will have consistent
* numbers assigned to them (specifically, IDENT = 258 and so on).

View File

@ -46,7 +46,8 @@ my %replace_string = (
'WITH_LA' => 'with',
'TYPECAST' => '::',
'DOT_DOT' => '..',
'COLON_EQUALS' => ':=',);
'COLON_EQUALS' => ':=',
'EQUALS_GREATER' => '=>',);
# specific replace_types for specific non-terminals - never include the ':'
# ECPG-only replace_types are defined in ecpg-replace_types

View File

@ -236,6 +236,7 @@ array ({ident_cont}|{whitespace}|[\[\]\+\-\*\%\/\(\)\>\.])*
typecast "::"
dot_dot \.\.
colon_equals ":="
equals_greater "=>"
/*
* "self" is the set of chars that should be returned as single-character
@ -620,6 +621,7 @@ cppline {space}*#([^i][A-Za-z]*|{if}|{ifdef}|{ifndef}|{import})(.*\\{space})*.
<SQL>{typecast} { return TYPECAST; }
<SQL>{dot_dot} { return DOT_DOT; }
<SQL>{colon_equals} { return COLON_EQUALS; }
<SQL>{equals_greater} { return EQUALS_GREATER; }
<SQL>{informix_special} {
/* are we simulating Informix? */
if (INFORMIX_MODE)

View File

@ -226,7 +226,7 @@ static void check_raise_parameters(PLpgSQL_stmt_raise *stmt);
*/
%token <str> IDENT FCONST SCONST BCONST XCONST Op
%token <ival> ICONST PARAM
%token TYPECAST DOT_DOT COLON_EQUALS
%token TYPECAST DOT_DOT COLON_EQUALS EQUALS_GREATER
/*
* Other tokens recognized by plpgsql's lexer interface layer (pl_scanner.c).