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



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
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>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]