Skip to content

Commit fdce0d2

Browse files
committed
fix(codemod): preserve comment lines in metadata block
Comment lines (# ...) inside metadata blocks were being stripped and their content parsed as field values. Now preserved verbatim. Result: 275/289 deep equivalent
1 parent d6930c6 commit fdce0d2

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

lib/interscript/isc/codemod.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,9 @@ def convert_metadata_block
209209
elsif @scanner.scan(/\}/)
210210
depth -= 1
211211
@out << "}"
212+
elsif @scanner.scan(/\n[ \t]*#[^\n]*/)
213+
# Comment line — preserve as-is
214+
@out << @scanner.matched
212215
elsif @scanner.scan(/\n[ \t]*\n/)
213216
# Blank line — preserve one newline
214217
@out << "\n"

0 commit comments

Comments
 (0)