Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 3BAA763417C for ; Tue, 14 Jul 2009 17:24:51 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 36153-02-5 for ; Tue, 14 Jul 2009 17:24:36 -0300 (ADT) Received: from cvs.postgresql.org (cvs.postgresql.org [217.196.146.206]) by mail.postgresql.org (Postfix) with ESMTP id 3DCFF63438F for ; Tue, 14 Jul 2009 17:24:12 -0300 (ADT) Received: by cvs.postgresql.org (Postfix, from userid 1007) id C81F475331E; Tue, 14 Jul 2009 20:24:10 +0000 (UTC) MIME-Version: 1.0 To: pgsql-committers@postgresql.org Subject: pgsql: Tweak the core scanner so that it can be used by plpgsql too. X-Mailer: activitymail 1.24, http://search.cpan.org/dist/activitymail/ Content-Type: text/plain Message-Id: <20090714202410.C81F475331E@cvs.postgresql.org> Date: Tue, 14 Jul 2009 20:24:10 +0000 (UTC) From: tgl@postgresql.org (Tom Lane) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.002 tagged_above=0 required=5 tests=AWL=0.002 X-Spam-Level: X-Archive-Number: 200907/140 X-Sequence-Number: 37743 Log Message: ----------- Tweak the core scanner so that it can be used by plpgsql too. Changes: Pass in the keyword lookup array instead of having it be hardwired. (This incidentally allows elimination of some duplicate coding in ecpg.) Re-order the token declarations in gram.y so that non-keyword tokens have numbers that won't change when keywords are added or removed. Add ".." and ":=" to the set of tokens recognized by scan.l. (Since these combinations are nowhere legal in core SQL, this does not change anything except the precise wording of the error you get when you write this.) Modified Files: -------------- pgsql/src/backend/parser: gram.y (r2.668 -> r2.669) (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/parser/gram.y?r1=2.668&r2=2.669) keywords.c (r1.213 -> r1.214) (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/parser/keywords.c?r1=1.213&r2=1.214) kwlookup.c (r2.2 -> r2.3) (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/parser/kwlookup.c?r1=2.2&r2=2.3) parser.c (r1.80 -> r1.81) (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/parser/parser.c?r1=1.80&r2=1.81) scan.l (r1.156 -> r1.157) (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/parser/scan.l?r1=1.156&r2=1.157) pgsql/src/backend/utils/adt: misc.c (r1.71 -> r1.72) (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/adt/misc.c?r1=1.71&r2=1.72) ruleutils.c (r1.301 -> r1.302) (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/adt/ruleutils.c?r1=1.301&r2=1.302) pgsql/src/bin/pg_dump: dumputils.c (r1.46 -> r1.47) (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/bin/pg_dump/dumputils.c?r1=1.46&r2=1.47) keywords.c (r1.3 -> r1.4) (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/bin/pg_dump/keywords.c?r1=1.3&r2=1.4) pgsql/src/include/parser: gramparse.h (r1.46 -> r1.47) (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/parser/gramparse.h?r1=1.46&r2=1.47) keywords.h (r1.26 -> r1.27) (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/include/parser/keywords.h?r1=1.26&r2=1.27) pgsql/src/interfaces/ecpg/preproc: c_keywords.c (r1.23 -> r1.24) (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/interfaces/ecpg/preproc/c_keywords.c?r1=1.23&r2=1.24) ecpg_keywords.c (r1.40 -> r1.41) (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/interfaces/ecpg/preproc/ecpg_keywords.c?r1=1.40&r2=1.41) extern.h (r1.73 -> r1.74) (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/interfaces/ecpg/preproc/extern.h?r1=1.73&r2=1.74) keywords.c (r1.88 -> r1.89) (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/interfaces/ecpg/preproc/keywords.c?r1=1.88&r2=1.89)