From f945f46193690841315b79f5961d3721c73621d9 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sat, 18 Mar 2000 18:03:12 +0000 Subject: Modify lexing of multi-char operators per pghackers discussion around 16-Mar-00: trailing + or - is not part of the operator unless the operator also contains characters not present in SQL92-defined operators. This solves the 'X=-Y' problem without unduly constraining users' choice of operator names --- in particular, no existing Postgres operator names become invalid. Also, remove processing of // comments, as agreed in the same thread. --- src/bin/psql/mainloop.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/bin/psql/mainloop.c') diff --git a/src/bin/psql/mainloop.c b/src/bin/psql/mainloop.c index 4f71f3e4105..eadd50e94af 100644 --- a/src/bin/psql/mainloop.c +++ b/src/bin/psql/mainloop.c @@ -3,7 +3,7 @@ * * Copyright 2000 by PostgreSQL Global Development Group * - * $Header: /cvsroot/pgsql/src/bin/psql/mainloop.c,v 1.25 2000/03/13 13:46:32 petere Exp $ + * $Header: /cvsroot/pgsql/src/bin/psql/mainloop.c,v 1.26 2000/03/18 18:03:11 tgl Exp $ */ #include "postgres.h" #include "mainloop.h" @@ -318,8 +318,7 @@ MainLoop(FILE *source) } /* single-line comment? truncate line */ - else if ((line[i] == '-' && line[i + thislen] == '-') || - (line[i] == '/' && line[i + thislen] == '/')) + else if (line[i] == '-' && line[i + thislen] == '-') { line[i] = '\0'; /* remove comment */ break; -- cgit v1.2.3