Closed igravious closed 7 years ago
Can't find this in the docs anywhere.
I don't mean the ability to match EOF, I mean the ability to match the empty string anywhere.
EOF
Most useful for specifying things like, str('⊢') >> space? >> (foo | ε) >> str(':') >> space? >> (foo | ε) for instance. This would match either, str('⊢') >> space? >> str(':') >> space? or str('⊢') >> space? >> foo >> str(':') >> space? or str('⊢') >> space? >> str(':') >> space? >> foo or str('⊢') >> space? >> foo >> str(':') >> space? >> foo
str('⊢') >> space? >> (foo | ε) >> str(':') >> space? >> (foo | ε)
str('⊢') >> space? >> str(':') >> space?
str('⊢') >> space? >> foo >> str(':') >> space?
str('⊢') >> space? >> str(':') >> space? >> foo
str('⊢') >> space? >> foo >> str(':') >> space? >> foo
Have I overlooked something?
Thanks for an amazing tool, am having great fun with it and I have a possibly very interesting feature suggestion (or two)!
foo.maybe
maybe? :smile:
Yeah, that would be foo.maybe.
Will I submit a PR for | ε as syntactic sugar and also to nudge it into line with standard notation?
| ε
I would welcome that.
Can't find this in the docs anywhere.
I don't mean the ability to match
EOF
, I mean the ability to match the empty string anywhere.Most useful for specifying things like,
str('⊢') >> space? >> (foo | ε) >> str(':') >> space? >> (foo | ε)
for instance. This would match either,str('⊢') >> space? >> str(':') >> space?
orstr('⊢') >> space? >> foo >> str(':') >> space?
orstr('⊢') >> space? >> str(':') >> space? >> foo
orstr('⊢') >> space? >> foo >> str(':') >> space? >> foo
Have I overlooked something?
Thanks for an amazing tool, am having great fun with it and I have a possibly very interesting feature suggestion (or two)!