Skip to content

extra white space in code blocks is stripped #14

@dustmop

Description

@dustmop
            code:
              load("dataframe.star", "dataframe")
              # create a new DataFrame
              df = dataframe.DataFrame([["cat", "meow"],
                                        ["dog", "bark"],
                                        ["eel", "zap"]],
                                       columns=["name", "sound"])

The parser removes all of the whitespace from the left-hand side here. This is especially bad for python, which has semantically meaningful whitespace. Conditionals won't work at all:

  if a > b:
    print('ok')

Instead, I feel like the parser should be preserving all whitespace on the left-hand side, and can tell when the block is done by finding a line with the same indentation amount as the code: label.

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