Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions gen_expand
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@
use warnings;
use strict;

defined(my $n = shift)
or die "usage: $0 n\n";
my $n = shift;
(defined($n) && $n =~ /^\d+$/ && $n >= 1)
or die "usage: $0 <positive_integer_n>\n";

# special cases i can't be bothered to handle otherwise
# special cases I can't be bothered to handle otherwise
print "#define x1(x) x\n";
print "#define x2(x) x x\n";
print "#define x3(x) x2(x) x\n";
Expand Down