Skip to content

Indentation and Dedentation #50

Description

@Cormanz

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions