Skip to content

Commit

Permalink
Add comments to id.h and undef finished macros
Browse files Browse the repository at this point in the history
  • Loading branch information
nobu committed Jul 21, 2023
1 parent 8d9a25a commit 47c7c18
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions template/id.h.tmpl
Expand Up @@ -67,24 +67,33 @@ enum ruby_method_ids {
id<%=token%>,
% end
tPRESERVED_ID_END,

% prev = 'tPRESERVED_ID_END'
% types.each do |type|
% tokens = ids[type]
/* <%= type %> tokens {{{ */
tTOKEN_<%=type%>_BEGIN = <%=prev%>-1,
% tokens.each do |token|
t<%=token%>,
% end
% prev = "tTOKEN_#{type}_END"
<%=prev%>,
/* <%= type %> tokens }}} */

% end
tNEXT_ID = <%=prev%>,

% types.each do |type|
% tokens = ids[type]
/* <%= type %> IDs {{{ */
#define DEFINE_<%=type%>ID_FROM_TOKEN(n) id##n = TOKEN2<%=type%>ID(t##n)
% tokens or next
% tokens.each do |token|
DEFINE_<%=type%>ID_FROM_TOKEN(<%=token%>),
% end
#undef DEFINE_<%=type%>ID_FROM_TOKEN
/* <%= type %> IDs }}} */

% end
tLAST_OP_ID = tPRESERVED_ID_END-1,
idLAST_OP_ID = tLAST_OP_ID >> ID_SCOPE_SHIFT
Expand Down

0 comments on commit 47c7c18

Please sign in to comment.