Mantis - Mascot
Erweiterte Problemanzeige
77 general kleinerer Fehler nicht getestet 2011-08-08 16:21 2012-08-29 20:17
sigonnea  
xclerc  
normal  
erledigt 1.0-beta  
erledigt  
keine    
keine 1.0  
0000077: Do not treat (-1) as an error
(-1) raises an error because the '-' sign is not preceeded by whitespace.
Below is a small patch that corrects this:

diff --git a/src/checks/typo_spacesAroundOperators.ml b/src/checks/typo_spacesAroundOperators.ml
index 5ca5ac0..99758b7 100644
--- a/src/checks/typo_spacesAroundOperators.ml
+++ b/src/checks/typo_spacesAroundOperators.ml
@@ -38,13 +38,20 @@ let limits =
 
 let parameters = Parameter.empty_map
 
+let opening = function
+ | Camlp4.Sig.SYMBOL "("
+ | Camlp4.Sig.SYMBOL "["
+ | Camlp4.Sig.SYMBOL "[|" -> true
+ | _ -> false
+
+
 let run _ _ (_, tokens) _ report =
   let rec iter = function
     | (_, _, prev) :: (line, column, (Camlp4.Sig.SYMBOL s)) :: tl ->
         let err = report.Check.error line (Some column) in
         let len = String.length s in
         (match s.[0] with
- | '-' | '~' ->
+ | '~' | '-' when not (opening prev) ->
             Camlp4Utils.check_white "operator" s err prev
         | '$' | '%' | '&' | '*' | '+' | '/' | '<' | '=' | '>' | '@' | '^' | '|' ->
             Camlp4Utils.check_white "operator" s err prev;
Problem-Historie
2011-08-08 16:21 sigonnea Neues Problem
2012-08-29 20:17 xclerc Status neu => erledigt
2012-08-29 20:17 xclerc Behoben in Version => 1.0
2012-08-29 20:17 xclerc Lösung offen => erledigt
2012-08-29 20:17 xclerc Bearbeitung durch => xclerc

Zu diesem Problem gibt es keine Notizen.