Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Unexpected behavior for names method #7

Closed
djwonk opened this Issue · 3 comments

2 participants

@djwonk
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]
@djwonk

The current behavior makes it look as if 'something' did not match at all.

@mjackson
Owner

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.

@mjackson
Owner

Closing this ticket because this method is no longer supported.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.