]> granicus.if.org Git - postgresql/commitdiff
Clean up the mess from => patch.
authorTom Lane <tgl@sss.pgh.pa.us>
Tue, 10 Mar 2015 15:48:34 +0000 (11:48 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Tue, 10 Mar 2015 15:48:38 +0000 (11:48 -0400)
Commit 865f14a2d31af23a05bbf2df04c274629c5d5c4d 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.

src/bin/psql/psqlscan.l
src/include/parser/scanner.h
src/interfaces/ecpg/preproc/parse.pl
src/interfaces/ecpg/preproc/pgc.l
src/pl/plpgsql/src/pl_gram.y

index fb3fa113875803dbd4ba645107cacf509ffa5d03..2b2dec95be72a7222230e37f7b2ee14900a76bd9 100644 (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
index e6724bc588ea07b542fdb1f98af65cba48dba352..535e864e3681ddd3cc464bd389874bd7204012b2 100644 (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).
index 36dce80386343ce6a8d8d697eb124261e783db95..7ae7acc6130193604a4794ff3f4b017c70f7f60a 100644 (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
index 530712efac61a739c95ee2053eafe64cb7e00d38..a8cc3d877c091f33bc14624a3ad7190f4b59692b 100644 (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)
index 506a313f7015ff21206cf60effe01d09879bc3cf..a1758e03c3f0398dcae8d7e38ddc4bef9c6e234f 100644 (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).