Mantis - Mascot
Erweiterte Problemanzeige
79 general kleinerer Fehler nicht getestet 2011-08-08 16:27 2012-08-29 20:16
sigonnea  
xclerc  
normal  
erledigt 1.0-beta  
erledigt  
keine    
keine 1.0  
0000079: Treat [< ... >] and [| ... |] blocks like { ... } blocks
Ocaml Programming Guidelines don't say anything about it, but :

  - arrays are printed with inner spaces by toplevel ;
  - some examples in ocaml documentation are written in this style
Below is a trivial patch that corrects this issue:

diff --git a/src/checks/typo_spacesAroundBlocks.ml b/src/checks/typo_spacesAroundBlocks.ml
index 1b8495b..4ed5614 100644
--- a/src/checks/typo_spacesAroundBlocks.ml
+++ b/src/checks/typo_spacesAroundBlocks.ml
@@ -84,17 +84,17 @@ let run _ _ (_, tokens) _ report =
     | (_, _, prev) :: (line, column, (Camlp4.Sig.SYMBOL s)) :: tl ->
         let err = report.Check.error line (Some column) in
         (match s with
- | "(" | "[" | "[|" ->
+ | "(" | "[" ->
             if symbol_kind prev <> Opening then
               Camlp4Utils.check_white "sign" s err prev;
             Camlp4Utils.check_first_not_white "sign" s err tl
- | ")" | "]" | "|]" ->
+ | ")" | "]" ->
             let prev_kind = symbol_kind prev in
             if (prev_kind <> Closing) && (prev_kind <> Opening) then
               Camlp4Utils.check_not_white "sign" s err prev;
             if not (first [Closing; Punctuation] tl) then
               Camlp4Utils.check_first_white "sign" s err tl
- | "{" | "}" ->
+ | "{" | "}" | "[|" | "|]" | "[<" | ">]" ->
             Camlp4Utils.check_white "sign" s err prev;
             if not (first [Closing; Punctuation] tl) then
               Camlp4Utils.check_first_white "sign" s err tl
Problem-Historie
2011-08-08 16:27 sigonnea Neues Problem
2012-08-29 20:16 xclerc Status neu => erledigt
2012-08-29 20:16 xclerc Behoben in Version => 1.0
2012-08-29 20:16 xclerc Lösung offen => erledigt
2012-08-29 20:16 xclerc Bearbeitung durch => xclerc

Zu diesem Problem gibt es keine Notizen.