From 8693250e8ea5fb3bb516d0a4f30f97afb6e4fc30 Mon Sep 17 00:00:00 2001 From: Alexander Date: Mon, 29 Mar 2021 12:57:53 +0300 Subject: [PATCH] Respect Token type in generated code It was always `Yytoken`. Added format argument to substitute correct type name --- LexLib/Emit.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/LexLib/Emit.cs b/LexLib/Emit.cs index 2f4027e..8215da1 100644 --- a/LexLib/Emit.cs +++ b/LexLib/Emit.cs @@ -836,7 +836,7 @@ void Driver() AcceptMethod m = accept_dispatch[yy_last_accept_state]; if (m != null) {{ - Yytoken tmp = m(); // spec.type_name + {4} tmp = m(); // spec.type_name if (tmp != null) return tmp; }} @@ -856,8 +856,9 @@ void Driver() }} }} }} + }} #endregion -", getDriverType(), spec.function_name, EOF_Test(), spec.accept_list.Count); +", getDriverType(), spec.function_name, EOF_Test(), spec.accept_list.Count, spec.type_name); outstream.Write(sb); }