[Pkg-mc-devel] Bug#844212: Bug#844212: mc: improved syntax detections for sh, perl, makefile and m4
Yury V. Zaytsev
yury at shurup.com
Sun Nov 13 15:49:13 UTC 2016
On Sun, 13 Nov 2016, Jonas Smedegaard wrote:
> Similar patterns likely makes sense to expand to other syntaxes as well.
In the future, please post such patches directly to the upstream bug
tracker; they are not Debian-specific, and all you gonna get out of
posting them to the Debian bug tracker is a few months to a few years
delay in getting them upstreamed.
> Attached is a patch for improved syntax detections for sh, perl,
> makefile and m4.
I've committed the *.t thing, but your regexes scare the hell out of me.
I understand that these ones are some kind of editor tags, but I'm not
sure what they are actually supposed to match:
-\\\*-\s\*(.\*;)?(mode:\s)?.\*(sh|shell-script)(;.\*)?\s-\\\*-
-\\\*-\s\*(.\*;)?mode:\smakefile(;.\*)?\s-\\\*-)
-\\\*-\s\*(.\*;)?(mode:\s)?.\*Autotest(;.\*)?\s-\\\*-
Besides, the whole composition is somehow weird and inconsistent:
^#\s\*(!\s\*(/usr/bin/)?make|-\\\*-\s\*(.\*;)?mode:\smakefile(;.\*)?\s-\\\*-)
^ spaces in shebang?!
^ why this is optional?!
^#\s\*!\s\*(/usr/bin/)?m4|-\\\*-\s\*(.\*;)?(mode:\s)?.\*Autotest(;.\*)?\s-\\\*-
^ no parens unlike above?!
^#!\s\*/(.\*/|usr/bin/env\s)([a-z]?|ba|pdk)sh|-\\\*-\s\*(.\*;)?(mode:\s)?.\*(sh|shell-script)(;.\*)?\s-\\\*-
^ can't be a valid script
I'm sorry, but I think this is unfit to be committed.
--
Sincerely yours,
Yury V. Zaytsev
More information about the Pkg-mc-devel
mailing list