Skip to content

Commit

Permalink
[ruby/yarp] Rename YP_NODE_*_NODE to YP_*_NODE
Browse files Browse the repository at this point in the history
  • Loading branch information
eregon authored and matzbot committed Sep 6, 2023
1 parent 5ba480e commit 6356f6d
Show file tree
Hide file tree
Showing 6 changed files with 310 additions and 310 deletions.
2 changes: 1 addition & 1 deletion yarp/templates/include/yarp/ast.h.erb
Expand Up @@ -44,7 +44,7 @@ enum yp_node_type {
<%- nodes.each_with_index do |node, index| -%>
<%= node.type %> = <%= index + 1 %>,
<%- end -%>
YP_NODE_SCOPE_NODE
YP_SCOPE_NODE
};

typedef uint16_t yp_node_type_t;
Expand Down
2 changes: 1 addition & 1 deletion yarp/templates/src/node.c.erb
Expand Up @@ -95,7 +95,7 @@ yp_node_memsize_node(yp_node_t *node, yp_memsize_t *memsize) {
switch (YP_NODE_TYPE(node)) {
// We do not calculate memsize of a ScopeNode
// as it should never be generated
case YP_NODE_SCOPE_NODE:
case YP_SCOPE_NODE:
return;
<%- nodes.each do |node| -%>
#line <%= __LINE__ + 1 %> "<%= File.basename(__FILE__) %>"
Expand Down
2 changes: 1 addition & 1 deletion yarp/templates/src/prettyprint.c.erb
Expand Up @@ -18,7 +18,7 @@ prettyprint_node(yp_buffer_t *buffer, yp_parser_t *parser, yp_node_t *node) {
switch (YP_NODE_TYPE(node)) {
// We do not need to print a ScopeNode as it's not part
// of the AST
case YP_NODE_SCOPE_NODE:
case YP_SCOPE_NODE:
return;
<%- nodes.each do |node| -%>
case <%= node.type %>: {
Expand Down
2 changes: 1 addition & 1 deletion yarp/templates/src/serialize.c.erb
Expand Up @@ -58,7 +58,7 @@ yp_serialize_node(yp_parser_t *parser, yp_node_t *node, yp_buffer_t *buffer) {
switch (YP_NODE_TYPE(node)) {
// We do not need to serialize a ScopeNode ever as
// it is not part of the AST
case YP_NODE_SCOPE_NODE:
case YP_SCOPE_NODE:
return;
<%- nodes.each do |node| -%>
case <%= node.type %>: {
Expand Down
2 changes: 1 addition & 1 deletion yarp/templates/template.rb
Expand Up @@ -168,7 +168,7 @@ def initialize(config)
@name = config.fetch("name")

type = @name.gsub(/(?<=.)[A-Z]/, "_\\0")
@type = "YP_NODE_#{type.upcase}"
@type = "YP_#{type.upcase}"
@human = type.downcase

@fields =
Expand Down

0 comments on commit 6356f6d

Please sign in to comment.