Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-devel
Commits
4d6218bd
Commit
4d6218bd
authored
Nov 06, 2013
by
Mike Hibler
Browse files
Better parsing of neato output: account for property sets than span lines.
parent
cc34c36e
Changes
1
Hide whitespace changes
Inline
Side-by-side
vis/prerender.in
View file @
4d6218bd
...
...
@@ -290,13 +290,21 @@ for ($attempt = 0; $attempt < 16; $attempt++) {
# (All we care about for now is "pos")
# Links are ignored.
my
$curline
=
"";
while
(
<
NEATO
>
)
{
if
(
/^\s*(\w+)\s\[([^\]]*)\]/
)
{
chomp
;
# build up a line til we get something we know ends a statement
$curline
.=
$_
;
next
if
(
/[^{};]$/
);
if
(
$curline
=~
/^\s*(\w+)\s+\[([^\]]*)\]/
)
{
# this line is a property set
(
$cmd
,
$props
)
=
(
$
1
,
$
2
);
$props
=~
s/[\=\,]/ /g
;
$props
=~
s/\s+/ /g
;
while
((
$props
=~
s/^\s*(\w+)\s+((\"[^\"]*\")|(\
w
+))\s*//
))
{
while
((
$props
=~
s/^\s*(\w+)\s+((\"[^\"]*\")|(\
S
+))\s*//
))
{
# add each property to %props
(
$k
,
$v
)
=
(
$
1
,
$
2
);
$v
=~
s/\"//g
;
...
...
@@ -315,6 +323,7 @@ for ($attempt = 0; $attempt < 16; $attempt++) {
%props
=
();
}
}
$curline
=
"";
}
# done with neato process.
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment