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

Indentation and Dedentation #50

Open
Cormanz opened this issue Apr 7, 2022 · 3 comments
Open

Indentation and Dedentation #50

Cormanz opened this issue Apr 7, 2022 · 3 comments

Comments

@Cormanz
Copy link

Cormanz commented Apr 7, 2022

Hi, I want to make a grammar with Python-style indentation. In Python:

def stuff():
    if True:
        if True:
            for i in range(2):
                print(i)
    print("YAY")

How would I make INDENT and DEDENT tokens using better-parse? I couldn't find any better-parse examples or tests showcasing how to do this.

@OnufryKlaczynski
Copy link

Hey, Have you figured it out how to do it?

@Cormanz
Copy link
Author

Cormanz commented Apr 15, 2023

I wasn't able to unfortunately.

@h0tk3y
Copy link
Owner

h0tk3y commented Apr 16, 2023

@Cormanz @OnufryKlaczynski
Please take a look at this comment: #63 (comment)
I hope it helps, let me know if it does!

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

3 participants