(minor) macro buglets
- allow parameter-less macros - allow macro body to start on next line
This commit is contained in:
parent
3103d68a75
commit
8e3ee2f9c1
|
@ -12,11 +12,11 @@ sub sugar_script {
|
|||
my @out = ();
|
||||
|
||||
my $l = join("\n", @$lines);
|
||||
while ($l =~ s/^macro (\w+) (.*?)\nend//ms) {
|
||||
while ($l =~ s/^macro (\w+)\b(.*?)\nend//ms) {
|
||||
$macro{$1} = $2;
|
||||
}
|
||||
|
||||
$l =~ s/^((\w+) .*)/$macro{$2} ? expand($1) : $1/gem;
|
||||
$l =~ s/^((\w+)\b.*)/$macro{$2} ? expand($1) : $1/gem;
|
||||
|
||||
$lines = [split "\n", $l];
|
||||
return $lines;
|
||||
|
|
Loading…
Reference in a new issue