Skip to content

Commit

Permalink
[ruby/prism] Exclude comments when only serializing semantic fields
Browse files Browse the repository at this point in the history
  • Loading branch information
eregon authored and matzbot committed Oct 23, 2023
1 parent 42c2c8c commit f82d0ab
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions prism/templates/src/serialize.c.erb
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,9 @@ pm_serialize_encoding(pm_encoding_t *encoding, pm_buffer_t *buffer) {
void
pm_serialize_content(pm_parser_t *parser, pm_node_t *node, pm_buffer_t *buffer) {
pm_serialize_encoding(&parser->encoding, buffer);
<%- unless Prism::SERIALIZE_ONLY_SEMANTICS_FIELDS -%>
pm_serialize_comment_list(parser, &parser->comment_list, buffer);
<%- end -%>
pm_serialize_magic_comment_list(parser, &parser->magic_comment_list, buffer);
pm_serialize_diagnostic_list(parser, &parser->error_list, buffer);
pm_serialize_diagnostic_list(parser, &parser->warning_list, buffer);
Expand Down

0 comments on commit f82d0ab

Please sign in to comment.