From d47657d07ab900604547efd0a4eb288775ad43b9 Mon Sep 17 00:00:00 2001 From: Andi Albrecht Date: Wed, 24 Jun 2009 06:13:29 +0200 Subject: Fix incorrect detection of keyword fragments in names (fixes issue7, reported and initial patch by andyboyko). --- sqlparse/lexer.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sqlparse') diff --git a/sqlparse/lexer.py b/sqlparse/lexer.py index 8ccc7de..1cdb98c 100644 --- a/sqlparse/lexer.py +++ b/sqlparse/lexer.py @@ -176,9 +176,9 @@ class Lexer: # TODO: Backslash escapes? (r"'(''|[^'])*'", String.Single), (r'"(""|[^"])*"', String.Symbol), # not a real string literal in ANSI SQL - (r'(LEFT |RIGHT )?(INNER |OUTER )?JOIN', Keyword), - (r'END( IF| LOOP)?', Keyword), - (r'CREATE( OR REPLACE)?', Keyword.DDL), + (r'(LEFT |RIGHT )?(INNER |OUTER )?JOIN\b', Keyword), + (r'END( IF| LOOP)?\b', Keyword), + (r'CREATE( OR REPLACE)?\b', Keyword.DDL), (r'[a-zA-Z_][a-zA-Z0-9_]*', is_keyword), (r'\$([a-zA-Z_][a-zA-Z0-9_]*)?\$', Name.Builtin), (r'[;:()\[\],\.]', Punctuation), -- cgit v1.2.1