# MergeLocation bug

**URL:** <https://www.ruby-forum.com/t/mergelocation-bug/129494>\
**Category:** IronRuby\
**Created:** [February 19, 2008, 2:17am UTC](https://www.ruby-forum.com/t/mergelocation-bug/129494 "2008-02-19T02:17:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Wayne\_K](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/b5ac83/32.png) [@Wayne\_K](https://www.ruby-forum.com/u/Wayne_K)\
**Post date:** [February 19, 2008, 2:17am UTC](https://www.ruby-forum.com/t/mergelocation-bug/129494/1 "2008-02-19T02:17:38Z")

</div>

A Parser/scanner bug has been introduced in lastest revision.

We used to be able to successfully parse rubygems-1.0.1\setup.rb but it  
now raises an assertion error in SourceSpan::ValidateLocations.

The problem lies in the Parser::MergeLocations method which I believe  
needs to be able to deal with the case where the end span lies before  
the start span. This occurs when there is a production with an empty  
RHS. Such a scenario should produce a span of width 0.

I also note that the arguments to MergeLocation on line 350 of GPPG.cs  
have been reversed - I’m not sure that is correct.

Cheers, Wayne.

---

<div class="post-metadata">

**Author:** ![Wayne\_K](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/b5ac83/32.png) [@Wayne\_K](https://www.ruby-forum.com/u/Wayne_K)\
**Post date:** [February 19, 2008, 5:04am UTC](https://www.ruby-forum.com/t/mergelocation-bug/129494/2 "2008-02-19T05:04:12Z")

</div>

Will look at it.

Thanks!  
Tomas

From: removed\_email\_address@domain.invalid  
[[mailto:removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)] On Behalf Of Wayne K.  
Sent: Monday, February 18, 2008 5:12 PM  
To: removed\_email\_address@domain.invalid  
Subject: [Ironruby-core] MergeLocation bug

A Parser/scanner bug has been introduced in lastest revision.

We used to be able to successfully parse rubygems-1.0.1\setup.rb but it  
now raises an assertion error in SourceSpan::ValidateLocations.

The problem lies in the Parser::MergeLocations method which I believe  
needs to be able to deal with the case where the end span lies before  
the start span. This occurs when there is a production with an empty  
RHS. Such a scenario should produce a span of width 0.

I also note that the arguments to MergeLocation on line 350 of GPPG.cs  
have been reversed - I’m not sure that is correct.

Cheers, Wayne.
