'a''b''c' accepted, 'abc' not accepted.
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
PyMeta |
New
|
Undecided
|
Unassigned |
Bug Description
Based on other OMeta platforms, I expected 'abc' to be the same as ('a' 'b' 'c') however the former doesn't work. The OMeta paper states:
"For convenience, OMeta accepts the syntax ’xyz’ (in single quotes) as shorthand for the sequence ’x’ ’y’ ’z’." (dls07 2.2)
From that description, I extended the definition of a character in PyMeta like so:
character ::= ( <token "'"> (<escapedChar> | <anything>):c <token "'"> => self.builder.
| <token "'"> (<escapedChar> | ~('\'') <anything>)*:rs <token "'"> => self.builder.
)
That's a fairly literal translation based on the statement in dls07. The behavior of sequence in this context is somewhat unhelpful in that the result of a successful match will be the last character rather than the entire string. I'm not sure if other OMeta implementations behave this way or not.