aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/bin/psql/psqlscan.l5
-rw-r--r--src/include/parser/scanner.h2
-rw-r--r--src/interfaces/ecpg/preproc/parse.pl3
-rw-r--r--src/interfaces/ecpg/preproc/pgc.l2
-rw-r--r--src/pl/plpgsql/src/pl_gram.y2
5 files changed, 11 insertions, 3 deletions
diff --git a/src/bin/psql/psqlscan.l b/src/bin/psql/psqlscan.l
index fb3fa113875..2b2dec95be7 100644
--- a/src/bin/psql/psqlscan.l
+++ b/src/bin/psql/psqlscan.l
@@ -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
diff --git a/src/include/parser/scanner.h b/src/include/parser/scanner.h
index e6724bc588e..535e864e368 100644
--- a/src/include/parser/scanner.h
+++ b/src/include/parser/scanner.h
@@ -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).
diff --git a/src/interfaces/ecpg/preproc/parse.pl b/src/interfaces/ecpg/preproc/parse.pl
index 36dce803863..7ae7acc6130 100644
--- a/src/interfaces/ecpg/preproc/parse.pl
+++ b/src/interfaces/ecpg/preproc/parse.pl
@@ -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
diff --git a/src/interfaces/ecpg/preproc/pgc.l b/src/interfaces/ecpg/preproc/pgc.l
index 530712efac6..a8cc3d877c0 100644
--- a/src/interfaces/ecpg/preproc/pgc.l
+++ b/src/interfaces/ecpg/preproc/pgc.l
@@ -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)
diff --git a/src/pl/plpgsql/src/pl_gram.y b/src/pl/plpgsql/src/pl_gram.y
index 506a313f701..a1758e03c3f 100644
--- a/src/pl/plpgsql/src/pl_gram.y
+++ b/src/pl/plpgsql/src/pl_gram.y
@@ -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).