Skip to content

Instantly share code, notes, and snippets.

@dakkar
Created July 10, 2011 16:13
Show Gist options
  • Save dakkar/1074654 to your computer and use it in GitHub Desktop.
Save dakkar/1074654 to your computer and use it in GitHub Desktop.
micro-patch for gas-preprocessor
# first way: in pre-processing
# before calling «parse_line($_)» from the «while» loop
if (/\.irpc\s+([\d\w.]+)\s*(.*)/) {
my ($id,$vals)=($1,$2);
my @vals = split //,$vals;
$_ = ".irp $id @vals";
}
# second way: in «parse_line»
# just after the «elsif ($line =~ /\.irp\s+([\d\w\.]+)\s*(.*)/) {…}»
elsif ($line =~ /\.irpc\s+([\d\w\.]+)\s*(.*)/) {
$in_irp = 1;
$num_repts = 1;
$rept_lines = "\n";
$irp_param = $1;
# only use whitespace as the separator
my $irp_arglist = $2;
@irp_args = split(//, $irp_arglist);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment