quantified-uncertainty / squiggle

An estimation language
https://squiggle-language.com
MIT License
155 stars 23 forks source link

Code formatting fails on pipe + method #3192

Open OAGr opened 7 months ago

OAGr commented 7 months ago

Description of suggestion or shortcoming:

xs = (foobar -> Danger.json).pointSet.continuous.xyShape.xs

->

xs = foobar -> Danger.json.pointSet.continuous.xyShape.xs

A better example:

foo = {a: {b: {c: 3}}}

xs = (foo -> {|f| f.a}).b
OAGr commented 7 months ago

On that note, it could be neat to force-test the formatter, by using GPT4 to create a bunch of valid Squiggle programs, then making sure that all have the same AST after being formatted.

This error is fairly scary.

(Also, I agree about wanting to have a check for this, and not formatting if that happens)