syntax: adjust the magic strings for the changes since file-5.10
Since file-5.10 (end of 2011), libmagic identifies a C file in most cases as "C source" instead of as "C program". Nano's magic strings for some other files didn't match any more what file-5.32 currently produces, either. So, they have been adjusted, new ones added, and old ones deleted. This fixes https://savannah.gnu.org/bugs/?52445.master
parent
11a3bc484c
commit
bacb0f717d
|
@ -1,7 +1,7 @@
|
|||
## Here is an example for assembler.
|
||||
|
||||
syntax "asm" "\.(S|s|asm)$"
|
||||
magic "[Aa]ssembl(y|er)"
|
||||
magic "assembler source"
|
||||
comment "//"
|
||||
|
||||
color red "\<[A-Z_]{2,}\>"
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
## Here is an example for awk.
|
||||
|
||||
syntax "awk" "\.awk$"
|
||||
magic "awk.*script text"
|
||||
magic "awk script"
|
||||
comment "#"
|
||||
|
||||
# Records.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
## Here is an example for C/C++.
|
||||
|
||||
syntax "c" "\.(c(c|pp|xx|\+\+)?|C)$" "\.(h(h|pp|xx)?|H)$" "\.ii?$"
|
||||
magic "(ASCII|UTF-8 Unicode) C(\+\+)? program text"
|
||||
magic "^(C|C\+\+) (source|program)"
|
||||
comment "//"
|
||||
|
||||
# Constants.
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
## Here is an example for Emacs Lisp.
|
||||
|
||||
syntax "elisp" "\.el$"
|
||||
magic "Lisp/Scheme program"
|
||||
comment ";"
|
||||
|
||||
# Basic functions/macros
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
syntax "guile" "\.scm$"
|
||||
header "^#!.*guile"
|
||||
magic "guile"
|
||||
comment ";"
|
||||
|
||||
# Basic scheme functions
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
## Here is an example for HTML.
|
||||
|
||||
syntax "html" "\.html?$"
|
||||
magic "HTML document text"
|
||||
magic "HTML document"
|
||||
comment "<!--|-->"
|
||||
|
||||
# Tags:
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
## Version: 2011-05-05
|
||||
|
||||
syntax "lua" "\.lua$"
|
||||
magic "Lua script"
|
||||
comment "--"
|
||||
|
||||
color brightwhite "\[\[.*\]\]"
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
## Here is an example for Makefiles.
|
||||
|
||||
syntax "makefile" "Makefile[^/]*$" "\.(make|mk)$"
|
||||
magic "makefile script"
|
||||
comment "#"
|
||||
|
||||
color red "[:=]"
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
## Here is an example for manpages.
|
||||
|
||||
syntax "man" "\.[1-9]x?$"
|
||||
magic "troff or preprocessor input text"
|
||||
magic "troff or preprocessor input"
|
||||
comment ".\""
|
||||
|
||||
color green "\.(SH|SS|TH) .*$"
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
## Here is an example for C/C++/Obj-C.
|
||||
|
||||
syntax "m" "\.m$"
|
||||
magic "Objective-C source"
|
||||
comment "//"
|
||||
|
||||
# Stuffs,
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
## Syntax highlighting for OCaml.
|
||||
|
||||
syntax "ocaml" "\.mli?$"
|
||||
magic "OCaml"
|
||||
comment "(*|*)"
|
||||
|
||||
# Uid:
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
## Here is an example for patch files.
|
||||
|
||||
syntax "patch" "\.(patch|diff|debdiff)$"
|
||||
magic "diff output text"
|
||||
magic "diff output"
|
||||
# There is no official support for comments in patch files.
|
||||
comment ""
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
syntax "perl" "\.p[lm]$"
|
||||
header "^#!.*perl[-0-9._]*"
|
||||
magic "Perl script text"
|
||||
magic "Perl script"
|
||||
comment "#"
|
||||
|
||||
color red "\<(accept|alarm|atan2|bin(d|mode)|c(aller|h(dir|mod|op|own|root)|lose(dir)?|onnect|os|rypt)|d(bm(close|open)|efined|elete|ie|o|ump)|e(ach|of|val|x(ec|ists|it|p))|f(cntl|ileno|lock|ork))\>" "\<(get(c|login|peername|pgrp|ppid|priority|pwnam|(host|net|proto|serv)byname|pwuid|grgid|(host|net)byaddr|protobynumber|servbyport)|([gs]et|end)(pw|gr|host|net|proto|serv)ent|getsock(name|opt)|gmtime|goto|grep|hex|index|int|ioctl|join)\>" "\<(keys|kill|last|length|link|listen|local(time)?|log|lstat|m|mkdir|msg(ctl|get|snd|rcv)|next|oct|open(dir)?|ord|pack|pipe|pop|printf?|push|q|qq|qx|rand|re(ad(dir|link)?|cv|do|name|quire|set|turn|verse|winddir)|rindex|rmdir|s|scalar|seek(dir)?)\>" "\<(se(lect|mctl|mget|mop|nd|tpgrp|tpriority|tsockopt)|shift|shm(ctl|get|read|write)|shutdown|sin|sleep|socket(pair)?|sort|spli(ce|t)|sprintf|sqrt|srand|stat|study|substr|symlink|sys(call|read|tem|write)|tell(dir)?|time|tr(y)?|truncate|umask)\>" "\<(un(def|link|pack|shift)|utime|values|vec|wait(pid)?|wantarray|warn|write)\>"
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
## Here is an example for PHP.
|
||||
|
||||
syntax "php" "\.ph(p[23457s~]?|tml)$"
|
||||
magic "PHP script text"
|
||||
magic "PHP script"
|
||||
comment "//"
|
||||
|
||||
# PHP markings.
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
## Here is an example for PostgreSQL.
|
||||
|
||||
syntax "sql" "\.sql[2345s~]?$"
|
||||
magic "PostgreSQL script text"
|
||||
comment "-- "
|
||||
|
||||
# Functions.
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
syntax "python" "\.py$"
|
||||
header "^#!.*python[-0-9._]*"
|
||||
magic "Python script"
|
||||
linter pyflakes
|
||||
comment "#"
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
syntax "ruby" "\.rb$"
|
||||
header "^#!.*ruby[-0-9._]*"
|
||||
magic "Ruby script"
|
||||
linter ruby -w -c
|
||||
comment "#"
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
syntax "sh" "\.sh$"
|
||||
header "^#!.*((ba|da|k|pdk)?sh[-0-9_]*|openrc-run|runscript)"
|
||||
magic "(POSIX|Bourne.*) shell script text"
|
||||
magic "(POSIX|Bourne-Again) shell script.*text"
|
||||
linter dash -n
|
||||
comment "#"
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
## Syntax highlighting for Tcl files.
|
||||
|
||||
syntax "tcl" "\.tcl$"
|
||||
magic "Tcl(/Tk)? script"
|
||||
comment "#"
|
||||
|
||||
# Standard Tcl [info commands]:
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
## Here is a short example for TeX files.
|
||||
|
||||
syntax "tex" "\.tex$"
|
||||
magic "(La)?TeX document"
|
||||
linter chktex -v0 -q -I
|
||||
comment "%"
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
syntax "texinfo" "\.texi$"
|
||||
header "^\\input texinfo"
|
||||
magic "Texinfo source text"
|
||||
magic "Texinfo source"
|
||||
comment "@c "
|
||||
|
||||
# Command arguments, trailing and enclosed.
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
syntax "xml" "\.([jrsx]html?|jnlp|mml|pom|rng|sgml?|svg|w[as]dl|wsdd|xjb|xml|xs(d|lt?)|xul)$"
|
||||
header "<\?xml.*version=.*\?>"
|
||||
magic "(XML|SGML) (sub)?document text"
|
||||
magic "(XML|SGML) (sub)?document"
|
||||
comment "<!--|-->"
|
||||
|
||||
# The entire content of the tag:
|
||||
|
|
Loading…
Reference in New Issue