universal-ctags / ctags

A maintained ctags implementation
https://ctags.io
GNU General Public License v2.0
6.51k stars 622 forks source link

Warning reported when running make units #3865

Closed masatake closed 9 months ago

masatake commented 9 months ago

After upgrading to Fedora 39 from 38, I got:

[yamato@dev64]~/var/ctags-github%       make units LANGUAGES=V
REPOINFO   main/repoinfo.h
  CCLD     ctags
  RUN      units
/home/yamato/var/ctags-github/./misc/units.py:284: SyntaxWarning: invalid escape sequence '\('
  'ctags': 's%\(^[^\t]\{1,\}\t\)\(/\{0,1\}\([^/\t]\{1,\}/\)*\)%\\1%',
/home/yamato/var/ctags-github/./misc/units.py:303: SyntaxWarning: invalid escape sequence '\/'
  'etags': 's%.*\/\(input[-._][[:print:]]\{1,\}\),\([0-9]\{1,\}$\)%\\1,\\2%',
/home/yamato/var/ctags-github/./misc/units.py:304: SyntaxWarning: invalid escape sequence '\('
  'xref': 's%\(.*[[:digit:]]\{1,\} \)\([^ ]\{1,\}[^ ]\{1,\}\)/\([^ ].\{1,\}.\{1,\}$\)%\\1\\3%',
/home/yamato/var/ctags-github/./misc/units.py:305: SyntaxWarning: invalid escape sequence '\('
  'json': 's%\("path": \)"[^"]\{1,\}/\([^/"]\{1,\}\)"%\\1"\\2"%',
masatake commented 9 months ago
diff --git a/misc/units.py b/misc/units.py
index 542fdb5eb..0be926656 100755
--- a/misc/units.py
+++ b/misc/units.py
@@ -281,7 +281,7 @@ def run_shrink(cmdline_template, finput, foutput, lang):
 # otherwise return a list of command line arguments.
 def basename_filter(internal, output_type):
     filters_external = {
-            'ctags': 's%\(^[^\t]\{1,\}\t\)\(/\{0,1\}\([^/\t]\{1,\}/\)*\)%\\1%',
+            'ctags': 's%(^[^\t]{1,}\t)(/{0,1}([^/\t]{1,}/)*)%\\1%',
             # "input" in the expresion is for finding input file names in the TAGS file.
             # RAWOUT.tmp:
             #
@@ -300,9 +300,9 @@ def basename_filter(internal, output_type):
             #
             # FIXME: if "input" is included as a substring of tag entry names, filtering
             # with this expression makes the test fail.
-            'etags': 's%.*\/\(input[-._][[:print:]]\{1,\}\),\([0-9]\{1,\}$\)%\\1,\\2%',
-            'xref': 's%\(.*[[:digit:]]\{1,\} \)\([^ ]\{1,\}[^ ]\{1,\}\)/\([^ ].\{1,\}.\{1,\}$\)%\\1\\3%',
-            'json': 's%\("path": \)"[^"]\{1,\}/\([^/"]\{1,\}\)"%\\1"\\2"%',
+            'etags': 's%.*/(input[-._][[:print:]]{1,}),([0-9]{1,}$)%\\1,\\2%',
+            'xref': 's%(.*[[:digit:]]{1,} )([^ ]{1,}[^ ]{1,})/([^ ].{1,}.{1,}$)%\\1\\3%',
+            'json': 's%("path": )"[^"]{1,}/([^/"]{1,})"%\\1"\\2"%',
             }
     filters_internal = {
             'ctags': [r'(^[^\t]+\t)(/?([^/\t]+/)*)', r'\1'],