robrix / Madness

Recursive Descent Into Madness
MIT License
291 stars 17 forks source link

Repetition by closed intervals #60

Closed robrix closed 9 years ago

robrix commented 9 years ago
x * 1...3

will often read more naturally than

x * 1..<4
davidcairns commented 9 years ago

If x * 2..<2 means that it parses exactly two times, then what does x * 2...2 mean? The same thing?

robrix commented 9 years ago

Hm, good point—we’re probably actually conflating things a bit. for each in 2..<2 { println(each) } won’t print at all, whereas using 2...2 will print 2; in keeping with that, repetition by empty half-closed intervals should probably be an error.

davidcairns commented 9 years ago

Alright, changed the semantics for ..<, and added support for .... Now, back to paying work!

davidcairns commented 9 years ago

Got the work in a merge request over here: https://github.com/robrix/Madness/pull/62

robrix commented 9 years ago

Fixed by #63.