brownplt / code.pyret.org

Website for serving Pyret to folks.
Other
24 stars 45 forks source link

Testing and indentation #252

Closed sorawee closed 6 years ago

sorawee commented 6 years ago

I think the sensible indentation here is like this:

check:
  some-function-call(some-parameter)
    is [list:
      [list: 1, 2, 3, 4],
      [list: 1, 2, 3],
    ]
end

Or:

check:
  some-function-call(some-parameter)
    satisfies lam(v):
      blah
    end
end

But currently it's like this:

check:
  some-function-call(some-parameter)
    is [list:
    [list: 1, 2, 3, 4],
    [list: 1, 2, 3],
  ]
end

check:
  some-function-call(some-parameter)
    satisfies lam(v):
    blah
  end
end
blerner commented 6 years ago

Closing as wont-fix: this isn't technically feasible with the indenter (because it requires a full parse to figure out where the end of the expression is, which is information we do not have), and it violates the current uniformity principle, that if you add newlines within a multi-line expression, later lines don't need to reindent.