diff options
author | Adela Vais <adela.vais99@gmail.com> | 2021-01-05 16:47:29 +0200 |
---|---|---|
committer | Akim Demaille <akim.demaille@gmail.com> | 2021-01-06 18:33:41 +0100 |
commit | 5bac3ddcee7c6eebb4833d1954f614fced475073 (patch) | |
tree | fb129f07035c364ca9224cf84ebb0d89932323db /data/skeletons/d.m4 | |
parent | 594cae57ca63fc7b3f18dad3d6472e043c626df0 (diff) | |
download | bison-5bac3ddcee7c6eebb4833d1954f614fced475073.tar.gz |
d: remove yytnamerr usage
It is a backwards-compatible feature for the other parsers.
D should not support this option.
* data/skeletons/d.m4: Here.
Diffstat (limited to 'data/skeletons/d.m4')
-rw-r--r-- | data/skeletons/d.m4 | 40 |
1 files changed, 3 insertions, 37 deletions
diff --git a/data/skeletons/d.m4 b/data/skeletons/d.m4 index 5320c483..cfb87944 100644 --- a/data/skeletons/d.m4 +++ b/data/skeletons/d.m4 @@ -243,12 +243,6 @@ m4_define([b4_declare_symbol_enum], yycode_ = code; } - /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. - First, the terminals, then, starting at \a YYNTOKENS_, nonterminals. */ - static immutable string[] yytname_ = @{ - ]b4_tname[ - @}; - /* Return YYSTR after stripping away unnecessary quotes and backslashes, so that it's suitable for yyerror. The heuristic is that double-quoting is unnecessary unless the string contains an @@ -264,37 +258,9 @@ m4_define([b4_declare_symbol_enum], internationalizable. */ immutable ]b4_int_type_for([b4_translatable])[[] yytranslatable = @{ ]b4_translatable[ - @}; - - put(sink, yy_sname[yycode_]);]], [[ - string yystr = yytname_[yycode_]; - if (yystr[0] == '"') - { - strip_quotes: - for (int i = 1; i < yystr.length; i++) - switch (yystr[i]) - { - case '\'': - case ',': - break strip_quotes; - - case '\\': - if (yystr[++i] != '\\') - break strip_quotes; - goto default; - default: - put(sink, yystr[i]); - break; - - case '"': - return; - } - } - else if (yystr == "$end") - { - put(sink, "end of input"); - return; - }]])[ + @};]])[ + + put(sink, yy_sname[yycode_]); } } ]]) |