Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Setting comma for back-alignment, and some tweaking

  • Loading branch information...
commit 5c1df557afa9eeb4158632a1808558071cc45eb8 1 parent 83d85fe
@AltGr AltGr authored
View
6 src/indentBlock.ml
@@ -346,13 +346,13 @@ let op_prio_align_indent config =
(* anything else : -10 *)
(* in -> : 0 *)
| SEMI -> prio_semi,L,-2
- | AS -> 8,L,config.i_base
+ | AS -> 8,L,0
(* special negative indent is only honored at beginning of line *)
(* then else : 10 *)
| BAR -> 10,T,-2
| OF -> 20,L,2
| LESSMINUS | COLONEQUAL -> 20,L,config.i_base
- | COMMA -> 30,L,0
+ | COMMA -> 30,L,-2
| MINUSGREATER -> 32,L,0 (* is an operator only in types *)
| COLON | COLONGREATER -> 35,L,config.i_base
| OR | BARBAR -> 40,T,0
@@ -425,7 +425,7 @@ let rec update_path config t stream tok =
| _ -> assert false
in
let l = paren.t + paren_len + 1 (* usually 1 space *) + pad in
- Some ({ h with k; l; t=l } :: p)
+ Some ({ h with k; l; t=l; pad = max h.pad (h.l-l) } :: p)
| _ ->
match k,h.k with
| KExpr pk, KExpr ph when ph = pk ->
View
20 tests/failing-output/js-type.ml
@@ -28,7 +28,7 @@ val instances
-> (App.t * Config.instance * Config.app) list
-> verbose:bool
-> 'm
- , 'm
+ , 'm
) Command.Spec.t
(* jmcarthur *)
@@ -37,7 +37,7 @@ val instances
-> ( Config.Network.t
-> (App.t * Config.instance * Config.app) list
-> verbose:bool -> 'm
- , 'm
+ , 'm
) Command.Spec.t
(* pszilagyi: Here's, I believe, a representative alternative that uses
@@ -45,7 +45,7 @@ val instances
val instances : unit -> ( Config.Network.t
-> (App.t * Config.instance * Config.app) list
-> verbose:bool -> 'm
- , 'm
+ , 'm
) Command.Spec.t
(* a presumably analogous version with the arrows at ends of lines *)
@@ -53,7 +53,7 @@ val instances : unit -> ( Config.Network.t ->
(App.t * Config.instance * Config.app) list ->
verbose:bool ->
'm
- , 'm
+ , 'm
) Command.Spec.t
(* presumed analogs with stars *)
@@ -61,20 +61,20 @@ val instances : unit * ( Config.Network.t *
(App.t * Config.instance * Config.app) list *
verbose:bool *
'm
- , 'm
+ , 'm
) Command.Spec.t
val instances : unit * ( Config.Network.t
* (App.t * Config.instance * Config.app) list
* verbose:bool
* 'm
- , 'm
+ , 'm
) Command.Spec.t
(* analogous value expressions, analogous to lists, some different from now *)
let _ = ( x
- , y
+ , y
)
let _ = [ x
; y
@@ -87,7 +87,7 @@ let _ = [ x;
]
let _ =
( x
- , y
+ , y
)
let _ =
( x,
@@ -96,7 +96,7 @@ let _ =
let _ =
(
x
- , y
+ , y
)
let _ =
[
@@ -113,7 +113,7 @@ let _ = [
]
let _ = (
x
- , y
+, y
)
let _ = [
x
View
94 tests/failing.html
@@ -2,7 +2,7 @@
"http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
- <title>Failing tests, ocp-indent version 1.0.2+10 (2013-03-19)</title>
+ <title>Failing tests, ocp-indent version 1.0.2+14 (2013-03-20)</title>
<style>
BODY { font-family: monospace; }
TABLE { border-collapse: collapse; border-spacing: 0px; margin: auto; }
@@ -22,14 +22,14 @@
</style>
</head>
<body>
-<h1>Failing tests, ocp-indent version 1.0.2+10 (2013-03-19)</h1>
+<h1>Failing tests, ocp-indent version 1.0.2+14 (2013-03-20)</h1>
<p>Left is expected result, right shows actual indentation by ocp-indent</p>
<table>
<tr><td width="70%">
<table>
<tr>
<td class="modified">Modified line(s):&nbsp;</td>
- <td class="modified"><a href='#failing/js-type.ml_28'>28</a>&nbsp; <a href='#failing/js-type.ml_29'>29</a>&nbsp; <a href='#failing/js-type.ml_30'>30</a>&nbsp; <a href='#failing/js-type.ml_31'>31</a>&nbsp; <a href='#failing/js-type.ml_32'>32</a>&nbsp; <a href='#failing/js-type.ml_38'>38</a>&nbsp; <a href='#failing/js-type.ml_39'>39</a>&nbsp; <a href='#failing/js-type.ml_40'>40</a>&nbsp; <a href='#failing/js-type.ml_41'>41</a>&nbsp; <a href='#failing/js-type.ml_46'>46</a>&nbsp; <a href='#failing/js-type.ml_47'>47</a>&nbsp; <a href='#failing/js-type.ml_48'>48</a>&nbsp; <a href='#failing/js-type.ml_49'>49</a>&nbsp; <a href='#failing/js-type.ml_53'>53</a>&nbsp; <a href='#failing/js-type.ml_54'>54</a>&nbsp; <a href='#failing/js-type.ml_55'>55</a>&nbsp; <a href='#failing/js-type.ml_56'>56</a>&nbsp; <a href='#failing/js-type.ml_57'>57</a>&nbsp; <a href='#failing/js-type.ml_61'>61</a>&nbsp; <a href='#failing/js-type.ml_62'>62</a>&nbsp; <a href='#failing/js-type.ml_63'>63</a>&nbsp; <a href='#failing/js-type.ml_64'>64</a>&nbsp; <a href='#failing/js-type.ml_65'>65</a>&nbsp; <a href='#failing/js-type.ml_67'>67</a>&nbsp; <a href='#failing/js-type.ml_68'>68</a>&nbsp; <a href='#failing/js-type.ml_69'>69</a>&nbsp; <a href='#failing/js-type.ml_70'>70</a>&nbsp; <a href='#failing/js-type.ml_71'>71</a>&nbsp; <a href='#failing/js-type.ml_77'>77</a>&nbsp; <a href='#failing/js-type.ml_78'>78</a>&nbsp; <a href='#failing/js-type.ml_83'>83</a>&nbsp; <a href='#failing/js-type.ml_84'>84</a>&nbsp; <a href='#failing/js-type.ml_90'>90</a>&nbsp; <a href='#failing/js-type.ml_99'>99</a>&nbsp; <a href='#failing/js-type.ml_116'>116</a>&nbsp; </td>
+ <td class="modified"><a href='#failing/js-type.ml_28'>28</a>&nbsp; <a href='#failing/js-type.ml_29'>29</a>&nbsp; <a href='#failing/js-type.ml_30'>30</a>&nbsp; <a href='#failing/js-type.ml_32'>32</a>&nbsp; <a href='#failing/js-type.ml_38'>38</a>&nbsp; <a href='#failing/js-type.ml_39'>39</a>&nbsp; <a href='#failing/js-type.ml_41'>41</a>&nbsp; <a href='#failing/js-type.ml_46'>46</a>&nbsp; <a href='#failing/js-type.ml_47'>47</a>&nbsp; <a href='#failing/js-type.ml_49'>49</a>&nbsp; <a href='#failing/js-type.ml_53'>53</a>&nbsp; <a href='#failing/js-type.ml_54'>54</a>&nbsp; <a href='#failing/js-type.ml_55'>55</a>&nbsp; <a href='#failing/js-type.ml_57'>57</a>&nbsp; <a href='#failing/js-type.ml_61'>61</a>&nbsp; <a href='#failing/js-type.ml_62'>62</a>&nbsp; <a href='#failing/js-type.ml_63'>63</a>&nbsp; <a href='#failing/js-type.ml_65'>65</a>&nbsp; <a href='#failing/js-type.ml_67'>67</a>&nbsp; <a href='#failing/js-type.ml_68'>68</a>&nbsp; <a href='#failing/js-type.ml_69'>69</a>&nbsp; <a href='#failing/js-type.ml_71'>71</a>&nbsp; <a href='#failing/js-type.ml_78'>78</a>&nbsp; <a href='#failing/js-type.ml_83'>83</a>&nbsp; <a href='#failing/js-type.ml_84'>84</a>&nbsp; </td>
</tr>
<tr>
<td class="added">Added line(s):&nbsp;</td>
@@ -62,15 +62,15 @@
<td>
121 lines<br/>
3212 bytes<br/>
- Last modified : 2013-03-14 10:13:01 <br>
+ Last modified : 2013-03-15 11:34:16 <br>
<hr/>
</td>
<td width="16">&nbsp;</td>
<td width="16">&nbsp;</td>
<td>
121 lines<br/>
- 2775 bytes<br/>
- Last modified : 2013-03-14 17:55:34 <br>
+ 2855 bytes<br/>
+ Last modified : 2013-03-20 11:47:40 <br>
<hr/>
</td>
</tr>
@@ -284,12 +284,12 @@
<td class="linenum">30</td>
<td class="modified">&nbsp;&nbsp;&nbsp;&nbsp;-&gt; 'm</td>
</tr>
- <tr>
- <td class="linenum"><a name="failing/js-type.ml_31">31</a></td>
- <td class="modified">&nbsp;&nbsp;&nbsp;&nbsp; , 'm</td>
+ <tr>
+ <td class="linenum">31</td>
+ <td class="normal">&nbsp;&nbsp;&nbsp;&nbsp; , 'm</td>
<td width="16">&nbsp;</td>
<td class="linenum">31</td>
- <td class="modified">&nbsp;&nbsp;&nbsp;&nbsp;, 'm</td>
+ <td class="normal">&nbsp;&nbsp;&nbsp;&nbsp; , 'm</td>
</tr>
<tr>
<td class="linenum"><a name="failing/js-type.ml_32">32</a></td>
@@ -347,12 +347,12 @@
<td class="linenum">39</td>
<td class="modified">&nbsp;&nbsp;&nbsp;&nbsp;-&gt; verbose:bool -&gt; 'm</td>
</tr>
- <tr>
- <td class="linenum"><a name="failing/js-type.ml_40">40</a></td>
- <td class="modified">&nbsp;&nbsp;&nbsp;&nbsp; , 'm</td>
+ <tr>
+ <td class="linenum">40</td>
+ <td class="normal">&nbsp;&nbsp;&nbsp;&nbsp; , 'm</td>
<td width="16">&nbsp;</td>
<td class="linenum">40</td>
- <td class="modified">&nbsp;&nbsp;&nbsp;&nbsp;, 'm</td>
+ <td class="normal">&nbsp;&nbsp;&nbsp;&nbsp; , 'm</td>
</tr>
<tr>
<td class="linenum"><a name="failing/js-type.ml_41">41</a></td>
@@ -403,12 +403,12 @@
<td class="linenum">47</td>
<td class="modified">&nbsp;&nbsp;&nbsp;&nbsp;-&gt; verbose:bool -&gt; 'm</td>
</tr>
- <tr>
- <td class="linenum"><a name="failing/js-type.ml_48">48</a></td>
- <td class="modified">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;, 'm</td>
+ <tr>
+ <td class="linenum">48</td>
+ <td class="normal">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;, 'm</td>
<td width="16">&nbsp;</td>
<td class="linenum">48</td>
- <td class="modified">&nbsp;&nbsp;&nbsp;&nbsp;, 'm</td>
+ <td class="normal">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;, 'm</td>
</tr>
<tr>
<td class="linenum"><a name="failing/js-type.ml_49">49</a></td>
@@ -459,12 +459,12 @@
<td class="linenum">55</td>
<td class="modified">&nbsp;&nbsp;&nbsp;&nbsp;'m</td>
</tr>
- <tr>
- <td class="linenum"><a name="failing/js-type.ml_56">56</a></td>
- <td class="modified">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;, 'm</td>
+ <tr>
+ <td class="linenum">56</td>
+ <td class="normal">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;, 'm</td>
<td width="16">&nbsp;</td>
<td class="linenum">56</td>
- <td class="modified">&nbsp;&nbsp;&nbsp;&nbsp;, 'm</td>
+ <td class="normal">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;, 'm</td>
</tr>
<tr>
<td class="linenum"><a name="failing/js-type.ml_57">57</a></td>
@@ -515,12 +515,12 @@
<td class="linenum">63</td>
<td class="modified">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'m</td>
</tr>
- <tr>
- <td class="linenum"><a name="failing/js-type.ml_64">64</a></td>
- <td class="modified">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; , 'm</td>
+ <tr>
+ <td class="linenum">64</td>
+ <td class="normal">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; , 'm</td>
<td width="16">&nbsp;</td>
<td class="linenum">64</td>
- <td class="modified">&nbsp;&nbsp;&nbsp;&nbsp;, 'm</td>
+ <td class="normal">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; , 'm</td>
</tr>
<tr>
<td class="linenum"><a name="failing/js-type.ml_65">65</a></td>
@@ -557,12 +557,12 @@
<td class="linenum">69</td>
<td class="modified">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;* 'm</td>
</tr>
- <tr>
- <td class="linenum"><a name="failing/js-type.ml_70">70</a></td>
- <td class="modified">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; , 'm</td>
+ <tr>
+ <td class="linenum">70</td>
+ <td class="normal">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; , 'm</td>
<td width="16">&nbsp;</td>
<td class="linenum">70</td>
- <td class="modified">&nbsp;&nbsp;&nbsp;&nbsp;, 'm</td>
+ <td class="normal">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; , 'm</td>
</tr>
<tr>
<td class="linenum"><a name="failing/js-type.ml_71">71</a></td>
@@ -606,12 +606,12 @@
<td class="linenum">76</td>
<td class="normal">let _ = ( x</td>
</tr>
- <tr>
- <td class="linenum"><a name="failing/js-type.ml_77">77</a></td>
- <td class="modified">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;, y</td>
+ <tr>
+ <td class="linenum">77</td>
+ <td class="normal">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;, y</td>
<td width="16">&nbsp;</td>
<td class="linenum">77</td>
- <td class="modified">&nbsp;&nbsp;, y</td>
+ <td class="normal">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;, y</td>
</tr>
<tr>
<td class="linenum"><a name="failing/js-type.ml_78">78</a></td>
@@ -697,12 +697,12 @@
<td class="linenum">89</td>
<td class="normal">&nbsp;&nbsp;( x</td>
</tr>
- <tr>
- <td class="linenum"><a name="failing/js-type.ml_90">90</a></td>
- <td class="modified">&nbsp;&nbsp;, y</td>
+ <tr>
+ <td class="linenum">90</td>
+ <td class="normal">&nbsp;&nbsp;, y</td>
<td width="16">&nbsp;</td>
<td class="linenum">90</td>
- <td class="modified">&nbsp;&nbsp;&nbsp;&nbsp;, y</td>
+ <td class="normal">&nbsp;&nbsp;, y</td>
</tr>
<tr>
<td class="linenum">91</td>
@@ -760,12 +760,12 @@
<td class="linenum">98</td>
<td class="normal">&nbsp;&nbsp;&nbsp;&nbsp;x</td>
</tr>
- <tr>
- <td class="linenum"><a name="failing/js-type.ml_99">99</a></td>
- <td class="modified">&nbsp;&nbsp;, y</td>
+ <tr>
+ <td class="linenum">99</td>
+ <td class="normal">&nbsp;&nbsp;, y</td>
<td width="16">&nbsp;</td>
<td class="linenum">99</td>
- <td class="modified">&nbsp;&nbsp;&nbsp;&nbsp;, y</td>
+ <td class="normal">&nbsp;&nbsp;, y</td>
</tr>
<tr>
<td class="linenum">100</td>
@@ -879,12 +879,12 @@
<td class="linenum">115</td>
<td class="normal">&nbsp;&nbsp;x</td>
</tr>
- <tr>
- <td class="linenum"><a name="failing/js-type.ml_116">116</a></td>
- <td class="modified">, y</td>
+ <tr>
+ <td class="linenum">116</td>
+ <td class="normal">, y</td>
<td width="16">&nbsp;</td>
<td class="linenum">116</td>
- <td class="modified">&nbsp;&nbsp;, y</td>
+ <td class="normal">, y</td>
</tr>
<tr>
<td class="linenum">117</td>
@@ -923,6 +923,6 @@
</tr>
</table>
<hr/>
-<i>Generated by <b>diff2html</b> on 2013-03-19 15:32:25</i>
+<i>Generated by <b>diff2html</b> on 2013-03-20 11:47:42</i>
</body>
</html>
View
2  tests/passing/unit-values.ml
@@ -16,7 +16,7 @@ let f_over = 4611686018427387903e-1023, 4611686018427387903e+1024
(* tuples *)
let _ = (1, 2, 3, 4, 5,
1, 2, 3, 4, 5
- , 1, 2, 3, 4, 5)
+ , 1, 2, 3, 4, 5)
(* records *)
let _ = { f1 = 12; f2 = 13;
Please sign in to comment.
Something went wrong with that request. Please try again.