Unexpected behavior for names method
djwonk opened this issue · comments
D. James commented
grammar Alias
rule something
digit
end
rule digit
[0-9]
end
end
require 'rubygems'
require 'citrus'
Citrus.load('alias')
m = Alias.parse('1')
puts m.names
# => [:digit]
# I would expect...
# => [:something, :digit]
D. James commented
The current behavior makes it look as if 'something' did not match at all.
Michael Jackson commented
Match#names
has been removed from the current release, so this example no longer works. However, this particular behavior is still the same.
When you get a Match
object back from something
, it results from the execution of digit
, since something
is an alias for digit
. There is no match object to wrap this object since none is needed. In other words, the match object that you get back from executing something
is from the perspective of something
.
Michael Jackson commented
Closing this ticket because this method is no longer supported.