diff options
author | Dan Pasanen <dan.pasanen@gmail.com> | 2015-11-24 10:42:12 -0600 |
---|---|---|
committer | Dan Pasanen <dan.pasanen@gmail.com> | 2015-11-24 10:47:01 -0600 |
commit | 1e4d729988f35472b76503307bc7b6d5df41bb58 (patch) | |
tree | 1f308e8ec4850c269aedafe541b2cbabaff135b7 /doc/syntax | |
parent | b760778d85895bae3ffda11979c5b7560cbfe0c8 (diff) | |
download | android_external_nano-1e4d729988f35472b76503307bc7b6d5df41bb58.tar.gz android_external_nano-1e4d729988f35472b76503307bc7b6d5df41bb58.tar.bz2 android_external_nano-1e4d729988f35472b76503307bc7b6d5df41bb58.zip |
nano-2.4.2
Diffstat (limited to 'doc/syntax')
-rw-r--r-- | doc/syntax/Makefile.am | 3 | ||||
-rw-r--r-- | doc/syntax/Makefile.in | 3 | ||||
-rw-r--r-- | doc/syntax/changelog.nanorc | 7 | ||||
-rw-r--r-- | doc/syntax/debian.nanorc | 11 | ||||
-rw-r--r-- | doc/syntax/elisp.nanorc | 31 | ||||
-rw-r--r-- | doc/syntax/groff.nanorc | 4 | ||||
-rw-r--r-- | doc/syntax/guile.nanorc | 24 | ||||
-rw-r--r-- | doc/syntax/nanorc.nanorc | 6 | ||||
-rw-r--r-- | doc/syntax/php.nanorc | 2 | ||||
-rw-r--r-- | doc/syntax/po.nanorc | 8 | ||||
-rw-r--r-- | doc/syntax/postgresql.nanorc | 75 | ||||
-rw-r--r-- | doc/syntax/python.nanorc | 5 | ||||
-rw-r--r-- | doc/syntax/ruby.nanorc | 1 | ||||
-rw-r--r-- | doc/syntax/sh.nanorc | 1 | ||||
-rw-r--r-- | doc/syntax/tex.nanorc | 1 | ||||
-rw-r--r-- | doc/syntax/xml.nanorc | 15 |
16 files changed, 175 insertions, 22 deletions
diff --git a/doc/syntax/Makefile.am b/doc/syntax/Makefile.am index 03bc8e3e..5c9cb21c 100644 --- a/doc/syntax/Makefile.am +++ b/doc/syntax/Makefile.am @@ -6,10 +6,12 @@ pkgdata_DATA = asm.nanorc \ css.nanorc \ debian.nanorc \ default.nanorc \ + elisp.nanorc \ fortran.nanorc \ gentoo.nanorc \ go.nanorc \ groff.nanorc \ + guile.nanorc \ html.nanorc \ java.nanorc \ javascript.nanorc \ @@ -26,6 +28,7 @@ pkgdata_DATA = asm.nanorc \ perl.nanorc \ php.nanorc \ po.nanorc \ + postgresql.nanorc \ pov.nanorc \ python.nanorc \ ruby.nanorc \ diff --git a/doc/syntax/Makefile.in b/doc/syntax/Makefile.in index f86e5043..09734bb7 100644 --- a/doc/syntax/Makefile.in +++ b/doc/syntax/Makefile.in @@ -277,10 +277,12 @@ pkgdata_DATA = asm.nanorc \ css.nanorc \ debian.nanorc \ default.nanorc \ + elisp.nanorc \ fortran.nanorc \ gentoo.nanorc \ go.nanorc \ groff.nanorc \ + guile.nanorc \ html.nanorc \ java.nanorc \ javascript.nanorc \ @@ -297,6 +299,7 @@ pkgdata_DATA = asm.nanorc \ perl.nanorc \ php.nanorc \ po.nanorc \ + postgresql.nanorc \ pov.nanorc \ python.nanorc \ ruby.nanorc \ diff --git a/doc/syntax/changelog.nanorc b/doc/syntax/changelog.nanorc index b40b936f..904a8c15 100644 --- a/doc/syntax/changelog.nanorc +++ b/doc/syntax/changelog.nanorc @@ -13,13 +13,16 @@ color yellow "<[^>]*@[^>]*>" color cyan "[[:space:]]-[a-zA-Z\$]" "--[8a-z-]+" # Bug and patch numbers. color cyan "bug #[0-9]{5,6}" "patch #[0-9]{4,5}" -# Probable variables, for variety. +# Probable constants, for variety. color brightred "\<[A-Z_][0-9A-Z_]+\>" # Key sequences. color brightblue "\^[A-Z]" "\<M-." "\<F1?[0-9]" "(\^|M-)Space" # Changed files. -color magenta start="^( | {8})\* " end=":( |$)" +color magenta start="^( | {8})\* " end="(:( |$)|^$)" + +# Release markers. +color brightblue "^(GNU )?nano[- ][0-9]\.[0-9]\.[^ ]+" # Trailing whitespace. color ,green "[[:space:]]+$" diff --git a/doc/syntax/debian.nanorc b/doc/syntax/debian.nanorc index f87e2246..7d0a6375 100644 --- a/doc/syntax/debian.nanorc +++ b/doc/syntax/debian.nanorc @@ -1,19 +1,20 @@ ## Here is an example for apt's sources.list. -syntax "apt/sources.list" "sources\.list(~|\.old|\.save)?$" "sources\.list\.d/.*\.list(~|\.old|\.save)?$" +syntax "sources.list" "sources\.list(~|\.old|\.save)?$" "sources\.list\.d/.*\.list(~|\.old|\.save)?$" # Coloring the deb lines, working from tail to head. First the # components -- well, everything, and thus also the components. color brightmagenta "^deb.*" # Distribution -- well, everything, except the components. -color brightred "^deb(-src)? ((http(s)?|ftp|rsh|ssh|file|copy|tor|spacewalk):/[^ ]+|cdrom:\[[-a-zA-Z0-9\._\(\) ]+\]/) [^ ]+" +color brightred "^deb(-src)?\s+.*((ftp|https?|rsh|ssh|copy|file|spacewalk|tor):/\S+|cdrom:\[.+\]/)\s+\S+" # URIs. -color brightgreen "(http(s)?|ftp|rsh|ssh|file|copy|tor|spacewalk):/[^ ]+" +color brightgreen "^deb(-src)?\s+.*(ftp|https?|rsh|ssh|copy|file|spacewalk|tor):/\S+" # CDroms. -color brightgreen "cdrom:\[[-a-zA-Z0-9\._\(\) ]+\]/" +color brightgreen "^deb(-src)?\s+.*cdrom:\[.+\]/" +# Options. +color brightcyan "^deb(-src)?\s+\[.+\]\s+" # And finally the initial deb tag. color yellow "^deb(-src)?" # Comments. color brightblue "#.*" - diff --git a/doc/syntax/elisp.nanorc b/doc/syntax/elisp.nanorc new file mode 100644 index 00000000..2a2bd2eb --- /dev/null +++ b/doc/syntax/elisp.nanorc @@ -0,0 +1,31 @@ +## Here is an example for Emacs Lisp. + +syntax "elisp" "\.el$" + +# Basic functions/macros +color brightcyan "\<(if|when|unless|cond|and|or|lambda|let|progn|while|dolist|dotimes)\>" +color brightcyan "\<save-((window-)?excursion|restriction)\>" +color brightcyan "\<eval-(and|when)-compile\>" +# Defining functions +color brightcyan "\<def(un|macro|subst|generic|alias)\>" +color brightcyan "\<cl-def(un|macro|subst|generic|struct|type)\>" +color brightcyan "\<define-(derived|minor|generic)-mode\>" +# Defining variables +color brightcyan "\<def(class|const|var(-local|alias)?)\>" +# Customization functions +color brightcyan "\<def(custom|face|group|theme)\>" +# Setting values +color brightcyan "\<(setq(-default|-local)?|setf|push|pop|declare(-function)?)\>" +# Feature functions +color brightcyan "\<(require|provide)\>" +# Quoted symbols +color brightyellow "#?'\<(\w|-)+\>" +# Booleans +color brightred "\<(t|nil)\>" +# Keywords +color blue ":(\w|[?-])+" +# Strings +color yellow start="^[[:blank:]]+\"" end="[^\]\"" +color yellow ""(\\.|[^"])*"" +# Comments +color cyan "(^|[[:space:]]);.*$" diff --git a/doc/syntax/groff.nanorc b/doc/syntax/groff.nanorc index 70f641d3..5f57f8e6 100644 --- a/doc/syntax/groff.nanorc +++ b/doc/syntax/groff.nanorc @@ -3,7 +3,7 @@ syntax "groff" "\.m[ems]$" "\.rof" "\.tmac$" "^tmac." # The argument of .ds or .nr -color cyan "^\.(ds|nr) [^[[:space:]]]*" +color cyan "^\.(ds|nr) [^[:space:]]*" # Single-character escapes color brightmagenta "\\." # The argument of \f or \s in the same color @@ -12,7 +12,7 @@ color brightmagenta "\\f." "\\f\(.." "\\s(\+|\-)?[0-9]" color cyan "(\\|\\\\)n(.|\(..)" color cyan start="(\\|\\\\)n\[" end="]" # Requests -color brightgreen "^\.[[:space:]]*[^[[:space:]]]*" +color brightgreen "^\.[[:space:]]*[^[:space:]]*" # Comments color yellow "^\.\\".*$" # Strings diff --git a/doc/syntax/guile.nanorc b/doc/syntax/guile.nanorc new file mode 100644 index 00000000..1feb09b2 --- /dev/null +++ b/doc/syntax/guile.nanorc @@ -0,0 +1,24 @@ +## Here is an example for Guile Scheme. + +syntax "guile" "\.scm$" +header "^#!.*guile" +magic "guile" + +# Basic scheme functions +color green "\<(do|if|lambda|let(rec)?|map|unless|when)\>" +# Defining things +color brightcyan "\<define(-macro|-module|-public|-syntax)?\>" +# Quoted symbols +color brightyellow "'\<(\w|-)+\>" +# Chars +color brightmagenta "#\\." +color brightmagenta "#\\\w+\>" +# Booleans +color brightred "(#t|#f)\>" +# Keywords +color blue "#?:(\w|[?-])+" +# Strings +color yellow start="^[[:blank:]]+\"" end="[^\]\"" +color yellow ""(\\.|[^"])*"" +# Comments +color cyan "(^|[[:space:]]);.*$" diff --git a/doc/syntax/nanorc.nanorc b/doc/syntax/nanorc.nanorc index 1858f2b0..3cf0bee9 100644 --- a/doc/syntax/nanorc.nanorc +++ b/doc/syntax/nanorc.nanorc @@ -9,10 +9,10 @@ icolor brightred "^[[:space:]]*((un)?(bind|set)|include|syntax|header|magic|lint icolor brightgreen "^[[:space:]]*(set|unset)[[:space:]]+(allow_insecure_backup|autoindent|backup|backwards|boldtext|casesensitive|const|cut|fill|historylog|locking|morespace|mouse|multibuffer|noconvert|nofollow|nohelp|nonewlines|nowrap|poslog|preserve|quickblank|quiet|rebinddelete|rebindkeypad|regexp|smarthome|smooth|softwrap|suspend|tabsize|tabstospaces|tempfile|view|wordbounds)\>" icolor yellow "^[[:space:]]*set[[:space:]]+(functioncolor|keycolor|statuscolor|titlecolor)[[:space:]]+(bright)?(white|black|red|blue|green|yellow|magenta|cyan)?(,(white|black|red|blue|green|yellow|magenta|cyan))?\>" icolor brightgreen "^[[:space:]]*set[[:space:]]+(backupdir|brackets|functioncolor|keycolor|matchbrackets|operatingdir|punct|quotestr|speller|statuscolor|titlecolor|whitespace)[[:space:]]+" -icolor brightgreen "^[[:space:]]*bind[[:space:]]+((\^|M-)([[:alpha:]]|space|[]]|[0-9_=+{}|;:'\",./<>\?-])|F([1-9]|1[0-6])|Ins|Del)[[:space:]]+[[:alpha:]]+[[:space:]]+[[:alpha:]]+[[:space:]]*$" -icolor brightgreen "^[[:space:]]*unbind[[:space:]]+((\^|M-)([[:alpha:]]|space|[]]|[0-9_=+{}|;:'\",./<>\?-])|F([1-9]|1[0-6])|Ins|Del)[[:space:]]+[[:alpha:]]+[[:space:]]*$" +icolor brightgreen "^[[:space:]]*bind[[:space:]]+((\^|M-)([[:alpha:]]|space|[]]|[0-9_=+{}|;:'\",./<>\?-])|F([1-9]|1[0-6])|Ins|Del)[[:space:]]+[[:alpha:]]+[[:space:]]+(all|main|search|replace(2|with)?|gotoline|writeout|insert|ext(ernal)?cmd|help|spell|linter|browser|whereisfile|gotodir)+[[:space:]]*$" +icolor brightgreen "^[[:space:]]*unbind[[:space:]]+((\^|M-)([[:alpha:]]|space|[]]|[0-9_=+{}|;:'\",./<>\?-])|F([1-9]|1[0-6])|Ins|Del)[[:space:]]+(all|main|search|replace(2|with)?|gotoline|writeout|insert|ext(ernal)?cmd|help|spell|linter|browser|whereisfile|gotodir)+[[:space:]]*$" icolor brightgreen "^[[:space:]]*extendsyntax[[:space:]]+[[:alpha:]]+[[:space:]]+(i?color|header|magic|linter|formatter)[[:space:]]+.*$" -icolor green "^[[:space:]]*((un)?(bind|set)|include|syntax|header|magic|linter|extendsyntax)\>" +icolor green "^[[:space:]]*((un)?(bind|set)|include|syntax|header|magic|linter|formatter|extendsyntax)\>" # Colors icolor yellow "^[[:space:]]*i?color[[:space:]]*(bright)?(white|black|red|blue|green|yellow|magenta|cyan)?(,(white|black|red|blue|green|yellow|magenta|cyan))?\>" diff --git a/doc/syntax/php.nanorc b/doc/syntax/php.nanorc index e3c4f1fa..ea9aceed 100644 --- a/doc/syntax/php.nanorc +++ b/doc/syntax/php.nanorc @@ -25,7 +25,7 @@ color brightyellow "<[^= ]*>" ""(\.|[^"])*"" color brightblue "//.*" color brightblue start="/\*" end="\*/" ##color blue start="<" end=">" -##color red "&[^;[[:space:]]]*;" +##color red "&[^;[:space:]]*;" # Trailing whitespace. color ,green "[[:space:]]+$" diff --git a/doc/syntax/po.nanorc b/doc/syntax/po.nanorc index 567ef7ad..c4e11ebd 100644 --- a/doc/syntax/po.nanorc +++ b/doc/syntax/po.nanorc @@ -6,16 +6,16 @@ syntax "po" "\.pot?$" color green "^#.*$" color yellow "Copyright|\(C\)" # Header fields. -color brightmagenta "\<(Project\-Id\-Version|Report\-Msgid\-Bugs\-To|Last\-Translator|Language\-Team|Language|X\-Generator|Plural\-Forms)\>" +color brightmagenta "\<(Project\-Id\-Version|Report\-Msgid\-Bugs\-To|Last\-Translator|Language(\-Team)?|X\-Generator|Plural\-Forms)\>" color cyan "\<(POT\-Creation\-Date|PO\-Revision\-Date|MIME\-Version|Content\-Type|Content\-Transfer\-Encoding)\>" # Encodings and numbers. color yellow "\<(UTF|ISO|Windows|Mac|IBM)\>\-[0-9]" color yellow "[0-9]|pre[0-9]|[0-9]bit" # Msgids. -color brightblue "\<(msgid|msgid_plural|msgstr)\>" +color brightblue "^(msgid|msgid_plural|msgstr)\>" # Tags. -color red "\<fuzzy\>" -color yellow "\<c-format\>" +color red " fuzzy(,|$)" +color yellow " (no-)?[-[:alpha:]]+-format(,|$)" # Format specifiers. color brightmagenta "%([1-9]\$)?[a-z]*" # Quotes and newlines. diff --git a/doc/syntax/postgresql.nanorc b/doc/syntax/postgresql.nanorc new file mode 100644 index 00000000..cf389c4c --- /dev/null +++ b/doc/syntax/postgresql.nanorc @@ -0,0 +1,75 @@ +## Here is an example for PostgreSQL. + +syntax "sql" "\.sql[2345s~]?$" +magic "PostgreSQL script text" + +# Functions. +color white "\<[a-z_]*\(" + +# Types. +color green "\<(int2|smallint|int4|int|integer|int8|bigint|decimal|numeric|real|double precision|(small|big)?serial)\>" +color green "\<(bit( varying)?|boolean|bytea|enum|money|tsvector|uuid)\>" +color green "\<(char|varchar|character( varying)?|text)\>" +color green "\<(date|interval|time(stamp)?( with time zone| without time zone)?)\>" +color green "\<(point|line|lseg|path|box|polygon|circle)\>" +color green "\<(cidr|inet|macaddr)\>" +color green "\<(daterange|int4range|int8range|numrange|tsrange|tstzrange)\>" + +# Structure. +color brightyellow "\<(CASE|CLASS|DEFAULT|DO|ELSE|ELSEIF|FOR|FOREACH|FUNCTION|IF|IS NULL)\>" +color brightyellow "\<(NEW|PRIVATE|PUBLIC|RETURN|RETURNS|SETOF|SWITCH|THEN|WHEN|WHILE)>" + +# Control flow. +color magenta "\<(EXCEPTION|NOTICE|RAISE|RETURN)\>" + +# SQL keywords. +color blue "\<(ABORT|AGGREGATE|ALTER|ANALYZE|AND|AS|AUTHORIZATION|BEGIN|CAST|CHECKPOINT|CLASS|CLOSE)\>" +color blue "\<(CLUSTER|COLLATION|COMMENT|COMMIT|CONFIGURATION|CONSTRAINTS|CONVERSION|COPY|CREATE)\>" +color blue "\<(DATA|DATABASE|DEALLOCATE|DECLARE|DEFAULT|DELETE|DICTIONARY|DISCARD|DO|DOMAIN|DROP)\>" +color blue "\<(END|EVENT|EXECUTE|EXPLAIN|EXTENSION|FAMILY|FETCH|FOREIGN|FROM|FUNCTION)\>" +color blue "\<(GRANT|GROUP|IF NOT EXISTS|IMMUTABLE|INDEX|INSERT|INTO|LABEL|LANGUAGE|LARGE|LOAD|LOCK)\>" +color blue "\<(MAPPING FOR|MATERIALIZED|MOVE|NOTIFY|OBJECT|OPERATOR|OPTIONS|OWNED|OWNER)\>" +color blue "\<(PARSER|PREPARED?|PRIVILEGES|REASSIGN|REFRESH|RELEASE|RESET|REVOKE|ROLE|ROLLBACK|RULE)\>" +color blue "\<(SAVEPOINT|SCHEMA|SEARCH|SECURITY|SELECT|SEQUENCE|SERVER|SESSION|SET|SHOW|SPACE|START|SYSTEM)\>" +color blue "\<(TABLE|TEXT|TO|TRANSACTION|TYPE|UPDATE|USER|VACUUM|VALUES|VIEW|WHERE|WITH|WRAPPER)\>" + +# Strings. +color brightyellow "<[^= ]*>" ""(\.|[^"])*"" + +# Trailing whitespace. +color ,green "[[:space:]]+$" + +# Regular expressions. +color brightmagenta "/([^/]|(\\/))*/[iomx]*" "%r\{([^}]|(\\}))*\}[iomx]*" + +# Shell command expansion is in `backticks` or like %x{this}. These are +# "double-quotish" (to use a perlism). +color brightblue "`[^`]*`" "%x\{[^}]*\}" + +# Strings, double-quoted. +color green ""([^"]|(\\"))*"" "%[QW]?\{[^}]*\}" "%[QW]?\([^)]*\)" "%[QW]?<[^>]*>" +color green "%[QW]?\[[^]]*\]" "%[QW]?\$[^$]*\$" "%[QW]?\^[^^]*\^" "%[QW]?![^!]*!" + +# Expression substitution. These go inside double-quoted strings, +# "like #{this}". +color brightgreen "#\{[^}]*\}" + +# Strings, single-quoted. +color green "'([^']|(\\'))*'" "%[qw]\{[^}]*\}" "%[qw]\([^)]*\)" "%[qw]<[^>]*>" +color green "%[qw]\[[^]]*\]" "%[qw]\$[^$]*\$" "%[qw]\^[^^]*\^" "%[qw]![^!]*!" + +# Comments. +color red "#[^{].*$" "#$" +color red "--[^{].*$" "#$" +color red "##[^{].*$" "##$" +color brightblue "//.*" +color brightblue start="/\*" end="\*/" + +# PostgreSQL markings. +color red "(--)" + +# PostgreSQL default schemas. +color brightred "(pg_catalog|public)" + +# PostgreSQL PLs. +color brightblue "(pljava|plperlu?|plpgsql|plpy|plpythonu?|plr|plruby|plsh|pltcl|plscheme)" diff --git a/doc/syntax/python.nanorc b/doc/syntax/python.nanorc index eb2b36e9..b5bd15b3 100644 --- a/doc/syntax/python.nanorc +++ b/doc/syntax/python.nanorc @@ -2,6 +2,7 @@ syntax "python" "\.py$" header "^#!.*python[-0-9._]*" +linter pyflakes # Function definitions. icolor brightblue "def [0-9A-Z_]+" @@ -15,8 +16,8 @@ color brightgreen "["][^"]*[^\\]["]" "["]{3}.*[^\\]["]{3}" # Comments. color brightred "(^|[[:blank:]])#.*$" # Multiline strings. -color brightgreen start="\"\"\"([^"),]|$)" end="(^|[^(])\"\"\"" -color brightgreen start="'''([^'),]|$)" end="(^|[^(])'''" +color brightgreen start="\"\"\"[^"),]" end="(^|[^(])\"\"\"" +color brightgreen start="'''[^'),]" end="(^|[^(])'''" # Reminders. color ,yellow "(FIXME|TODO|XXX)" diff --git a/doc/syntax/ruby.nanorc b/doc/syntax/ruby.nanorc index 298425f0..a7072216 100644 --- a/doc/syntax/ruby.nanorc +++ b/doc/syntax/ruby.nanorc @@ -2,6 +2,7 @@ syntax "ruby" "\.rb$" header "^#!.*ruby[-0-9._]*" +linter ruby -w -c # Reserved words. color yellow "\<(BEGIN|END|alias|and|begin|break|case|class|def|defined\?|do|else|elsif|end|ensure|false|for|if|in|module)\>" diff --git a/doc/syntax/sh.nanorc b/doc/syntax/sh.nanorc index 074e03ac..11eb9a45 100644 --- a/doc/syntax/sh.nanorc +++ b/doc/syntax/sh.nanorc @@ -3,6 +3,7 @@ syntax "sh" "\.sh$" header "^#!.*((ba|da|k|pdk)?sh[-0-9_]*|openrc-run|runscript)" magic "(POSIX|Bourne.*) shell script text" +linter dash -n icolor brightgreen "^[0-9A-Z_]+\(\)" color green "\<(break|case|continue|do|done|elif|else|esac|exit|fi|for|function|if|in|read|return|select|shift|then|time|until|while)\>" diff --git a/doc/syntax/tex.nanorc b/doc/syntax/tex.nanorc index 7fa417c4..a89cff90 100644 --- a/doc/syntax/tex.nanorc +++ b/doc/syntax/tex.nanorc @@ -1,6 +1,7 @@ ## Here is a short example for TeX files. syntax "tex" "\.tex$" +linter chktex -v0 -q -I icolor green "\\.|\\[A-Z]*" color magenta "[{}]" diff --git a/doc/syntax/xml.nanorc b/doc/syntax/xml.nanorc index 69982ea8..10e6867b 100644 --- a/doc/syntax/xml.nanorc +++ b/doc/syntax/xml.nanorc @@ -1,11 +1,20 @@ ## Here is an example for XML files. -syntax "xml" "\.([jrs]html?|sgml?|xml|xslt?)$" +syntax "xml" "\.([jrsx]html?|jnlp|mml|pom|rng|sgml?|svg|w[as]dl|wsdd|xjb|xml|xs(d|lt?)|xul)$" magic "(XML|SGML) (sub)?document text" +# The entire content of the tag: color green start="<" end=">" -color cyan "<[^> ]+" -color cyan ">" + +# The start and the end of the tag: +color cyan "<[^> ]+" ">" + +# The strings inside the tag: +color magenta "\"[^"]*\"" + +# Comments: color yellow start="<!DOCTYPE" end="[/]?>" color yellow start="<!--" end="-->" + +# Escapes: color red "&[^;]*;" |