adhearsion/ruby_speech

Items w/ Range repeats followed by other tags do not potentially match correctly

benlangfeld opened this issue · 1 comments

The current method of doing a stepped iteration through elements allowing them to capture part of the input does not work in the following (simplified) scenario:

<grammar>
  <rule>
    <item repeat="3-">2</item> <token>#</token>
  </rule>
</grammar>

with the input 22#, the Item "captures" the 22, and then matches the # to the token. This results in a PartialMatch, which is not possible since the item requires at least '222' to fully match before the status of the token should be taken into account.

Fixed by 1630fce