Skip to content

Commit a65438b

Browse files
committed
fix pack() WIP - refactoring
1 parent 049b3c7 commit a65438b

File tree

1 file changed

+0
-25
lines changed
  • src/main/java/org/perlonjava/operators

1 file changed

+0
-25
lines changed

src/main/java/org/perlonjava/operators/Pack.java

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -476,31 +476,6 @@ public static RuntimeScalar pack(RuntimeList args) {
476476
if (stringFormat == 'Z' && stringCount < 0) {
477477
output.write(0); // null terminator
478478
}
479-
} else if (format == '@') {
480-
// @ is used for absolute positioning
481-
// '/' uses the previously packed numeric value as a count for the following string format
482-
483-
// First, check what follows '/'
484-
if (i + 1 >= template.length()) {
485-
throw new PerlCompilerException("Code missing after '/'");
486-
}
487-
488-
i++; // move to next character after '/'
489-
char nextChar = template.charAt(i);
490-
491-
// Check if '/' is followed by a repeat count (which is an error)
492-
// This includes '*' or any digit
493-
if (nextChar == '*' || Character.isDigit(nextChar)) {
494-
throw new PerlCompilerException("'/' does not take a repeat count");
495-
}
496-
497-
// Check if it's a valid string format
498-
if (nextChar != 'a' && nextChar != 'A' && nextChar != 'Z') {
499-
throw new PerlCompilerException("'/' must be followed by a string type");
500-
}
501-
502-
// Now we can continue processing...
503-
// (rest of the handler code)
504479
} else if (format == '@') {
505480
// @ is used for absolute positioning
506481
// @n means null-fill or truncate to position n

0 commit comments

Comments
 (0)