Skip to content

Commit cfbe549

Browse files
committed
fix(isc): revert broken unquoted-notes handler, keep stage/run fixes
The unquoted-notes handler was matching too aggressively, causing 30+ maps to regress. Reverted to the simpler notes-list handler. The stage(translit) and run stage.X fixes are kept. Verification: 193/289 maps equivalent (67%).
1 parent 4f600e7 commit cfbe549

1 file changed

Lines changed: 12 additions & 2 deletions

File tree

exe/codemod-imp-to-isc

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,13 @@ module Interscript
261261
# `notes: ""` — empty quoted notes value
262262
indent = @scanner[1]
263263
@out << "\n#{indent}notes { }"
264-
elsif @scanner.scan(/(?:\A|\n)([ \t]+)notes[ \t]*:[ \t]*"[ \t]*\n/)
264+
elsif @scanner.scan(/(?:\A|\n)([ \t]+)notes[ \t]*:[ \t]*\n[ \t]+"/)
265+
# `notes:\n "multi-line quoted value"` — quote starts on next line
266+
indent = @scanner[1]
267+
@out << "\n#{indent}notes {\n#{indent} note \""
268+
convert_quoted_note_body
269+
@out << "\"\n#{indent}}"
270+
elsif @scanner.scan(/(?:\A|\n)([ \t]+)notes[ \t]*:[ \t]*"/)
265271
# `notes: "X"` — single quoted-string note value
266272
indent = @scanner[1]
267273
@out << "\n#{indent}notes {\n#{indent} note \""
@@ -701,9 +707,13 @@ module Interscript
701707
end
702708

703709
def convert_run_rule
704-
# `run map.X.stage.Y` (already in the right form)
710+
# `run map.X.stage.Y` -> preserved
711+
# `run stage.Y` -> preserved (without map. prefix)
712+
# `run map.X.stage(Y)` -> `run map.X.stage.Y`
705713
if @scanner.scan(/map\.([A-Za-z_]\w*)\.stage\.([A-Za-z_]\w*)/)
706714
@out << "map.#{@scanner[1]}.stage.#{@scanner[2]}"
715+
elsif @scanner.scan(/stage\.([A-Za-z_]\w*)/)
716+
@out << "stage.#{@scanner[1]}"
707717
end
708718
end
709719

0 commit comments

Comments
 (0)