Variables ending in "do" followed by || or ||= were mistakenly treated as blocks by the grammar:
The grammar was naively treating do | as a block. This PR just adds a few extra checks to ensure that do is not immediately preceded by an identifier character.
Tada!
Alternate Designs
It would be nice if this could be done using a more sane regex, but that is impossible since a lookbehind is necessary. Imagine if it were this:
\b(do|{)\s*|
Wouldn't that be nice!
Benefits
Variables ending in do will not be confused with blocks. This is especially great for Spanish variable names.
Description of the Change
Variables ending in "do" followed by || or ||= were mistakenly treated as blocks by the grammar:
The grammar was naively treating
do |
as a block. This PR just adds a few extra checks to ensure thatdo
is not immediately preceded by an identifier character.Tada!
Alternate Designs
It would be nice if this could be done using a more sane regex, but that is impossible since a lookbehind is necessary. Imagine if it were this:
Wouldn't that be nice!
Benefits
Variables ending in
do
will not be confused with blocks. This is especially great for Spanish variable names.Possible Drawbacks
Can't imagine any, this is just a syntax.
Applicable Issues
Fixes #214.