work around diagnostic changes in Bison 3.6
Bison <3.6 used to complain about "$undefined", while Bison >=3.6 now write "invalid token". * tests/core/parseaut.test, tests/core/parseerr.test, tests/core/sugar.test: Adjust expected diagnostics to match Bison pre and post 3.6.
This commit is contained in:
parent
16540869d4
commit
e06f8a3ece
3 changed files with 18 additions and 14 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
# Copyright (C) 2014-2018 Laboratoire de Recherche et Développement de
|
# Copyright (C) 2014-2018, 2020 Laboratoire de Recherche et Développement de
|
||||||
# l'Epita (LRDE).
|
# l'Epita (LRDE).
|
||||||
#
|
#
|
||||||
# This file is part of Spot, a model checking library.
|
# This file is part of Spot, a model checking library.
|
||||||
|
|
@ -31,7 +31,9 @@ expecterr()
|
||||||
# If autfilt is compiled statically, the '.../lt-' parse of
|
# If autfilt is compiled statically, the '.../lt-' parse of
|
||||||
# its name is not stripped, and the error message show the
|
# its name is not stripped, and the error message show the
|
||||||
# full path.
|
# full path.
|
||||||
sed 's:^\.\./\.\./bin/::' $1.err-t >$1.err
|
# Also work around differences between Bison >=3.6 (invalid token)
|
||||||
|
# end Bison <3.6 ($undefined).
|
||||||
|
sed 's:^\.\./\.\./bin/::;s/[$]undefined/invalid token/' $1.err-t >$1.err
|
||||||
cat $1.err
|
cat $1.err
|
||||||
diff $1.err $1.exp
|
diff $1.err $1.exp
|
||||||
}
|
}
|
||||||
|
|
@ -1226,21 +1228,22 @@ garbage
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
se='syntax error, unexpected' # this is just to keep lines short
|
se='syntax error, unexpected' # this is just to keep lines short
|
||||||
|
undefined='invalid token'
|
||||||
expecterr input <<EOF
|
expecterr input <<EOF
|
||||||
input:8.11: $se identifier, expecting integer or '}'
|
input:8.11: $se identifier, expecting integer or '}'
|
||||||
input:8.10-12: ignoring this invalid acceptance set
|
input:8.10-12: ignoring this invalid acceptance set
|
||||||
input:11.2: $se identifier
|
input:11.2: $se identifier
|
||||||
input:11.1-3: ignoring this invalid label
|
input:11.1-3: ignoring this invalid label
|
||||||
input:21.5-7: $se string, expecting integer
|
input:21.5-7: $se string, expecting integer
|
||||||
input:25.1: $se \$undefined
|
input:25.1: $se $undefined
|
||||||
input:32.1-5: $se header name, expecting --END-- or State:
|
input:32.1-5: $se header name, expecting --END-- or State:
|
||||||
input:28.1-8: initial state 0 has no definition
|
input:28.1-8: initial state 0 has no definition
|
||||||
input:25.1-12: leading garbage was ignored
|
input:25.1-12: leading garbage was ignored
|
||||||
input:37.1: $se 't'
|
input:37.1: $se 't'
|
||||||
input:43.1: $se \$undefined
|
input:43.1: $se $undefined
|
||||||
input:56.1: $se \$undefined, expecting State: or end of DSTAR automaton
|
input:56.1: $se $undefined, expecting State: or end of DSTAR automaton
|
||||||
input:37.1-39.21: leading garbage was ignored
|
input:37.1-39.21: leading garbage was ignored
|
||||||
input:81.1: $se \$undefined
|
input:81.1: $se $undefined
|
||||||
autfilt: failed to read automaton from input
|
autfilt: failed to read automaton from input
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
# Copyright (C) 2009, 2010, 2011, 2013, 2014, 2015, 2016 Laboratoire
|
# Copyright (C) 2009-2016, 2020 Laboratoire
|
||||||
# de Recherche et Développement de l'Epita (LRDE).
|
# de Recherche et Développement de l'Epita (LRDE).
|
||||||
# Copyright (C) 2003, 2004 Laboratoire d'Informatique de Paris 6 (LIP6),
|
# Copyright (C) 2003, 2004 Laboratoire d'Informatique de Paris 6 (LIP6),
|
||||||
# département Systèmes Répartis Coopératifs (SRC), Université Pierre
|
# département Systèmes Répartis Coopératifs (SRC), Université Pierre
|
||||||
|
|
@ -36,7 +36,7 @@ a - b
|
||||||
{a[*9999999999]}
|
{a[*9999999999]}
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
run 1 ../ltl2text input >output
|
run 1 ../ltl2text input | sed 's/[$]undefined/invalid token/g' > output
|
||||||
|
|
||||||
sed 's/$$//' >expected<<\EOF
|
sed 's/$$//' >expected<<\EOF
|
||||||
>>> $
|
>>> $
|
||||||
|
|
@ -53,7 +53,7 @@ ignoring trailing garbage
|
||||||
|
|
||||||
>>> /2/3/4/5 a + b /6/7/8/
|
>>> /2/3/4/5 a + b /6/7/8/
|
||||||
^
|
^
|
||||||
syntax error, unexpected $undefined
|
syntax error, unexpected invalid token
|
||||||
|
|
||||||
>>> /2/3/4/5 a + b /6/7/8/
|
>>> /2/3/4/5 a + b /6/7/8/
|
||||||
^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
@ -61,7 +61,7 @@ ignoring trailing garbage
|
||||||
|
|
||||||
>>> a - b
|
>>> a - b
|
||||||
^
|
^
|
||||||
syntax error, unexpected $undefined
|
syntax error, unexpected invalid token
|
||||||
|
|
||||||
>>> a - b
|
>>> a - b
|
||||||
^^^
|
^^^
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
# Copyright (C) 2018, 2019 Laboratoire de Recherche et Développement
|
# Copyright (C) 2018-2020 Laboratoire de Recherche et Développement de
|
||||||
# de l'Epita (LRDE).
|
# l'Epita (LRDE).
|
||||||
#
|
#
|
||||||
# This file is part of Spot, a model checking library.
|
# This file is part of Spot, a model checking library.
|
||||||
#
|
#
|
||||||
|
|
@ -135,11 +135,12 @@ EOF
|
||||||
num="number for square bracket operator"
|
num="number for square bracket operator"
|
||||||
numoreof="$num or end of formula"
|
numoreof="$num or end of formula"
|
||||||
sep="separator for square bracket operator"
|
sep="separator for square bracket operator"
|
||||||
undefined='$undefined'
|
undefined='invalid token'
|
||||||
closingbkt='square bracket operator, expecting closing bracket'
|
closingbkt='square bracket operator, expecting closing bracket'
|
||||||
eclosingbkt='expecting closing bracket or closing !]'
|
eclosingbkt='expecting closing bracket or closing !]'
|
||||||
|
|
||||||
ltlfilt -F err.in 2>err && exit 1
|
ltlfilt -F err.in 2>err && exit 1
|
||||||
|
sed 's/[$]undefined/invalid token/' err >err2
|
||||||
cat >expect2 <<EOF
|
cat >expect2 <<EOF
|
||||||
ltlfilt:err.in:1: parse error:
|
ltlfilt:err.in:1: parse error:
|
||||||
>>> F[
|
>>> F[
|
||||||
|
|
@ -329,4 +330,4 @@ syntax error, unexpected closing brace
|
||||||
missing right operand for "SVA delay operator"
|
missing right operand for "SVA delay operator"
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
diff -u err expect2
|
diff -u err2 expect2
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue