Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Spot
Spot
Commits
3efeacb6
Commit
3efeacb6
authored
Apr 15, 2015
by
Alexandre Duret-Lutz
Browse files
acc: preserve input order in parse_acc_code()
* src/twa/acc.cc: Here. * src/tests/acc.test: Adjust.
parent
b4881579
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/tests/acc.test
View file @
3efeacb6
...
...
@@ -78,10 +78,10 @@ t
f
Fin
(
2
)
Inf
(
2
)
Inf
(
2
)
|
Fin
(
2
)
Fin
(
2
)
|
Inf
(
2
)
Fin
(
2
)
&
Inf
(
2
)
Fin
(
3
)
|
(
Fin
(
2
)
&
Inf
(
1
))
|
Fin
(
0
)
Fin
(
3
)
|
(
Fin
(
2
)
&
Inf
(
1
))
|
Fin
(
0
)
Fin
(
0
)
|
(
Fin
(
2
)
&
Inf
(
1
))
|
Fin
(
3
)
Fin
(
0
)
|
(
Fin
(
2
)
&
Inf
(
1
))
|
Fin
(
3
)
EOF
run
0
..
/
acc
|
tee
stdout
...
...
src/twa/acc.cc
View file @
3efeacb6
...
...
@@ -991,15 +991,18 @@ namespace spot
static
acc_cond
::
acc_code
parse_acc
(
const
char
*&
input
)
{
auto
t
=
parse_term
(
input
);
auto
res
=
parse_term
(
input
);
skip_space
(
input
);
while
(
*
input
==
'|'
)
{
++
input
;
skip_space
(
input
);
t
.
append_or
(
parse_term
(
input
));
// Prepend instead of append, to preserve the input order.
auto
tmp
=
parse_term
(
input
);
std
::
swap
(
tmp
,
res
);
res
.
append_or
(
std
::
move
(
tmp
));
}
return
t
;
return
res
;
}
static
unsigned
parse_num
(
const
char
*&
input
)
...
...
@@ -1067,7 +1070,10 @@ namespace spot
{
++
input
;
skip_space
(
input
);
res
.
append_and
(
parse_term
(
input
));
// Prepend instead of append, to preserve the input order.
auto
tmp
=
parse_term
(
input
);
std
::
swap
(
tmp
,
res
);
res
.
append_and
(
std
::
move
(
tmp
));
}
return
res
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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