From: Jean Privat Date: Wed, 28 Jun 2017 19:58:50 +0000 (-0400) Subject: Merge: gtksourceview: Rewrite the language definition X-Git-Url: http://nitlanguage.org?hp=db3820679f423b5c28ee0d546084bd6d7e538e7d Merge: gtksourceview: Rewrite the language definition The new definition includes: * A more accurate and up-to-date grammar * A more accurate style list * A list of built-in annotations * Heuristics for embedded languages * Spell-checking only enabled for comments * Styles for operators and lower-case identifiers available if needed (but not highlighted by default) ## Previews Here are the PDF outputs of various black-on-white style schemes for `examples/syntax.nit`: * [Classic](https://github.com/nitlang/nit/files/1109793/gtksourceview-classic.pdf) * [Kate](https://github.com/nitlang/nit/files/1109794/gtksourceview-kate.pdf) * [Solarized Clear](https://github.com/nitlang/nit/files/1109795/gtksourceview-solarized-clear.pdf) * [Tango](https://github.com/nitlang/nit/files/1109796/gtksourceview-tango.pdf) Signed-off-by: Jean-Christophe Beaupré Pull-Request: #2515 Reviewed-by: Jean Privat Reviewed-by: Lucas Bajolet Reviewed-by: Alexis Laferrière --- diff --git a/NOTICE b/NOTICE index 5a96547..32b5754 100644 --- a/NOTICE +++ b/NOTICE @@ -72,16 +72,6 @@ Files: share/nitdoc/scripts/jquery-1.7.1.min.js Copyright: 2011 John Resig, http://jquery.com/ Licence: BSD 2 (see LICENSE-BSD) -Files: /misc/gtksourceview/nit.lang -Copyright: 2009-2011 Alexis Laferrière - 2011-2017 Jean Privat - Based on ruby.lang from - 2004 Archit Baweja - 2005 Michael Witrant - 2006 Gabriel Bauman -License: GPL 2.0 (see LICENSE-GPL-2) -Comment: GPL because the original work is GPL - Files: /share/png/* Copyright: 1998-2014 Glenn Randers-Pehrson 1996-1997 Andreas Dilger diff --git a/misc/README.md b/misc/README.md index 8d09d74..be3e41e 100644 --- a/misc/README.md +++ b/misc/README.md @@ -134,3 +134,7 @@ You may want to map the command to a shortcut by adding the following code to `~ " Map the NitExecute function to Ctrl-F map :NitExecute ~~~ + +# Test case for syntax highlighting +To check the accuracy of language definition files, the module +`../tests/test_syntax.nit` can be used as a demo. diff --git a/misc/gtksourceview/nit.lang b/misc/gtksourceview/nit.lang index 2e7a08e..977c50f 100644 --- a/misc/gtksourceview/nit.lang +++ b/misc/gtksourceview/nit.lang @@ -1,214 +1,375 @@ + + + + text/x-nit + *.nit + # + - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. + +