[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH for Dlang support] d: change the name of the custom error message
From: |
Adela Vais |
Subject: |
[PATCH for Dlang support] d: change the name of the custom error message function to reportSyntaxError |
Date: |
Tue, 17 Nov 2020 20:06:26 +0200 |
User-agent: |
Mutt/1.9.4 (2018-02-28) |
Changed from syntax_error to reportSyntaxError to be similar to the Java parser.
* data/skeletons/lalr1.d: Change the function name.
* doc/bison.texi: Document it.
* tests/local.at: Adjust.
---
data/skeletons/lalr1.d | 4 ++--
doc/bison.texi | 2 +-
tests/local.at | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/data/skeletons/lalr1.d b/data/skeletons/lalr1.d
index 73ece8ff..eccf3dc1 100644
--- a/data/skeletons/lalr1.d
+++ b/data/skeletons/lalr1.d
@@ -84,7 +84,7 @@ public interface Lexer
*
* @@param ctx The context of the error.
*/
- void syntax_error(]b4_parser_class[.Context ctx);
+ void reportSyntaxError(]b4_parser_class[.Context ctx);
]])[
}
@@ -675,7 +675,7 @@ m4_popdef([b4_at_dollar])])dnl
private final void yyreportSyntaxError(Context yyctx)
{]b4_parse_error_bmatch(
[custom], [[
- yylexer.syntax_error(yyctx);]],
+ yylexer.reportSyntaxError(yyctx);]],
[detailed\|verbose], [[
if (yyctx.getToken() != ]b4_symbol(empty, kind)[)
{
diff --git a/doc/bison.texi b/doc/bison.texi
index 8e9472e2..d012a1c9 100644
--- a/doc/bison.texi
+++ b/doc/bison.texi
@@ -14026,7 +14026,7 @@ They should return new objects for each call, to avoid
that all the symbol
share the same Position boundaries.
@end deftypemethod
-@deftypemethod {Lexer} {void} syntax_error(@code{YYParser.Context} @var{ctx})
+@deftypemethod {Lexer} {void} reportSyntaxError(@code{YYParser.Context}
@var{ctx})
If you invoke @samp{%define parse.error custom} (@pxref{Bison
Declarations}), then the parser no longer passes syntax error messages to
@code{yyerror}, rather it delegates that task to the user by calling the
diff --git a/tests/local.at b/tests/local.at
index a982d6ca..8826e632 100644
--- a/tests/local.at
+++ b/tests/local.at
@@ -891,7 +891,7 @@ public string
transformToken(]AT_API_PREFIX[Parser.SymbolKind token)
return res;
}
-public void syntax_error(]AT_API_PREFIX[Parser.Context ctx)
+public void reportSyntaxError(]AT_API_PREFIX[Parser.Context ctx)
{
stderr.write(]AT_LOCATION_IF([[ctx.getLocation(), ": ",]])["syntax error");
{
--
2.17.1
- [PATCH for Dlang support] d: change the name of the custom error message function to reportSyntaxError,
Adela Vais <=