bison-patches
[Top][All Lists]
Advanced

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

[PATCH 08/10] glr2.cc: add support for parse.assert


From: Akim Demaille
Subject: [PATCH 08/10] glr2.cc: add support for parse.assert
Date: Sun, 6 Dec 2020 14:10:35 +0100

* data/skeletons/glr2.cc: Fake support of parse.assert, so that the
tests can use it without failing.
---
 TODO                   | 4 ++++
 data/skeletons/glr2.cc | 3 ++-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/TODO b/TODO
index fa9cee52..e1bcb8d1 100644
--- a/TODO
+++ b/TODO
@@ -198,6 +198,10 @@ yycharp is no longer a Pointer.  And yystackp should 
probably also be a referenc
 Don't use YYSTYPE and YYLTYPE but parser::semantic_type and
 parser::location_type.  Undefine YYSTYPE and YYLTYPE.
 
+*** parse.assert
+Currently all the assertions are enabled.  Once we are confident in glr2.cc,
+let parse.assert use the same approach as in lalr1.cc.
+
 *** glr.c
 When glr2.cc fully replaces glr.cc, get rid of the glr.cc scaffolding in
 glr.c.
diff --git a/data/skeletons/glr2.cc b/data/skeletons/glr2.cc
index 6b60b38f..68d114bd 100644
--- a/data/skeletons/glr2.cc
+++ b/data/skeletons/glr2.cc
@@ -456,7 +456,6 @@ static YYLTYPE yyloc_default][]b4_yyloc_default;])[
 [#include <cstdio>
 #include <cstdlib>
 
-
 #ifndef YY_
 # if defined YYENABLE_NLS && YYENABLE_NLS
 #  if ENABLE_NLS
@@ -504,6 +503,8 @@ static YYLTYPE yyloc_default][]b4_yyloc_default;])[
 ]b4_null_define[
 ]b4_cast_define[
 
+// FIXME: Use the same conventions as lalr1.cc.
+]b4_parse_assert_if[
 #ifndef YYASSERT
 # define YYASSERT(Condition) ((void) ((Condition) || (abort (), 0)))
 #endif
-- 
2.29.2




reply via email to

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