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

fix: lambdas and parens, multiple indents #347

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

ludamad
Copy link

@ludamad ludamad commented Dec 30, 2024

Closes #346

Background: Thanks for making this tool. Lambda bugs were getting in the way in some cases, and I'd like to adopt it.
It seems INDENT and DEDENT were not emitted inside a lambda, other than one level deep.
I dove in and tried to fix it. The big test suite was a help as I thought I was done a few times.

I still noticed edge-cases with lambda, but mostly stuff like

var a = {
   f = func():  for x in y: print("hey")
}

which I looked at and had some ideas, like generating a virtual newline, but am leaving it here as I can work the codebase into shape now within the edge-cases

@@ -255,18 +255,8 @@ _lambda_suite: _lambda_body
| _standalone_lambda_stmt
_lambda_body: _NL _INDENT _func_stmt+ _DEDENT
_standalone_lambda_stmt: _simple_func_stmt
// | annotation* compound_lambda_stmt
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

opinionated, but I think fixing compound func stmt is the way to go and this works some of the time. could def revert this part tho

@ludamad ludamad changed the title fix: fix: lambdas and parens, multiple indents Dec 30, 2024
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.

lambdas as expressions are incomplete
1 participant