Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 2fbb286

Browse files
committed
Clean up the mess from => patch.
Commit 865f14a 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.
1 parent bb7b35c commit 2fbb286

File tree

5 files changed

+11
-3
lines changed

5 files changed

+11
-3
lines changed

src/bin/psql/psqlscan.l

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,7 @@ identifier {ident_start}{ident_cont}*
358358
typecast "::"
359359
dot_dot \.\.
360360
colon_equals ":="
361+
equals_greater "=>"
361362

362363
/*
363364
* "self" is the set of chars that should be returned as single-character
@@ -669,6 +670,10 @@ other .
669670
ECHO;
670671
}
671672

673+
{equals_greater} {
674+
ECHO;
675+
}
676+
672677
/*
673678
* These rules are specific to psql --- they implement parenthesis
674679
* counting and detection of command-ending semicolon. These must

src/include/parser/scanner.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ typedef union core_YYSTYPE
5050
* the ASCII characters plus these:
5151
* %token <str> IDENT FCONST SCONST BCONST XCONST Op
5252
* %token <ival> ICONST PARAM
53-
* %token TYPECAST DOT_DOT COLON_EQUALS
53+
* %token TYPECAST DOT_DOT COLON_EQUALS EQUALS_GREATER
5454
* The above token definitions *must* be the first ones declared in any
5555
* bison parser built atop this scanner, so that they will have consistent
5656
* numbers assigned to them (specifically, IDENT = 258 and so on).

src/interfaces/ecpg/preproc/parse.pl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@
4646
'WITH_LA' => 'with',
4747
'TYPECAST' => '::',
4848
'DOT_DOT' => '..',
49-
'COLON_EQUALS' => ':=',);
49+
'COLON_EQUALS' => ':=',
50+
'EQUALS_GREATER' => '=>',);
5051

5152
# specific replace_types for specific non-terminals - never include the ':'
5253
# ECPG-only replace_types are defined in ecpg-replace_types

src/interfaces/ecpg/preproc/pgc.l

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,7 @@ array ({ident_cont}|{whitespace}|[\[\]\+\-\*\%\/\(\)\>\.])*
236236
typecast "::"
237237
dot_dot \.\.
238238
colon_equals ":="
239+
equals_greater "=>"
239240

240241
/*
241242
* "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})*.
620621
<SQL>{typecast} { return TYPECAST; }
621622
<SQL>{dot_dot} { return DOT_DOT; }
622623
<SQL>{colon_equals} { return COLON_EQUALS; }
624+
<SQL>{equals_greater} { return EQUALS_GREATER; }
623625
<SQL>{informix_special} {
624626
/* are we simulating Informix? */
625627
if (INFORMIX_MODE)

src/pl/plpgsql/src/pl_gram.y

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ static void check_raise_parameters(PLpgSQL_stmt_raise *stmt);
226226
*/
227227
%token <str> IDENT FCONST SCONST BCONST XCONST Op
228228
%token <ival> ICONST PARAM
229-
%token TYPECAST DOT_DOT COLON_EQUALS
229+
%token TYPECAST DOT_DOT COLON_EQUALS EQUALS_GREATER
230230

231231
/*
232232
* Other tokens recognized by plpgsql's lexer interface layer (pl_scanner.c).

0 commit comments

Comments
 (0)