Subversion Repositories wimsdev

Rev

Rev 13905 | Rev 15046 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 13905 Rev 14239
Line 499... Line 499...
499
  push @wimslist, ("endif","next","else") ;
499
  push @wimslist, ("endif","next","else") ;
500
  @wimslist ;
500
  @wimslist ;
501
}
501
}
502
### subroutine for "editor"
502
### subroutine for "editor"
503
sub begin_js {my ($t)= @_ ;
503
sub begin_js {my ($t)= @_ ;
504
  "case \'$t\' \:\nchaine_aide="
504
  "\n  case \'$t\' \:\n    chaine_aide="
505
}
505
}
506
sub syntax_js {my ($line,$lang)=@_ ;
506
sub syntax_js {my ($line,$lang)=@_ ;
507
  "\'<div class=\"syntax\"><div class=\"title\">$name{'syntax'}{$lang}</div><code>$line</code></div>\'+\n"
507
  "\'<div class=\"syntax\"><div class=\"title\">$name{'syntax'}{$lang}</div><code>$line</code></div>\'+\n"
508
}
508
}
509
sub middle_js {my ($line,$tag,$lang)=@_ ;
509
sub middle_js {my ($line,$tag,$lang)=@_ ;
Line 522... Line 522...
522
}
522
}
523
 
523
 
524
sub end_js {my ($text)=@_ ;
524
sub end_js {my ($text)=@_ ;
525
  "\'$text\' ; return chaine_aide;
525
  "\'$text\' ; return chaine_aide;
526
           break;
526
           break;
527
        ////********************\n
527
    ////********************"
528
        "
-
 
529
}
528
}
530
sub function_js {my ($text,$tag)=@_ ;
529
sub function_js {my ($text,$tag)=@_ ;
531
  "function $tag" . "fun(instruction){
530
 "function $tag" . "fun(instruction){
532
    switch(instruction)
531
  switch(instruction){$text\n  }\n}"
533
          {
-
 
534
          $text
-
 
535
          }
-
 
536
  }"
-
 
537
}
532
}
538
 
533
 
539
sub cleanup { my ($txt)=@_ ;
534
sub cleanup { my ($txt)=@_ ;
540
  return $txt if !($txt) ;
535
  return $txt if !($txt) ;
541
  $txt=~ s/\\\b/&#92;/g ;
536
  $txt=~ s/\\\b/&#92;/g ;
Line 618... Line 613...
618
$TEXT ;
613
$TEXT ;
619
}
614
}
620
 
615
 
621
sub out { my ($bloc, $text) = @_ ;
616
sub out { my ($bloc, $text) = @_ ;
622
  open  (OUT, ">$bloc") || die "peut pas créer $bloc";
617
  open  (OUT, ">$bloc") || die "peut pas créer $bloc";
623
  print OUT "<!-- Automatically generated by bin/oefdoc.pl -->\n" . $text ; close OUT ;
618
  print OUT "/* Automatically generated by bin/oefdoc.pl */\n" . $text ; close OUT ;
624
}
619
}
625
 
620
 
626
sub sortuniq {
621
sub sortuniq {
627
  my $prev = "not $_[0]";
622
  my $prev = "not $_[0]";
628
  grep { $_ ne $prev && ($prev = $_, 1) } sort @_;
623
  grep { $_ ne $prev && ($prev = $_, 1) } sort @_;