Skip to content

Fix lambda with comment#125

Merged
da-h merged 2 commits intov5-devfrom
fix_lambda_with_comment
Dec 20, 2022
Merged

Fix lambda with comment#125
da-h merged 2 commits intov5-devfrom
fix_lambda_with_comment

Conversation

@da-h
Copy link
Copy Markdown
Owner

@da-h da-h commented Dec 20, 2022

FEATURENAME

This PR fixes another bug regarding the new feature introduced in #121:
Registration of state variables with lambda expression that end with a comment do not work.

Additionally, this PR adds a test case for this bug.

Description

The problem was that the defining source code is parsed by placing them in a dictionary (just as they are defined in code as well).
Internally, the line gets placed in { and } before compiling it to an ast.

New Behavior:
The solution is to simply add line-breaks before placing it in a dictionary-code block ({, }).

Check all before creating this PR:

  • Documentation adapted
  • unit tests adapted / created

@da-h da-h requested a review from sbrodehl December 20, 2022 13:11
Comment thread tests/state/dependencies/modules/defarguments_module1/__init__.py Outdated
@da-h da-h force-pushed the fix_lambda_with_comment branch from 0423491 to a75af9c Compare December 20, 2022 13:39
@da-h da-h merged commit f287ba5 into v5-dev Dec 20, 2022
@da-h da-h deleted the fix_lambda_with_comment branch December 21, 2022 09:33
@da-h da-h mentioned this pull request Jan 9, 2023
6 tasks
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