Index: app/src/dgp/dgc
===================================================================
--- app/src/dgp/dgc	(revision 19dfa5cb763e0eab77888cefb54245f0e847cb94)
+++ app/src/dgp/dgc	(revision 12d8443b2c87b3744c2563b0c25c44f8350df006)
@@ -131,25 +131,28 @@
 while(<INPUT>)
 {
-    if(/^\s*AGR\s+(\S+)\s+(\S+)\s*$/)
+    s/#.*//;
+    s/^\s+//;
+    s/\s+$//;
+    if(/^AGR\s+(\S+)\s+(\S+)$/)
     {
 	push @{$agr{$1}}, $2;
     }
-    elsif(/^\s*GOV\s+(\S+)\s+(\S+)\s*$/)
+    elsif(/^GOV\s+(\S+)\s+(\S+)$/)
     {
 	push @{$gov{$1}}, attr::parse($2);
     }
-    elsif(/^\s*ROLE\s+\S+\s*$/)
+    elsif(/^ROLE\s+\S+$/)
     {
 	$roles{$_}=1;
-	print OUTPUT;
-    }
-    elsif(/^\s*SGL\s+\S+\s*$/)
+	print OUTPUT "$_\n";
+    }
+    elsif(/^SGL\s+\S+$/)
     {
 	++$nsgl;
-	print OUTPUT;
-    }
-    elsif(/^\s*REQ\s+(\S+)\s+(\S+)\s*$/)
-    {
-	print OUTPUT "#$_";
+	print OUTPUT "$_\n";
+    }
+    elsif(/^REQ\s+(\S+)\s+(\S+)$/)
+    {
+	print OUTPUT "#$_\n";
 	my $cat = attr::parse $1;
 	for my $atomcat (keys %cats)
@@ -162,17 +165,17 @@
 	}
     }
-    elsif(/^\s*LEFT\s+\S+\s*$/)
+    elsif(/^LEFT\s+\S+$/)
     {
 	++$nleft;
-	print OUTPUT;
-    }
-    elsif(/^\s*RIGHT\s+\S+\s*$/)
+	print OUTPUT "$_\n";
+    }
+    elsif(/^RIGHT\s+\S+$/)
     {
 	++$nright;
-	print OUTPUT;
-    }
-    elsif(my ($hs,$ds,$r) = /^\s*LINK\s+($cats_re)\s+($cats_re)\s+(\S+)\s*$/)
-    {
-	print OUTPUT "#$_";
+	print OUTPUT "$_\n";
+    }
+    elsif(my ($hs,$ds,$r) = /^LINK\s+($cats_re)\s+($cats_re)\s+(\S+)$/)
+    {
+	print OUTPUT "#$_\n";
 	for my $h ($hs =~ /$attr::cat_re/g)
 	{
@@ -183,8 +186,10 @@
 	}
     }
-    
-    else
-    {
-	print OUTPUT;
+    elsif(/^$/) {
+	# pomijamy puste linie oraz komentarze
+	}
+	else
+    {
+	print STDERR "Illegal format: $_\n";
     }
 }
