Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
pramothragavan committed May 26, 2024
1 parent a65158b commit 2cd78a2
Showing 1 changed file with 3 additions and 19 deletions.
22 changes: 3 additions & 19 deletions gap/io.gi
Original file line number Diff line number Diff line change
Expand Up @@ -1409,6 +1409,7 @@ function(config, key)
fi;
od;
return Int(tempStr);

else
if key = "$" then
return 0;
Expand Down Expand Up @@ -1451,7 +1452,7 @@ function(inputString)

if currentChar = '$' and nextChar = '$' then
Info(InfoWarning, 1, "Vertex indexing will start at 1");
if ForAll(inputString{[currentPos + 2..Length(inputString)]}, c -> c = ' ' or c = '\n') then; #what if currentpos+2>length?
if ForAll(inputString{[currentPos + 2..Length(inputString)]}, c -> c = ' ' or c = '\n') then;
Add(segments, inputString{[startPos..currentPos - 1]});
return segments;
else
Expand All @@ -1465,7 +1466,7 @@ function(inputString)
return segments;
fi;

if currentChar = 'f' then
if currentChar = 'f' then #partition
Add(segments, inputString{[startPos..currentPos-1]});
repeat
currentPos := currentPos + 1;
Expand All @@ -1486,19 +1487,6 @@ function(inputString)
fi;
fi;


# if IsDigitChar(currentChar) and nextChar = ' ' and inputString[currentPos + 2] = ':' then #in the case of a new vertex
# repeat #backtrack to find the start of the vertex
# currentPos := currentPos - 1;
# until currentPos <= 1 or not IsDigitChar(inputString[currentPos]);
# if startPos < currentPos then
# Add(segments, inputString{[startPos..currentPos-1]});
# fi;
# if currentPos > 1 then
# startPos := currentPos;
# fi;
# fi;

if currentChar = ':' then
repeat #backtrack to find the start of the vertex
currentPos := currentPos - 1;
Expand Down Expand Up @@ -1526,17 +1514,13 @@ BindGlobal("DIGRAPHS_ParseDreadnautGraph",
function(graphData, r)
local edgeList, part, parts, subparts, vertex, connectedTo, adjacencyPart, breakflag, pparts, partition, i, j, num;

# Initialize an empty list to hold the edges
edgeList := List([1..r.nValue], x -> []);
breakflag := false;

# graphData := ReplacedString(graphData, ":", " : ");
# graphData := ReplacedString(graphData, ";", " ; ");
NormalizeWhitespace(graphData); #losing newlines here
parts := DIGRAPHS_SplitDreadnautLines(graphData);

for part in parts do

if PositionSublist(part, ".") <> fail or PositionSublist(part, "q") <> fail then
breakflag := true;
RemoveCharacters(part, ".q");
Expand Down

0 comments on commit 2cd78a2

Please sign in to comment.