Merge remote-tracking branch 'origin/maint'

* origin/maint:
  glr: more assertions
  glr: shorten scopes
  glr: formatting changes
  glr: better use of tracing macros
  examples: improve the output of the "variant" example
  variant: remove useless assertion
  tests: remove stray debugging traces
  tests: do not use grep -q
  build: don't require flex for ordinary builds
  maint: update .gitignore
  build: port to pre-5.8.7 perl
  tests: minor change to make it easier to test other skeletons
  uniqstr: fix assertion
This commit is contained in:
Akim Demaille
2013-09-19 16:33:20 +02:00
12 changed files with 62 additions and 36 deletions

View File

@@ -72,13 +72,12 @@ int main ()
std::cout << "Works" << std::endl;
}
EOF
ls
$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS $LIBS -o conftest conftest.cc
case $? in
0);;
*) BISON_CXX_WORKS="as_fn_error 77 cannot-compile-simple-program";;
esac
rm -f conftest*
rm -fr conftest*
fi
# Whether the compiler supports POSIXLY_CORRECT defined.

View File

@@ -174,11 +174,10 @@ AT_CLEANUP
m4_pushdef([AT_TEST],
[AT_SETUP([Variants $1])
AT_BISON_OPTION_PUSHDEFS([%skeleton "lalr1.cc" %debug $1])
AT_BISON_OPTION_PUSHDEFS([%debug $1])
# Store strings and integers in a list of strings.
AT_DATA_GRAMMAR([list.y],
[[%debug
%skeleton "lalr1.cc"
%define api.value.type variant
]m4_bpatsubst([$1], [\\n], [
])[
@@ -320,13 +319,13 @@ AT_BISON_OPTION_POPDEFS
AT_CLEANUP
])
AT_TEST([])
AT_TEST([%define parse.assert])
AT_TEST([%locations %define parse.assert])
AT_TEST([[%define parse.assert %code {\n#define TWO_STAGE_BUILD\n}]])
AT_TEST([[%define parse.assert %define api.token.constructor]])
AT_TEST([[%define parse.assert %define api.token.constructor %define api.token.prefix {TOK_}]])
AT_TEST([[%locations %define parse.assert %define api.token.constructor %define api.token.prefix {TOK_}]])
AT_TEST([[%skeleton "lalr1.cc" ]])
AT_TEST([[%skeleton "lalr1.cc" %define parse.assert]])
AT_TEST([[%skeleton "lalr1.cc" %locations %define parse.assert]])
AT_TEST([[%skeleton "lalr1.cc" %define parse.assert %code {\n#define TWO_STAGE_BUILD\n}]])
AT_TEST([[%skeleton "lalr1.cc" %define parse.assert %define api.token.constructor]])
AT_TEST([[%skeleton "lalr1.cc" %define parse.assert %define api.token.constructor %define api.token.prefix {TOK_}]])
AT_TEST([[%skeleton "lalr1.cc" %locations %define parse.assert %define api.token.constructor %define api.token.prefix {TOK_}]])
m4_popdef([AT_TEST])

View File

@@ -725,18 +725,23 @@ AT_CLEANUP
AT_SETUP([Java constructor init and init_throws])
m4_pushdef([AT_Witness],
[super("Test Thread"); if (true) throw new InterruptedException();])
AT_CHECK_JAVA_MINIMAL([[
%define extends {Thread}
%code init { super("Test Thread"); if (true) throw new InterruptedException(); }
%code init { ]AT_Witness[ }
%define init_throws {InterruptedException}
%lex-param {int lex_param}]])
AT_CHECK([[grep -q 'super("Test Thread"); if (true) throw new InterruptedException();' YYParser.java]])
AT_CHECK([[grep ']AT_Witness[' YYParser.java]], 0, [ignore])
AT_CHECK_JAVA_MINIMAL_W_LEXER([[
%define extends {Thread}
%code init { super("Test Thread"); if (true) throw new InterruptedException(); }
%code init { ]AT_Witness[ }
%define init_throws {InterruptedException}]], [], [[return EOF;]])
AT_CHECK([[grep -q 'super("Test Thread"); if (true) throw new InterruptedException();' YYParser.java]])
AT_CHECK([[grep ']AT_Witness[' YYParser.java]], 0, [ignore])
m4_popdef([AT_Witness])
AT_CLEANUP