>From b33a50ba42fee982662ca34001c2495d1787b4fd Mon Sep 17 00:00:00 2001 From: Akira Yokosawa <akiyks@xxxxxxxxx> Date: Thu, 31 Jan 2019 00:07:53 +0900 Subject: [PATCH 1/6] fcvextract.pl: Treat '.spin' files as C sources "spin" command accepts preprocessor directives and comments of C style. Merge the setup of regular expressions for ".spin" files with that for C sources. Signed-off-by: Akira Yokosawa <akiyks@xxxxxxxxx> --- utilities/fcvextract.pl | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/utilities/fcvextract.pl b/utilities/fcvextract.pl index f8f274b..8f5797e 100755 --- a/utilities/fcvextract.pl +++ b/utilities/fcvextract.pl @@ -105,7 +105,7 @@ # NOTE: "#ifdef FCV_SNIPPET" is not recognized. # "#else" can be omitted. # -# Copyright (C) Akira Yokosawa, 2018 +# Copyright (C) Akira Yokosawa, 2018, 2019 # # Authors: Akira Yokosawa <akiyks@xxxxxxxxx> @@ -142,14 +142,10 @@ $extract_labelbase = $ARGV[1]; $begin_re = qr/\\begin\{snippet\}.*labelbase=[^,\]]*$extract_labelbase[,\]]/ ; $end_re = qr/\\end\{snippet\}/; -if ($src_file =~ /.*\.[ch]$/ ) { +if ($src_file =~ /.*\.[ch]$/ || $src_file =~ /.*\.spin$/) { $lnlbl_re = qr!(.*?)(\s*//\s*)\\lnlbl\{(.*)}\s*$!; $lnlbl_re2 = qr!(.*?)(s*/\*\s*)\\lnlbl\{(.*)}\s*\*/(.*)$!; $c_src = 1; -} elsif ($src_file =~ /.*\.c$/ ) { - $lnlbl_re = qr!(.*?)(\s*//\s*)\\lnlbl\{(.*)}\s*$!; -} elsif ($src_file =~ /.*\.spin$/ ) { - $lnlbl_re = qr!(.*?)(\s*//\s*)\\lnlbl\{(.*)}\s*$!; } elsif ($src_file =~ /.*\.sh$/ ) { $lnlbl_re = qr!(.*?)(\s*#\s*)\\lnlbl\{(.*)}\s*$!; } elsif ($src_file =~ /.\.ltms$/ ) { -- 2.7.4