[PATCH -perfbook 1/3] punctcheck.pl: Add pattern to catch reverse use of period marker

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



End-of-sentence markers ("\@.", "\@?", etc.) make sense when they
follow uppercase letters.
Mid-sentence markers (".\@", "?\@", etc. ) make sense when they
follow lowercase letters.

Add patterns to cache misuses of them.

Signed-off-by: Akira Yokosawa <akiyks@xxxxxxxxx>
---
 utilities/punctcheck.pl | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/utilities/punctcheck.pl b/utilities/punctcheck.pl
index 7d23cc57..8820bf9c 100755
--- a/utilities/punctcheck.pl
+++ b/utilities/punctcheck.pl
@@ -91,6 +91,12 @@ sub check_line {
 	if ($line =~ /^(?=[\s]*+[^%])[^%]*\\\@[\.\?\!\:][\)\}\']*\s+[^%]/){
 	    $ng += 1;
 	}
+	if ($line =~ /[a-z][\)\}\']*\\\@[\.\?\!\:][\)\}\']*\s/) {
+	    $ng += 1;
+	}
+	if ($line =~ /[A-Z][\)\}\']*[\.\?\!\:]\\\@[\)\}\']*\s/) {
+	    $ng += 1;
+	}
 	if ($ng) {
 	    print $ARGV[0], ':', $line_num, ':', $line_raw;
 	}
-- 
2.25.1





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux