[Lemon-commits] Peter Kovacs: Print the failed line numbers in t...

Lemon HG hg at lemon.cs.elte.hu
Wed Oct 22 15:41:48 CEST 2008


details:   http://lemon.cs.elte.hu/hg/lemon/rev/d900fd1e760f
changeset: 341:d900fd1e760f
user:      Peter Kovacs <kpeter [at] inf.elte.hu>
date:      Mon Oct 20 12:46:39 2008 +0200
description:
	Print the failed line numbers in the unifier script (ticket #138)

diffstat:

4 files changed, 19 insertions(+), 9 deletions(-)
lemon/bfs.h              |    5 ++---
lemon/list_graph.h       |    4 ++--
lemon/smart_graph.h      |    4 ++--
scripts/unify-sources.sh |   15 +++++++++++++--

diffs (80 lines):

diff -r cdbff91c2166 -r d900fd1e760f lemon/bfs.h
--- a/lemon/bfs.h	Mon Oct 20 12:17:24 2008 +0200
+++ b/lemon/bfs.h	Mon Oct 20 12:46:39 2008 +0200
@@ -51,7 +51,7 @@
     typedef typename Digraph::template NodeMap<typename Digraph::Arc> PredMap;
     ///Instantiates a PredMap.
 
-    ///This function instantiates a PredMap.
+    ///This function instantiates a PredMap.  
     ///\param g is the digraph, to which we would like to define the
     ///PredMap.
     static PredMap *createPredMap(const Digraph &g)
@@ -80,8 +80,7 @@
 
     ///The type of the map that indicates which nodes are reached.
 
-    ///The type of the map that indicates which nodes are reached.
-    ///It must meet the \ref concepts::ReadWriteMap "ReadWriteMap" concept.
+    ///The type of the map that indicates which nodes are reached.///It must meet the \ref concepts::ReadWriteMap "ReadWriteMap" concept.
     typedef typename Digraph::template NodeMap<bool> ReachedMap;
     ///Instantiates a ReachedMap.
 
diff -r cdbff91c2166 -r d900fd1e760f lemon/list_graph.h
--- a/lemon/list_graph.h	Mon Oct 20 12:17:24 2008 +0200
+++ b/lemon/list_graph.h	Mon Oct 20 12:46:39 2008 +0200
@@ -840,8 +840,8 @@
       explicit Arc(int pid) { id = pid;}
 
     public:
-      operator Edge() const { 
-        return id != -1 ? edgeFromId(id / 2) : INVALID; 
+      operator Edge() const {
+        return id != -1 ? edgeFromId(id / 2) : INVALID;
       }
 
       Arc() {}
diff -r cdbff91c2166 -r d900fd1e760f lemon/smart_graph.h
--- a/lemon/smart_graph.h	Mon Oct 20 12:17:24 2008 +0200
+++ b/lemon/smart_graph.h	Mon Oct 20 12:46:39 2008 +0200
@@ -464,8 +464,8 @@
       explicit Arc(int id) { _id = id;}
 
     public:
-      operator Edge() const { 
-        return _id != -1 ? edgeFromId(_id / 2) : INVALID; 
+      operator Edge() const {
+        return _id != -1 ? edgeFromId(_id / 2) : INVALID;
       }
 
       Arc() {}
diff -r cdbff91c2166 -r d900fd1e760f scripts/unify-sources.sh
--- a/scripts/unify-sources.sh	Mon Oct 20 12:17:24 2008 +0200
+++ b/scripts/unify-sources.sh	Mon Oct 20 12:46:39 2008 +0200
@@ -88,13 +88,24 @@
 function check_action() {
     if ! diff -q $1 $2 >/dev/null
     then
-	echo -n " [$3 failed]"
+	echo
+	echo -n "      $3 failed at line(s): "
+	echo -n $(diff $1 $2 | grep '^[0-9]' | sed "s/^\(.*\)c.*$/ \1/g" | 
+	          sed "s/,/-/g" | paste -s -d',')
 	FAILED=YES
     fi
 }
 
 function check_warning() {
-    echo -n " [$2 warning]"
+    echo
+    if [ "$2" == 'long lines' ]
+    then
+        echo -n "      $2 warning at line(s): "
+        echo -n $(grep -n -E '.{81,}' $1 | sed "s/^\([0-9]*\)/ \1\t/g" | 
+                  cut -f 1 | paste -s -d',')
+    else
+        echo -n "      $2 warning"
+    fi
     WARNED=YES
 }
 



More information about the Lemon-commits mailing list