bison-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 2/2] tests: check %no-lines


From: Akim Demaille
Subject: [PATCH 2/2] tests: check %no-lines
Date: Fri, 12 Oct 2012 12:26:09 +0200

* tests/synclines.at: here.
---
 tests/synclines.at | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 50 insertions(+)

diff --git a/tests/synclines.at b/tests/synclines.at
index 041ae19..63ae685 100644
--- a/tests/synclines.at
+++ b/tests/synclines.at
@@ -216,4 +216,54 @@ exp: '0';
 [input.y:8: #error "8"
 ])
 
+## -------------------- ##
+## %code top syncline.  ##
+## -------------------- ##
+
+AT_TEST([%code top syncline],
+[[%code top {
+#error "2"
+}
+%{
+]AT_YYERROR_DECLARE_EXTERN[
+]AT_YYLEX_DECLARE_EXTERN[
+%}
+%%
+exp: '0';
+%%
+]],
+[input.y:2: #error "2"
+])
+
+m4_popdef([AT_TEST])
+
+## ----------- ##
+## %no-lines.  ##
+## ----------- ##
+
+m4_pushdef([AT_TEST],
+[AT_SETUP([%no-lines])
+
+AT_BISON_OPTION_PUSHDEFS([%skeleton "$1" %defines])
+AT_DATA_GRAMMAR([input.y],
+[%skeleton "$1" %defines
+%{
+]AT_YYERROR_DECLARE_EXTERN[
+]AT_YYLEX_DECLARE_EXTERN[
+%}
+%%
+exp: '0'
+])
+AT_BISON_CHECK([--no-lines -o input.AT_SKEL_CC_IF([cc], [c]) -d input.y])
+AT_CHECK([[grep '#line' ]AT_SKEL_CC_IF([*.cc *.hh], [*.c *.h])], 1)
+AT_BISON_OPTION_POPDEFS
+
+AT_CLEANUP
+])
+
+AT_TEST([yacc.c])
+AT_TEST([glr.c])
+AT_TEST([lalr1.cc])
+AT_TEST([glr.cc])
+
 m4_popdef([AT_TEST])
-- 
1.7.12.2




reply via email to

[Prev in Thread] Current Thread [Next in Thread]