robrix / Madness

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

Postfix 0-or-1 repetition operator #38

Closed robrix closed 9 years ago

robrix commented 9 years ago

This would be ? in regexp but we can’t use a single postfix ? because it’s reserved for optional chaining.

Postfix ?? is available, as are other names like |? (I read this kind of as “or nothing” which is apt).

robrix commented 9 years ago

Probably should avoid ?? because that means “zero or one ungreedily” in some regexp dialects.

robrix commented 9 years ago

@jspahrsummers employed postfix |? in ogdl-swift, and I dig it.