From: Chris Hilton Date: Mon, 19 Feb 2007 20:15:13 +0000 (+0000) Subject: Slight change to comment parsing to allow asterisks in comments X-Git-Tag: v0.11008~385 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=732123893912d04529932a9f39750012a5a28357;p=dbsrgits%2FSQL-Translator.git Slight change to comment parsing to allow asterisks in comments --- diff --git a/lib/SQL/Translator/Parser/MySQL.pm b/lib/SQL/Translator/Parser/MySQL.pm index 6b1bfdc..1a565fa 100644 --- a/lib/SQL/Translator/Parser/MySQL.pm +++ b/lib/SQL/Translator/Parser/MySQL.pm @@ -1,7 +1,7 @@ package SQL::Translator::Parser::MySQL; # ------------------------------------------------------------------- -# $Id: MySQL.pm,v 1.55 2006-10-10 19:04:54 duality72 Exp $ +# $Id: MySQL.pm,v 1.56 2007-02-19 20:15:13 duality72 Exp $ # ------------------------------------------------------------------- # Copyright (C) 2002-4 SQLFairy Authors # @@ -134,7 +134,7 @@ A subset of INSERT that we ignore: use strict; use vars qw[ $DEBUG $VERSION $GRAMMAR @EXPORT_OK ]; -$VERSION = sprintf "%d.%02d", q$Revision: 1.55 $ =~ /(\d+)\.(\d+)/; +$VERSION = sprintf "%d.%02d", q$Revision: 1.56 $ =~ /(\d+)\.(\d+)/; $DEBUG = 0 unless defined $DEBUG; use Data::Dumper; @@ -309,9 +309,10 @@ comment : /^\s*(?:#|-{2}).*\n/ $return = $comment; } -comment : /\/\*/ /[^\*]+/ /\*\// +comment : /\/\*/ /.*?\*\// { my $comment = $item[2]; + $comment = substr($comment, 0, -2); $comment =~ s/^\s*|\s*$//g; $return = $comment; }