From b30c30d500bf617a0bc0ea77fe5b80dabbb00df0 Mon Sep 17 00:00:00 2001 From: Tomasz Obrebski Date: Tue, 19 Nov 2013 13:31:38 +0100 Subject: [PATCH] =?UTF-8?q?tre=20czyta=20poprawnie=20wyj=C5=9Bcie=20z=20dg?= =?UTF-8?q?p?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/tre/tre | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/tre/tre b/src/tre/tre index 5ab399a..b248ca7 100755 --- a/src/tre/tre +++ b/src/tre/tre @@ -277,11 +277,11 @@ def parsegraph(nodes) $len[i] = dgp[1].to_i $sat << i if parts[1]=="s" - $arcs |= parts[2].split(',').map{ |a| case a - when /\-\-(\w+)-(\d+)\((\d+)~(\d+)\)/ + $arcs |= parts[2].scan(/\([^()]+\)/).map{ |a| case a + when /\-\-(\w+):(\d+)/ # [i, $2.to_i, $1, $3.to_i, $4.to_i] [i, $2.to_i, $1, 0, 0] - when /\+\+(\w+)-(\d+)\((\d+)~(\d+)\)/ + when /\+\+(\w+):(\d+)/ # [$2.to_i, i, $1, $3.to_i, $4.to_i] [$2.to_i, i, $1, 0, 0] end } @@ -379,6 +379,7 @@ end def buildR(min, max, tree) if $DEBUG then print "buildR--#{min}--#{max}--#{tree.inspect}\n" end trees=[] + print $arcs for arc in $arcs.select{|a| a[0]==max && $vis.include?([min,a[1]]) } if $DEBUG then print "ARC: #{arc.inspect}\n" end for r in buildR(arc[1],arc[0],tree+[arc]) #!!! buildR(a[1],a[3],tree+[a])