]> git.wh0rd.org Git - nano.git/commitdiff
2008-09-30 <bluestorm_dylc@hotmail.com>
authorChris Allegretta <chrisa@asty.org>
Wed, 1 Oct 2008 00:49:19 +0000 (00:49 +0000)
committerChris Allegretta <chrisa@asty.org>
Wed, 1 Oct 2008 00:49:19 +0000 (00:49 +0000)
       * ocaml.nanorc: Sample OCaml syntax highlighting file

2008-09-30 Dave Geering <dgeering@toshiba-tap.com>
       * 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
doc/syntax/Makefile.am
doc/syntax/objc.nanorc [new file with mode: 0644]
doc/syntax/ocaml.nanorc [new file with mode: 0644]

index 74482d8e1de341f4869510263ec49ce3ae607d57..b0df6f2ca504af49018283eb963c0e4a48d982b9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,14 +1,23 @@
+2008-09-30 <bluestorm_dylc@hotmail.com>
+       * ocaml.nanorc: Sample OCaml syntax highlighting file
+
+2008-09-30 Dave Geering <dgeering@toshiba-tap.com>
+       * objc.nanorc: Sample Objective-C Syntax Hightlighting file
+
 2008-09-30 Chris Allegretta <chrisa@asty.org>
         * 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 <chrisa@asty.org>
        * 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 
          <dgeering@toshiba-tap.com>
+
 2008-09-16 Chris Allegretta <chrisa@asty.org>
        * 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 <chrisa@asty.org>
        * nano.c: Do call disable_signals at startup regardless, since under cygwin we can't generate
          ^C without it.
index 116d8d6bbab9f86f3169a11ee065e7fa5397cede..a3bad823d1794b83a7553cd470ce31c5fcf4caba 100644 (file)
@@ -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 (file)
index 0000000..cdf6e48
--- /dev/null
@@ -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 (file)
index 0000000..fc71ae2
--- /dev/null
@@ -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 ""[^\"]*""