From 215eb3645e98a9cbe8ecfd3831869d6ce68774a5 Mon Sep 17 00:00:00 2001 From: Chris Allegretta Date: Wed, 1 Oct 2008 00:49:19 +0000 Subject: [PATCH] 2008-09-30 * ocaml.nanorc: Sample OCaml syntax highlighting file 2008-09-30 Dave Geering * objc.nanorc: Sample Objective-C Syntax Hightlighting file git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4332 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- ChangeLog | 9 +++++++++ doc/syntax/Makefile.am | 4 +++- doc/syntax/objc.nanorc | 41 +++++++++++++++++++++++++++++++++++++++++ doc/syntax/ocaml.nanorc | 27 +++++++++++++++++++++++++++ 4 files changed, 80 insertions(+), 1 deletion(-) create mode 100644 doc/syntax/objc.nanorc create mode 100644 doc/syntax/ocaml.nanorc diff --git a/ChangeLog b/ChangeLog index 74482d8e..b0df6f2c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,14 +1,23 @@ +2008-09-30 + * ocaml.nanorc: Sample OCaml syntax highlighting file + +2008-09-30 Dave Geering + * objc.nanorc: Sample Objective-C Syntax Hightlighting file + 2008-09-30 Chris Allegretta * configure.ac: Change extra, multibuffer, color and rcfile configure options to default to enabled --enable-tiny will now disable these options as well * python.nanorc, ruby.nanorc: Add header lines for python and ruby as well + 2008-09-21 Chris Allegretta * rcfile.c, color.c, nano.h: Add new capability for matching a syntax type by the "header" (1st line) of a file being edited. Based on Savannah bug 24197 and inital proof of concept by Dave Geering + 2008-09-16 Chris Allegretta * text.c: Add support for undoing a text uncut. Split out the undo and redo of a text cut in order to avoid code duplication. + 2008-09-06 Chris Allegretta * nano.c: Do call disable_signals at startup regardless, since under cygwin we can't generate ^C without it. diff --git a/doc/syntax/Makefile.am b/doc/syntax/Makefile.am index 116d8d6b..a3bad823 100644 --- a/doc/syntax/Makefile.am +++ b/doc/syntax/Makefile.am @@ -19,6 +19,8 @@ pkgdata_DATA = asm.nanorc \ debian.nanorc \ awk.nanorc \ css.nanorc \ - xml.nanorc + xml.nanorc \ + ocaml.nanorc \ + objc.nanorc EXTRA_DIST = $(pkgdata_DATA) diff --git a/doc/syntax/objc.nanorc b/doc/syntax/objc.nanorc new file mode 100644 index 00000000..cdf6e485 --- /dev/null +++ b/doc/syntax/objc.nanorc @@ -0,0 +1,41 @@ +## Here is an example for C/C++/Obj-C. +## +syntax "m" "\.m$" + + +## Stuffs +color brightwhite "\<[A-Z_][0-9A-Z_]+\>" +color green "\<(float|double|BOOL|bool|char|int|short|long|id|sizeof|enum|void|static|const|struct|union|typedef|extern|(un)?signed|inline)\>" +color green "\<[[:alpha:]_][[:alnum:]_]*_t\>" +color green "\<(class|namespace|template|public|protected|private|typename|this|friend|virtual|using|mutable|volatile|register|explicit)\>" +color brightgreen "\<(for|if|while|do|else|case|default|switch)\>" +color brightgreen "\<(try|throw|catch|operator|new|delete)\>" +color brightgreen "\<(goto|continue|break|return)\>" +color brightgreen "@\<(en(code|d)|i(mplementation|nterface)|selector)\>" +## +## GCC builtins +color cyan "__attribute__[[:space:]]*\(\([^)]*\)\)" "__(aligned|asm|builtin|hidden|inline|packed|restrict|section|typeof|weak)__" + +## Selector/method +color brightmagenta "(^|[[:space:]])\[.*[[:space:]].*\]" +color white ":[[:alnum:]]*" +color magenta "[[:alnum:]]*:" +color white "\[[^][:space:]]*\]" + +## +## String highlighting. You will in general want your comments and +## strings to come last, because syntax highlighting rules will be +## applied in the order they are read in. +color brightblack "'([^'\]|(\\["'abfnrtv\\]))'" "'\\(([0-3]?[0-7]{1,2}))'" "'\\x[0-9A-Fa-f]{1,2}'" +color brightblack "<[^= ]*>" ""(\\.|[^"])*"" +color brightblue "@"(\\.|[^"])*"" +## +## This string is VERY resource intensive! +## color brightyellow start=""(\\.|[^"])*\\[[:space:]]*$" end="^(\\.|[^"])*"" + +color brightblue "^[[:space:]]*#[[:space:]]*(define|include|import|(un|ifn?)def|endif|el(if|se)|if|warning|error)" + +## Comment highlighting +color yellow "//.*" +color yellow start="/\*" end="\*/" + diff --git a/doc/syntax/ocaml.nanorc b/doc/syntax/ocaml.nanorc new file mode 100644 index 00000000..fc71ae23 --- /dev/null +++ b/doc/syntax/ocaml.nanorc @@ -0,0 +1,27 @@ +# OCaml sample nanorc +# +syntax "ocaml" "\.mli?$" +#uid +color red "\<[A-Z][0-9a-z_]{2,}\>" +#declarations +color green "\<(let|val|method|in|and|rec|private|virtual|constraint)\>" +#structure items +color red "\<(type|open|class|module|exception|external)\>" +#patterns +color blue "\<(fun|function|functor|match|try|with)\>" +#patterns-modifiers +color yellow "\<(as|when|of)\>" +#conditions +color cyan "\<(if|then|else)\>" +#blocs +color magenta "\<(begin|end|object|struct|sig|for|while|do|done|to|downto)\>" +#constantes +color green "\<(true|false)\>" +#modules/classes +color green "\<(include|inherit|initializer)\>" +#expr modifiers +color yellow "\<(new|ref|mutable|lazy|assert|raise)\>" +#comments +color white start="\(\*" end="\*\)" +#strings (no multiline handling yet) +color brightblack ""[^\"]*"" -- 2.39.5