From ea6e267dc2ee97574b3c19da1c4a6605dac9c5a5 Mon Sep 17 00:00:00 2001 From: Hugo Villeneuve Date: Wed, 17 Nov 2021 22:31:12 -0500 Subject: [PATCH] Correction de warnings (left brace escaping) ...Unescaped left brace in regex is deprecated here... --- gtx2tex.pl | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/gtx2tex.pl b/gtx2tex.pl index 668cdf5..d4bfed5 100644 --- a/gtx2tex.pl +++ b/gtx2tex.pl @@ -299,7 +299,7 @@ sub directive{ }elsif ( /{even}/ ) { print TEX "\\ifthenelse{\\isodd{\\thepage}}{}{\\newpage ~}"; }elsif ( /{title:|{t:/ ) { - s/({.*:)(.+)(})/\2/; + s/(\{.*:)(.+)(\})/\2/; if ( $document_class eq "book" ){ print TEX "$define" unless ( $lyrics ); } @@ -312,22 +312,22 @@ sub directive{ $song_title = $_; $verbose && print TEX "\\typeout{$_}"; }elsif ( /{subtitle:|{st:/ ) { - s/({.*:)(.+)(})/\2/; + s/(\{.*:)(.+)(\})/\2/; print TEX "\\index{$_!$song_title}"; print TEX "\\begin{center}$_\\end{center}\n"; }elsif ( /{margin:|{m:/ ) { - s/({.*:)(.+)(})/\2/; + s/(\{.*:)(.+)(\})/\2/; print TEX "\\marginpar{$_}\n"; }elsif ( /{comment:|{c:/ ) { - s/({.*:)(.+)(})/\2/; + s/(\{.*:)(.+)(\})/\2/; print TEX "\\textit{$_}\\\\\n" unless ( $lyrics ); }elsif ( /{second:|{2:/ ) { - s/({.*:)(.+)(})/\2/; + s/(\{.*:)(.+)(\})/\2/; s/\s/$space/g; #Leerzeichen durch feste Leerzeichen ersetzen print TEX "\\colorbox{second_back}{\\textcolor{second_text}{$_}}\\\\\n" unless ( $lyrics ); }elsif ( /{chapter:/ ) { $chaptercount++; - s/({.*:)(.+)(})/\2/; + s/(\{.*:)(.+)(\})/\2/; if ( $document_class eq "book" ) { print TEX "$define" unless ( $lyrics ); $define = ""; @@ -369,7 +369,7 @@ sub directive{ sub newtab { if ( /{guitartab:/ ) { $guitartab="yes" } else { $guitartab ="no" }; - s/({.*:)(.+)(})/\2/; + s/(\{.*:)(.+)(\})/\2/; s/\]\[/\]~~~\[/g; #fill in fixed spaces between notes s/\_/~~~/g; #fill in extra space s/\s/~/g; #replace spaces with fixed spaced @@ -418,47 +418,47 @@ sub latex_header { if ( /^{/ ) { # nur Zeilen mit Direktiven bearbeiten chomp; if ( /{book_title:/ ) { - s/({.*:)(.+)(})/\2/; + s/(\{.*:)(.+)(\})/\2/; $title = $_ ; }elsif ( /{book_author:/ ) { - s/({.*:)(.+)(})/\2/; + s/(\{.*:)(.+)(\})/\2/; $author = $_ ; }elsif ( /{book_date:/ ) { - s/({.*:)(.+)(})/\2/; + s/(\{.*:)(.+)(\})/\2/; $date = $_ ; }elsif ( /{document_class:/ ) { - s/({.*:)(.+)(})/\2/; + s/(\{.*:)(.+)(\})/\2/; $document_class = $_ ; $verbose && print "Document_class: $document_class\n"; if ( $document_class ne "book" && $document_class ne "article" ) { die "parameter of directive document_class must be \"book\" or \"article\"\n"; } }elsif ( /{font_size:/ ) { - s/({.*:)(.+)(})/\2/; + s/(\{.*:)(.+)(\})/\2/; $font_size = $_ ; }elsif ( /{color_chorus:/ ) { - s/({.*:)(.+)(})/\2/; + s/(\{.*:)(.+)(\})/\2/; $color_chorus = $_ ; }elsif ( /{color_bridge:/ ) { - s/({.*:)(.+)(})/\2/; + s/(\{.*:)(.+)(\})/\2/; $color_bridge = $_ ; }elsif ( /{color_instr:/ ) { - s/({.*:)(.+)(})/\2/; + s/(\{.*:)(.+)(\})/\2/; $color_instr = $_ ; }elsif ( /{color_tab:/ ) { - s/({.*:)(.+)(})/\2/; + s/(\{.*:)(.+)(\})/\2/; $color_tab = $_ ; }elsif ( /{color_second:/ ) { - s/({.*:)(.+)(})/\2/; + s/(\{.*:)(.+)(\})/\2/; $color_second = $_ ; }elsif ( /{color_second_back:/ ) { - s/({.*:)(.+)(})/\2/; + s/(\{.*:)(.+)(\})/\2/; $color_second_back = $_ ; }elsif ( /{geometry:|{g:/ ) { - s/({.*:)(.+)(})/\2/; + s/(\{.*:)(.+)(\})/\2/; $geometry .= "$_," ; }elsif ( /{preamble:|{p:/ ) { - s/({.*:)(.+)(})/\2/; + s/(\{.*:)(.+)(\})/\2/; $preamble .= "$_\n" ; }elsif ( /{musixtex}/ ) { $musixtex = "yes"; @@ -467,7 +467,7 @@ sub latex_header { }elsif ( /{tabdefs}/ ) { $tabdefs = "yes"; }elsif ( /{chapter/ ) { - s/({.*:)(.+)(})/\2/; + s/(\{.*:)(.+)(\})/\2/; $chaptercount++; push @titlecount, (0); }elsif ( /{title:|{t:/ ) { @@ -686,7 +686,7 @@ sub includes{ while ( ){ if ( /{include:/ ) { #read only lines with an include directive chomp; # avoid \n on last field - s/({.*:)(.+)(})/\2/; + s/(\{.*:)(.+)(\})/\2/; print TMP "#$_\n#\n"; open ( INSERT, '<', "$dirname/$_" ) || die "cannot open include file: $_"; -- 2.20.1