Module: gas-preprocessor Branch: master Commit: 67545bb01b8f402bdc1b0ef2ada934a4b029a42e
Author: Martin Storsjo <[email protected]> Committer: Martin Storsjo <[email protected]> Date: Mon Mar 24 14:44:36 2014 +0200 Handle nested repetitions --- gas-preprocessor.pl | 11 ++++++++++- test.S | 6 ++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/gas-preprocessor.pl b/gas-preprocessor.pl index 7a3b535..d875d76 100755 --- a/gas-preprocessor.pl +++ b/gas-preprocessor.pl @@ -221,6 +221,7 @@ if ($ENV{GASPP_DEBUG}) { my $current_macro = ''; my $macro_level = 0; +my $rept_level = 0; my %macro_lines; my %macro_args; my %macro_args_default; @@ -384,9 +385,17 @@ sub parse_line { } } + if ($macro_level == 0) { + if ($line =~ /\.(rept|irp)/) { + $rept_level++; + } elsif ($line =~ /.endr/) { + $rept_level--; + } + } + if ($macro_level > 1) { push(@{$macro_lines{$current_macro}}, $line); - } elsif (scalar(@rept_lines) and $line !~ /\.endr/) { + } elsif (scalar(@rept_lines) and $rept_level >= 1) { push(@rept_lines, $line); } elsif ($macro_level == 0) { expand_macros($line); diff --git a/test.S b/test.S index f6ec894..ec0b861 100644 --- a/test.S +++ b/test.S @@ -66,3 +66,9 @@ argtest2 1, 2, 3 argtest2 1 2 3 argtest1 1 2 3 + 1 argtest2 1 2 < 1 3 + +.irpc i, 0123 + .irpc j, 0123 + mov r\i, #\j + .endr +.endr _______________________________________________ libav-commits mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-commits
