Skip to content

starlark: Treat newlines as tokens - #46

Merged
robinlinden merged 1 commit into
masterfrom
sl-newline
May 18, 2026
Merged

starlark: Treat newlines as tokens#46
robinlinden merged 1 commit into
masterfrom
sl-newline

Conversation

@robinlinden

Copy link
Copy Markdown
Owner

This helps break up statements and fixes cases like

foo = bar
[2]

that previously would be parsed as foo = bar[2].

The grammar reference says that newlines are only allowed around statements, but that's definitely not the case. Our implementation is a lot stricter about this than Bazel, but it handles everything we use in this repo.

This helps break up statements and fixes cases like

    foo = bar
    [2]

that previously would be parsed as `foo = bar[2]`.

The grammar reference says that newlines are only allowed around
statements, but that's definitely not the case. Our implementation is a
lot stricter about this than Bazel, but it handles everything we use in
this repo.
Comment thread starlark/parser.h
@robinlinden
robinlinden merged commit 6b02651 into master May 18, 2026
9 checks passed
@robinlinden
robinlinden deleted the sl-newline branch May 18, 2026 21:56
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

Successfully merging this pull request may close these issues.

2 participants