From c9fe99db93d99b020ef5796d5e4f829ec32af5e7 Mon Sep 17 00:00:00 2001 From: Pascal Obry Date: Thu, 7 Feb 2008 19:53:23 +0100 Subject: [PATCH] Relax check comment eol dot rule to allow ellipse. Update corresponding non regression test. --- regtests/pck.ads | 2 +- src/style_checker.adb | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/regtests/pck.ads b/regtests/pck.ads index d176574..ea67fd9 100644 --- a/regtests/pck.ads +++ b/regtests/pck.ads @@ -27,7 +27,7 @@ package Pck is use Ada.Strings.Unbounded; Syntax_Error : exception; - -- Raised when a syntax error is found + -- Raised when a syntax error is found... Max_Parameters : constant := 30; -- Maximum number of parameters that can be specified for a style checker diff --git a/src/style_checker.adb b/src/style_checker.adb index df7d599..5fa76c6 100644 --- a/src/style_checker.adb +++ b/src/style_checker.adb @@ -230,6 +230,7 @@ procedure Style_Checker is --------------------------- procedure Check_Comment_Dot_EOL is + Pos : Natural; begin if not Checker.Lang.Get_Comment_Dot_EOL and then Checker.Lang.Comment /= "" @@ -238,8 +239,11 @@ procedure Style_Checker is -- This is a comment Checker.Consecutive_Comment := Checker.Consecutive_Comment + 1; - if Line - (Fixed.Index_Non_Blank (Line, Going => Backward)) = '.' + Pos := Fixed.Index_Non_Blank (Line, Going => Backward); + + if Line (Pos) = '.' + and then Pos > Line'First + 1 + and then Line (Pos - 2 .. Pos - 1) /= ".." then Checker.Last_Comment_Dot_EOL := True; else -- 2.11.4.GIT