Skip to content
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

Question upon parsing #178

Open
manfredlotz opened this issue Feb 27, 2021 · 0 comments
Open

Question upon parsing #178

manfredlotz opened this issue Feb 27, 2021 · 0 comments

Comments

@manfredlotz
Copy link

This is Fedora 33, Python 3.9.1 and parsimonious-0.8.1.

Looking at the sample

from parsimonious.grammar import Grammar grammar = Grammar(
    """
    bold_text  = bold_open text bold_close
    text       = ~"[A-Z 0-9]*"i
    bold_open  = "(("
    bold_close = "))"
""")

print(grammar.parse('((bold stuff))'))

I am wondering how I would specify the grammar if I would allow single ( and ) in text so that for example

print(grammar.parse('((bold (or something) stuff))'))

could be parsed.

Thanks a lot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant