OCaml Forge
SCM

Detail: [#1006] record 'with' indentation

Bugs: Browse | Download .csv | Monitor

[#1006] record 'with' indentation

Date:
2011-07-05 19:17
Priority:
3
State:
Closed
Submitted by:
Sean McLaughlin (seanmcl)
Assigned to:
Sean McLaughlin (seanmcl)
Hardware:
None
Resolution:
Fixed
Severity:
None
Version:
None
Component:
None
Operating System:
None
Product:
None
 
URL:
Summary:
record 'with' indentation

Detailed description
Hey, I've noticed what I think is less than optimal behavior with
regards to indentation of records. In particular, I like to write
records with semicolons on the left, e.g.:

let record =
{ x = 3
; y = ()
; z = "foo"
}
in
...

which tuareg indents just fine. However, if I instead try to use a with
statement, it looks more like this:

let record =
{ record with
x = 3
; y = 5
; z = "foo"
}
in

Followup

Message
Date: 2013-08-16 18:58
Sender: Sean McLaughlin

Thanks!
Date: 2011-12-08 20:09
Sender: Christophe Troestler

New indentation code is present under SVN which corrects this. Please test with

(setq tuareg-use-smie t)

in your ~/.emacs

Note that such an expression should not occur at the toplevel (it will be badly indented if you try) but

let () =
let record =
{ record with
x = 3
; y = 5
; z = "foo"
}
in
zzz

indents fine.

Attached Files:

Changes:

Field Old Value Date By
status_idOpen2013-08-16 12:38chris
close_dateNone2013-08-16 12:38chris
ResolutionNone2013-08-16 12:38chris