fork download
  1. #!/usr/bin/perl
  2. use strict;
  3. use warnings;
  4.  
  5. $/ = undef;
  6.  
  7. while (<DATA>) {
  8. s/if\s*(\((?>[^()]|(?1))*\))(*SKIP)(*F)|(\w+)(\s*<=[^;]*)/$2_yes$3/gs;
  9. }
  10.  
  11. __DATA__
  12. always @(posedge clk or negedge rst_n)
  13. if(!rst_n)begin
  14. d1 <= 0; //perl_comment_4
  15. //perl_comment_5
  16. d2 <= 1 //perl_comment_6
  17. + 2;
  18. end
  19. else if( d3 <= d4 && ( d5 <= 3 ) ) begin
  20. d6 <= d7 +
  21. (d8 <= d9 ? 1 : 0);
  22. //perl_comment_7
  23. d10 <= d11 <=
  24. d12
  25. + d13
  26. <= d14 ? 1 : 0;
  27. end
Success #stdin #stdout 0s 6172KB
stdin
Standard input is empty
stdout
always @(posedge clk or negedge rst_n)
if(!rst_n)begin
        d1_yes <= 0; //perl_comment_4
        //perl_comment_5
        d2_yes <= 1  //perl_comment_6
                 + 2;
        end
else if( d3 <= d4 && ( d5 <= 3 ) ) begin
        d6_yes <= d7 +
                 (d8 <= d9 ? 1 : 0);
        //perl_comment_7
        d10_yes <= d11 <=
                      d12
                        + d13
                            <= d14 ? 1 : 0;
        end