-
Notifications
You must be signed in to change notification settings - Fork 137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#Iterate could check that segment shouldn't repeat #126
Comments
irobayna
added a commit
that referenced
this issue
Dec 8, 2018
Throw exception from #iterate if segment is not repeatable (fix #126)
kputnam
added a commit
that referenced
this issue
Jan 13, 2019
kputnam
added a commit
that referenced
this issue
Jan 13, 2019
kputnam
added a commit
that referenced
this issue
Jan 13, 2019
irobayna
added a commit
that referenced
this issue
Jan 13, 2019
Fix repeatability test in Navigation#iterate (#126)
kputnam
added a commit
that referenced
this issue
Jan 18, 2019
kputnam
added a commit
that referenced
this issue
Feb 12, 2019
specs for IdentifierStack and fix a bug; Change Navigation#elementn to strictly validate its arguments, even when corresponding data is not present; Fix validation in Navigation#iterate (#126); Write many more specs
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There's a small issue that I think enough people have encountered (probably not realizing it), that it would be helpful to beginners if it was fixed:
foo.iterate(:XYZ)
doesn't actually check thatXYZ
is a repeating segment.If
XYZ
is not repeating (according to the grammar), then in cases where it findsXYZ
the first time, it will throw an exception at the end of the given block when it tries to do anotherfind
-- "XYZ cannot be reached from this state". That's a confusing error because it appears that did find XYZ!In the other case is that it didn't find
XYZ
, it doesn't throw an exception that you shouldn't have usediterate
... it's kind of a bug waiting to happen when you eventually have a file that did have anXYZ
.I think we could change the definition of
iterate
by adding a test at the start, before callingfind
. This seems like a small change that would be good for a contributor to work on, and I think there's some code already (somewhere?) that checks if a segment is repeatable and throws an error if it's not... try searching forrepeatable?
. It might be in the Guide Builder code.The text was updated successfully, but these errors were encountered: