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

Allow trailing commas, or find distinction between blocks and dicts with one element. #2944

Closed
OAGr opened this issue Jan 9, 2024 · 0 comments · Fixed by #2946
Closed

Allow trailing commas, or find distinction between blocks and dicts with one element. #2944

OAGr opened this issue Jan 9, 2024 · 0 comments · Fixed by #2946
Labels
Language Regarding Squiggle language semantics, distributions and function registry

Comments

@OAGr
Copy link
Contributor

OAGr commented Jan 9, 2024

Description of suggestion or shortcoming:

From: https://squigglehub.org/models/mlao-pdx/trailing-comma

The issue shows up in the last two assignments of this script (mlao-pdx/trailing-comma):

    Run as-is, and all is good
    Format the code, and it removes the unnecessary block from line 32, and removes the trailing commas from lines 29 and 35, but leaves the block.
    Runtime error occurs on line 35 as a block is not a dictionary and cannot be merged
    Format again, and the block disappears as it did for db.
    Runtime error occurs on line 35 as an expression is not a dictionary and cannot be merged
    By now it is difficult to detect what actually happened...
    Request/suggestion:
        Allow trailing commas, because:
        Easy single attribute dictionaries
        Multi-entry dictionaries and lists re-ordering without juggling trailing commas
@OAGr OAGr added the Language Regarding Squiggle language semantics, distributions and function registry label Jan 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Language Regarding Squiggle language semantics, distributions and function registry
Projects
Archived in project
1 participant