Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Google-ProtocolBuffers CPAN distribution.

Report information
The Basics
Id: 82734
Status: resolved
Priority: 0/
Queue: Google-ProtocolBuffers

People
Owner: Nobody in particular
Requestors: danielqzinn [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Parsing proto files with /* .. */ style comments
Date: Tue, 15 Jan 2013 18:36:16 -0800
To: bug-Google-ProtocolBuffers [...] rt.cpan.org
From: Daniel Zinn <danielqzinn [...] gmail.com>
Hi, Thank you for putting together such a great perl library! Protocol buffers in my favorite language are great! The parser gets upset when the proto definition contains /* .. */ style comments. Comments of this style are supported by the google protoc tool, so it would be great if the Perl-parser would be fine with them, too. It seems like the following change to Compiler.pl would do the trick: diff lib/Google/ProtocolBuffers/Compiler.pm.orig lib/Google/ProtocolBuffers/Compiler.pm 19c19 < proto : <skip: qr! (?: //.*\n | \s+ )* !x> --- Show quoted text
> proto : <skip: qr! (?: //.*\n | \s+ | /\*.*?\*/ )* !x>
Cheers, Daniel
Subject: Re: [rt.cpan.org #82734] AutoReply: Parsing proto files with /* .. */ style comments
Date: Tue, 15 Jan 2013 18:44:18 -0800
To: bug-Google-ProtocolBuffers [...] rt.cpan.org
From: Daniel Zinn <danielqzinn [...] gmail.com>
Here are some additional info, and an attached pl file, which could be used as a start for some unit tests. Google-ProtocolBuffers-0.08 from CPAN perl -v: This is perl 5, version 14, subversion 2 (v5.14.2) built for x86_64-linux-gnu-thread-multi (with 55 registered patches, see perl -V for more detail) uname-a: Linux qew 3.2.0-35-generic #55-Ubuntu SMP Wed Dec 5 17:42:16 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux Cheers, Daniel On 01/15/2013 06:36 PM, Bugs in Google-ProtocolBuffers via RT wrote: Show quoted text
> > Greetings, > > This message has been automatically generated in response to the > creation of a trouble ticket regarding: > "Parsing proto files with /* .. */ style comments", > a summary of which appears below. > > There is no need to reply to this message right now. Your ticket has been > assigned an ID of [rt.cpan.org #82734]. Your ticket is accessible > on the web at: > > https://rt.cpan.org/Ticket/Display.html?id=82734 > > Please include the string: > > [rt.cpan.org #82734] > > in the subject line of all future correspondence about this issue. To do so, > you may reply to this message. > > Thank you, > bug-Google-ProtocolBuffers@rt.cpan.org > > ------------------------------------------------------------------------- > Hi, > > Thank you for putting together such a great perl library! Protocol > buffers in my favorite language are great! > > The parser gets upset when the proto definition contains /* .. */ style > comments. Comments of this style are supported by the google protoc > tool, so it would be great if the Perl-parser would be fine with them, too. > > It seems like the following change to Compiler.pl would do the trick: > > diff lib/Google/ProtocolBuffers/Compiler.pm.orig > lib/Google/ProtocolBuffers/Compiler.pm > 19c19 > < proto : <skip: qr! (?: //.*\n | \s+ )* !x> > ---
>> proto : <skip: qr! (?: //.*\n | \s+ | /\*.*?\*/ )* !x>
> > Cheers, > Daniel >

Message body is not shown because sender requested not to inline it.

Subject: Re: [rt.cpan.org #82734] AutoReply: Parsing proto files with /* .. */ style comments
Date: Tue, 15 Jan 2013 19:07:32 -0800
To: bug-Google-ProtocolBuffers [...] rt.cpan.org
From: Daniel Zinn <danielqzinn [...] gmail.com>
My previous regular expression didn't match multi-line /* ... */ comments. The following might work better: diff lib/Google/ProtocolBuffers/Compiler.pm.orig lib/Google/ProtocolBuffers/Compiler.pm 19c19 < proto : <skip: qr! (?: //.*\n | \s+ )* !x> --- Show quoted text
> proto : <skip: qr! (?: //.*?\n | \s+ | /\*.*?\*/\s* )* !xs>
The added 's' in the options, makes . also match the newline symbol. I thus added the non-greedy modifier '?' in the expression to match //-style comments. Cheers, Daniel On 01/15/2013 06:44 PM, Daniel Zinn wrote: Show quoted text
> Here are some additional info, and an attached pl file, which could be > used as a start for some unit tests. > > Google-ProtocolBuffers-0.08 from CPAN > > perl -v: > This is perl 5, version 14, subversion 2 (v5.14.2) built for > x86_64-linux-gnu-thread-multi > (with 55 registered patches, see perl -V for more detail) > > uname-a: > Linux qew 3.2.0-35-generic #55-Ubuntu SMP Wed Dec 5 17:42:16 UTC 2012 > x86_64 x86_64 x86_64 GNU/Linux > > > Cheers, > Daniel > > On 01/15/2013 06:36 PM, Bugs in Google-ProtocolBuffers via RT wrote:
>> >> Greetings, >> >> This message has been automatically generated in response to the >> creation of a trouble ticket regarding: >> "Parsing proto files with /* .. */ style comments", >> a summary of which appears below. >> >> There is no need to reply to this message right now. Your ticket has been >> assigned an ID of [rt.cpan.org #82734]. Your ticket is accessible >> on the web at: >> >> https://rt.cpan.org/Ticket/Display.html?id=82734 >> >> Please include the string: >> >> [rt.cpan.org #82734] >> >> in the subject line of all future correspondence about this issue. To do so, >> you may reply to this message. >> >> Thank you, >> bug-Google-ProtocolBuffers@rt.cpan.org >> >> ------------------------------------------------------------------------- >> Hi, >> >> Thank you for putting together such a great perl library! Protocol >> buffers in my favorite language are great! >> >> The parser gets upset when the proto definition contains /* .. */ style >> comments. Comments of this style are supported by the google protoc >> tool, so it would be great if the Perl-parser would be fine with them, too. >> >> It seems like the following change to Compiler.pl would do the trick: >> >> diff lib/Google/ProtocolBuffers/Compiler.pm.orig >> lib/Google/ProtocolBuffers/Compiler.pm >> 19c19 >> < proto : <skip: qr! (?: //.*\n | \s+ )* !x> >> ---
>>> proto : <skip: qr! (?: //.*\n | \s+ | /\*.*?\*/ )* !x>
>> >> Cheers, >> Daniel >>

Message body is not shown because sender requested not to inline it.

Thanks! https://github.com/csirtgadgets/google-protocolbuffers-perl/issues/5 we're working on pushing some updates to the original. we'll slate this for v.10 (releasing v0.09 today). i'm updating the meta data to point at the active tracker too, sorry for missing this... cheers, wes On Tue Jan 15 22:07:45 2013, danielqzinn@gmail.com wrote: Show quoted text
> My previous regular expression didn't match multi-line /* ... */ > comments. The following might work better: > > diff lib/Google/ProtocolBuffers/Compiler.pm.orig > lib/Google/ProtocolBuffers/Compiler.pm > 19c19 > < proto : <skip: qr! (?: //.*\n | \s+ )* !x> > ---
> > proto : <skip: qr! (?: //.*?\n | \s+ | /\*.*?\*/\s* )* !xs>
> > The added 's' in the options, makes . also match the newline symbol. I > thus added the non-greedy modifier '?' in the expression to match > //-style comments. > > Cheers, > Daniel > > > On 01/15/2013 06:44 PM, Daniel Zinn wrote:
> > Here are some additional info, and an attached pl file, which could > > be > > used as a start for some unit tests. > > > > Google-ProtocolBuffers-0.08 from CPAN > > > > perl -v: > > This is perl 5, version 14, subversion 2 (v5.14.2) built for > > x86_64-linux-gnu-thread-multi > > (with 55 registered patches, see perl -V for more detail) > > > > uname-a: > > Linux qew 3.2.0-35-generic #55-Ubuntu SMP Wed Dec 5 17:42:16 UTC > > 2012 > > x86_64 x86_64 x86_64 GNU/Linux > > > > > > Cheers, > > Daniel > > > > On 01/15/2013 06:36 PM, Bugs in Google-ProtocolBuffers via RT wrote:
> >> > >> Greetings, > >> > >> This message has been automatically generated in response to the > >> creation of a trouble ticket regarding: > >> "Parsing proto files with /* .. */ style comments", > >> a summary of which appears below. > >> > >> There is no need to reply to this message right now. Your ticket > >> has been > >> assigned an ID of [rt.cpan.org #82734]. Your ticket is accessible > >> on the web at: > >> > >> https://rt.cpan.org/Ticket/Display.html?id=82734 > >> > >> Please include the string: > >> > >> [rt.cpan.org #82734] > >> > >> in the subject line of all future correspondence about this issue. > >> To do so, > >> you may reply to this message. > >> > >> Thank you, > >> bug-Google-ProtocolBuffers@rt.cpan.org > >> > >> ------------------------------------------------------------------------- > >> Hi, > >> > >> Thank you for putting together such a great perl library! Protocol > >> buffers in my favorite language are great! > >> > >> The parser gets upset when the proto definition contains /* .. */ > >> style > >> comments. Comments of this style are supported by the google protoc > >> tool, so it would be great if the Perl-parser would be fine with > >> them, too. > >> > >> It seems like the following change to Compiler.pl would do the > >> trick: > >> > >> diff lib/Google/ProtocolBuffers/Compiler.pm.orig > >> lib/Google/ProtocolBuffers/Compiler.pm > >> 19c19 > >> < proto : <skip: qr! (?: //.*\n | \s+ )* !x> > >> ---
> >>> proto : <skip: qr! (?: //.*\n | \s+ | /\*.*?\*/ )* !x>
> >> > >> Cheers, > >> Daniel > >>