[PATCH] new lang file for chess save file "pgn"

"Thijs Vermeir" <[email protected]>
Newsgroups gmane.comp.gnome.devtools
Message-ID <[email protected]>
Hello all,

This is a patch that adds some basic highlighting for the pgn format.
This is a populair save format for chess games.

Gr,
Thijs

_______________________________________________
gnome-devtools mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/gnome-devtools
chess_pgn.diff (text/x-patch, 1.8 KB)
Index: gtksourceview/gtksourceview/language-specs/Makefile.am
===================================================================
--- gtksourceview.orig/gtksourceview/language-specs/Makefile.am	2007-03-19 21:44:23.000000000 +0100
+++ gtksourceview/gtksourceview/language-specs/Makefile.am	2007-03-19 21:44:46.000000000 +0100
@@ -29,6 +29,7 @@
 	octave.lang		\
 	pascal.lang		\
 	perl.lang		\
+	pgn.lang		\
 	php.lang		\
 	po.lang			\
 	python.lang		\
Index: gtksourceview/gtksourceview/language-specs/pgn.lang
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ gtksourceview/gtksourceview/language-specs/pgn.lang	2007-03-19 21:51:08.000000000 +0100
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE language SYSTEM "language.dtd">
+<language _name="pgn" version="1.0" _section="Markup" mimetypes="application/x-chess-pgn">
+
+	<line-comment _name="Comment" style="Comment">
+		<start-regex>%</start-regex>
+	</line-comment>
+
+	<syntax-item _name = "string" style = "String">
+		<start-regex>"</start-regex>
+	         <end-regex>"</end-regex>
+	</syntax-item>
+
+	<syntax-item _name = "properties" style = "Preprocessor">
+		<start-regex>^\[</start-regex>
+	         <end-regex> </end-regex>
+	</syntax-item>
+
+	<pattern-item _name = "closeproperties" style = "Preprocessor">
+		<regex>]</regex>
+	</pattern-item>
+
+	<pattern-item _name = "move_count" style = "Function">
+		<regex>( [0-9]+. |^[0-9]+. )</regex>
+	</pattern-item>
+
+	<block-comment _name = "move_comment" style = "Comment">
+		<start-regex>\(</start-regex>
+        	<end-regex>\)</end-regex>
+	</block-comment>
+
+	<block-comment _name = "variation" style = "Specials">
+		<start-regex>{</start-regex>
+        	<end-regex>}</end-regex>
+	</block-comment>
+
+</language>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.