bison-patches
[Top][All Lists]
Advanced

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

java: also emit documenting comments for symbol kinds


From: Akim Demaille
Subject: java: also emit documenting comments for symbol kinds
Date: Tue, 7 Apr 2020 08:39:41 +0200

commit 38f54ebb4d408d04484aea08be66e434222332d0
Author: Akim Demaille <address@hidden>
Date:   Tue Apr 7 08:08:04 2020 +0200

    java: also emit documenting comments for symbol kinds
    
    * data/skeletons/java.m4 (b4_symbol_enum): here.

diff --git a/data/skeletons/java.m4 b/data/skeletons/java.m4
index b775c2ab..a5615f5d 100644
--- a/data/skeletons/java.m4
+++ b/data/skeletons/java.m4
@@ -157,10 +157,12 @@ b4_symbol_foreach([b4_token_enum])])])
 # --------------------------
 # Output the definition of this symbol as an enum.
 m4_define([b4_symbol_enum],
-[m4_ifval(b4_symbol([$1], [kind]),
-         [m4_format([[%s(%s)]],
-                    b4_symbol([$1], [kind]),
-                    b4_symbol([$1], [number]))])])
+[m4_format([    %-30s %s],
+           m4_format([[%s(%s)%s]],
+                     b4_symbol([$1], [kind]),
+                     [$1],
+                     m4_if([$1], b4_last_symbol, [[;]], [[,]])),
+           [b4_symbol_tag_comment([$1])])])
 
 
 # b4_declare_symbol_enum
@@ -169,10 +171,7 @@ m4_define([b4_symbol_enum],
 m4_define([b4_declare_symbol_enum],
 [[  public enum SymbolKind
   {
-    ]m4_join([,
-    ],
-             ]b4_symbol_kind([-2])[(-2),
-             b4_symbol_map([b4_symbol_enum]))[;
+]b4_symbol_foreach([b4_symbol_enum])[
 
     private final int code_;
 




reply via email to

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