summaryrefslogtreecommitdiff
path: root/tests/output.at
diff options
context:
space:
mode:
authorAkim Demaille <akim.demaille@gmail.com>2018-10-06 13:03:59 +0200
committerAkim Demaille <akim.demaille@gmail.com>2018-10-06 17:17:25 +0200
commit50b8d4ba5a72bbe4062001de4e5fe0c1cf9d994f (patch)
treeb17277273912b1229fa855063d3c509e835299b7 /tests/output.at
parent57d69b04b22707c1c284874b47029307b24f4661 (diff)
downloadbison-50b8d4ba5a72bbe4062001de4e5fe0c1cf9d994f.tar.gz
c++: support absolute api.location.file names
In the case a user wants to create location.hh elsewhere, it can be helpful to define api.location.file to some possibly absolute path such as -Dapi.location.file='"$(top_srcdir)/include/ast/location.hh"'. Currently this does not work with `-o foo/parser.cc`, as we join foo/ and $(top_srcdir) together, the latter starting with slash. We should not try to do that in m4, manipulating file names is quite complex when you through Windows file name in. Let m4 delegate this to gnulib. * src/scan-skel.l (at_output): Accept up to two arguments. * data/bison.m4 (b4_output): Adjust. * tests/skeletons.at (Fatal errors but M4 continues producing output): Adjust to keep the error. * data/location.cc, data/stack.hh: Leave the concatenation to @output. * tests/output.at: Exercise api.location.file with an absolute path.
Diffstat (limited to 'tests/output.at')
-rw-r--r--tests/output.at12
1 files changed, 9 insertions, 3 deletions
diff --git a/tests/output.at b/tests/output.at
index 3ee79df7..2c2cd9b8 100644
--- a/tests/output.at
+++ b/tests/output.at
@@ -45,9 +45,13 @@ done
[$2[
%%
foo: %empty {};
-]])[
+]])
+
+# There is not AT_DATA_UNQUOTED.
+AT_CHECK([$PERL -pi -e 's{\$at_dir}'"{$at_group_dir}g" $1])
-]AT_BISON_CHECK([$3 $1], [$5], [], [ignore])[
+
+AT_BISON_CHECK([$3 $1], [$5], [], [ignore])[
# Ignore the files non-generated files
]AT_CHECK_FILES([$4], [$1])[
]$6[
@@ -206,8 +210,10 @@ AT_CHECK_OUTPUT([foo.yy],
[%skeleton "lalr1.cc" %defines %locations %define api.location.file "foo.loc.hh"],
[],
[foo.loc.hh foo.tab.cc foo.tab.hh])
+
+# Absolute paths.
AT_CHECK_OUTPUT([foo.yy],
- [%skeleton "lalr1.cc" %defines %define api.stack.file none %locations %define api.location.file "foo.loc.hh"],
+ [%skeleton "lalr1.cc" %defines %locations %define api.location.file "$at_dir/foo.loc.hh"],
[],
[foo.loc.hh foo.tab.cc foo.tab.hh])