Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

extra text in 'number' callback of Verilog::Parser 3.408 #893

Closed
veripoolbot opened this issue Mar 2, 2015 · 3 comments
Closed

extra text in 'number' callback of Verilog::Parser 3.408 #893

veripoolbot opened this issue Mar 2, 2015 · 3 comments

Comments

@veripoolbot
Copy link
Collaborator

@veripoolbot veripoolbot commented Mar 2, 2015


Author Name: Greg Waters
Original Redmine Issue: 893 from https://www.veripool.org
Original Date: 2015-03-02


See bug description in this callback function for Verilog::Parser 3.408.

sub number {
my $self = shift;
my $tokens = $self->tokens; # I collect a vector of tokens
$self->show1(SUB, qw(token), @) if $Debug;

 my $token = shift;	# What token was parsed
 $self->unreadbackCat($token)  if $self->use_unreadback;

 #BUG in Verilog::Parser:
 # For "cntr_r <=#1 '0;" (or "1 'd0" or "1 ' 0"), it calls back with:
 # ("cntr_r", "<=", "#", "1 '0", "'0", ";").
 # Workaround it by splitting "1 '[0-9A-Za-z]" at space-tick-char
 # if preceding token was "#".

 if (substr($self->{_buffer}, $self->{_prevTokEnd} - 1, 1) eq "#"
     && $token =~ m!^(\d+)\s+\'\s*[0-9A-Za-z]!) {
     $token = $1;
 }
 #          number := real_number | integral_number
 # integral_number := (decimal,octal,binary,hex)_number
 $self->_storeToken('NUMBER', $token);

}
Drop me a line if that's not clear. The issue is to scan a simple
decimal integer, or a time with units, after "<= #". A number with
size and radix prefix is not allowed in that context.
Just FYI, no rush. --Greg

@veripoolbot

This comment has been minimized.

Copy link
Collaborator Author

@veripoolbot veripoolbot commented Mar 2, 2015


Original Redmine Comment
Author Name: Greg Waters
Original Date: 2015-03-02T02:36:17Z


One more try to post with formatted code, not to be reflowed...

sub number {        # Default Internal callback
     my $self = shift;
     my $tokens = $self->tokens;
     $self->_show1(__SUB__, qw(token), @_)  if $Debug;
     my $token = shift;	# What token was parsed
     $self->unreadbackCat($token)  if $self->use_unreadback;

     #BUG in Verilog::Parser:
     # For "cntr_r <=#1 '0;" (or "1 'd0" or "1 ' 0"), it calls back with:
     # ("cntr_r", "<=", "#", "1 '0", "'0", ";").
     # Workaround it by splitting "1 '[0-9A-Za-z]" at space-tick-char.

     if (substr($self->{_buffer}, $self->{_prevTokEnd} - 1, 1) eq "#"
         && $token =~ m!^(\d+)\s+\'\s*[0-9A-Za-z]!) {
         $token = $1;
     }
     #          number := real_number | integral_number
     # integral_number := (decimal,octal,binary,hex)_number
     $self->_storeToken('NUMBER', $token);
}

@veripoolbot

This comment has been minimized.

Copy link
Collaborator Author

@veripoolbot veripoolbot commented Mar 2, 2015


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2015-03-02T03:54:04Z


Thanks for the report, rather than your patch, fixed the parser, as the parser simply was issuing the callback with the wrong parameters.

Fixed in git towards 3.409. If you need a formal release let me know.

@veripoolbot

This comment has been minimized.

Copy link
Collaborator Author

@veripoolbot veripoolbot commented Mar 14, 2015


Original Redmine Comment
Author Name: Wilson Snyder (@wsnyder)
Original Date: 2015-03-14T16:29:15Z


In 3.410.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.