[gedit-list] csharp.lang file



Attached is a first attempt to make a C# lang file for gtksourceview.

I checked out gtksourceview in CVS but it didn't have any lang files in
HEAD only in "-r towards-gedit-integration". So I assume that it is the
gedit folks that have made the other lang files?

Anyway it is attached.
First attempt so it might probably be full of faults <mea culpa>.
Are pragma directives allowed in a c# lang file?

best,

/Richard
-- 
Ph.D. Student
Dept. of Informatics and Mathematics
HTU
<?xml version="1.0" encoding="UTF-8"?>
<!-- <!DOCTYPE language SYSTEM "language.dtd"> -->
<language name="C#" version="1.0" section="Sources" mimetypes="text/x-cs">
	
	<string name = "String" style = "String" end-at-line-end = "TRUE">
		<start-regex>&quot;</start-regex>
		<end-regex>&quot;</end-regex>
	</string>

	<string name = "String 2" style = "String" end-at-line-end = "TRUE">
		<start-regex>&apos;</start-regex>
		<end-regex>&apos;</end-regex>
	</string>

	<line-comment name = "Line Comment" style= "Comment">
		<start-regex>//</start-regex>
	</line-comment>

	<block-comment name = "Block Comment" style = "Comment">
		<start-regex>/\*</start-regex>
        	<end-regex>\*/</end-regex>
	</block-comment>

        <keyword-list name = "Preprocessor Definitions" style = "Preprocessor" case-sensitive="TRUE"
                match-empty-string-at-beginning = "FALSE"
                match-empty-string-at-end = "TRUE"
                beginning-regex = "^[ \t]*#[ \t]*">
                <keyword>#elif</keyword>
                <keyword>#endif</keyword>
                <keyword>#endregion</keyword>
                <keyword>#else</keyword>
                <keyword>#error</keyword>
                <keyword>#define</keyword>
                <keyword>#if</keyword>
                <keyword>#line</keyword>
                <keyword>#region</keyword>
                <keyword>#undef</keyword>
                <keyword>#warning</keyword>
	</keyword-list>
	<keyword-list name = "Declarations" style = "Keyword" case-sensitive="TRUE">
		<keyword>class</keyword>
		<keyword>using</keyword>
		<keyword>is</keyword>
		<keyword>interface</keyword>
		<keyword>native</keyword>
		<keyword>namespace</keyword>
		<keyword>volatile</keyword>
		<keyword>throw</keyword>
	</keyword-list>

	<keyword-list name = "Primitives" style = "Data Type" case-sensitive="TRUE">
		<keyword>bool</keyword>
		<keyword>byte</keyword>
		<keyword>char</keyword>
		<keyword>decimal</keyword>
		<keyword>enum</keyword>
		<keyword>double</keyword>
		<keyword>object</keyword>
		<keyword>float</keyword>
		<keyword>int</keyword>
		<keyword>long</keyword>
		<keyword>short</keyword>
		<keyword>sbyte</keyword>
		<keyword>string</keyword>
		<keyword>struct</keyword>
		<keyword>uint</keyword>
		<keyword>ulong</keyword>
		<keyword>ushort</keyword>
	</keyword-list>

	<keyword-list name = "Flow" style = "Keyword" case-sensitive="TRUE">
		<keyword>break</keyword>
		<keyword>case</keyword>
		<keyword>continue</keyword>
		<keyword>default</keyword>
		<keyword>do</keyword>
      		<keyword>else</keyword>
		<keyword>for</keyword>
		<keyword>foreach</keyword>
		<keyword>goto</keyword>
		<keyword>if</keyword>
		<keyword>return</keyword>
		<keyword>switch</keyword>
		<keyword>while</keyword>
		<keyword>catch</keyword>
		<keyword>checked</keyword>
		<keyword>try</keyword>
		<keyword>unchecked</keyword>
	</keyword-list>

	<keyword-list name = "Modifiers" style = "Keyword" case-sensitive="TRUE">
		<keyword>abstract</keyword>
		<keyword>extern</keyword>
		<keyword>internal</keyword>
		<keyword>override</keyword>
		<keyword>readonly</keyword>
		<keyword>sealed</keyword>
		<keyword>virtual</keyword>
		<keyword>volatile</keyword>
		<keyword>final</keyword>
		<keyword>finally</keyword>
		<keyword>private</keyword>
		<keyword>protected</keyword>
		<keyword>public</keyword>
		<keyword>static</keyword>
		<keyword>const</keyword>
		<keyword>gotol</keyword>
		<keyword>transient</keyword>
	</keyword-list>

	<keyword-list name = "Memory" style = "Others" case-sensitive="TRUE">
		<keyword>new</keyword>
		<keyword>null</keyword>
		<keyword>super</keyword>
		<keyword>this</keyword>
		<keyword>void</keyword>
	</keyword-list>

	<pattern-item name = "Numeric" style = "Decimal">
		<regex>&lt;(?i0[X][\\dA-F]+|\\d+(\\.\\d*)?(?:E[+-]?[\\d]+)?F?|\\.\\d+(?:E[+-]?[\\d]+)?F?|[\\d]+[LF]?))</regex>
	</pattern-item>

</language>


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