ruby.lang



Hey

I have created a ruby.lang file for gtksourceview. Its fairly basic right now.
Does most of the highlighting except some special cases for ruby. Its attached
Plz review so I can commit in cvs (I hope gtksourceview is in cvs.gnome.org)

Thanks
Archit


===File ~/ruby/tarballs/gtksourceview-0.7.0/gtksourceview/language-specs/ruby.lang===
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE language SYSTEM "language.dtd">
<language _name="Ruby" version="1.0" _section="Scripts" mimetypes="text/x-ruby">

	<escape-char>\</escape-char>

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

	<keyword-list _name = "Module Handler" style = "Preprocessor" case-sensitive="TRUE">
		<keyword>require</keyword>
		<keyword>include</keyword>
		<keyword>load</keyword>
	</keyword-list>

	<keyword-list _name = "Functions" style = "Keyword" case-sensitive="TRUE">
		<keyword>def</keyword>
		<keyword>class</keyword>
		<keyword>return</keyword>
		<keyword>module</keyword>
	</keyword-list>

	<keyword-list _name = "Keywords" style = "Keyword" case-sensitive="TRUE">
		<keyword>BEGIN</keyword>
		<keyword>END</keyword>
		<keyword>alias</keyword>
		<keyword>begin</keyword>
		<keyword>do</keyword>
		<keyword>end</keyword>
		<keyword>yield</keyword>
		<keyword>if</keyword>
		<keyword>unless</keyword>
		<keyword>elsif</keyword>
		<keyword>else</keyword>
		<keyword>while</keyword>
		<keyword>unless</keyword>
		<keyword>for</keyword>
		<keyword>in</keyword>
		<keyword>super</keyword>
		<keyword>retry</keyword>
		<keyword>redo</keyword>
		<keyword>break</keyword>
		<keyword>case</keyword>
		<keyword>when</keyword>
		<keyword>throw</keyword>
		<keyword>and</keyword>
		<keyword>or</keyword>
		<keyword>not</keyword>
		<keyword>raise</keyword>
		<keyword>rescue</keyword>
		<keyword>ensure</keyword>
		<keyword>new</keyword>
		<keyword>each</keyword>
	</keyword-list>

	<keyword-list _name = "Builtins" style = "Others" case-sensitive="TRUE">
		<keyword>Array</keyword>
		<keyword>Bignum</keyword>
		<keyword>Binding</keyword>
		<keyword>Class</keyword>
		<keyword>Continuation</keyword>
		<keyword>Dir</keyword>
		<keyword>Exception</keyword>
		<keyword>FalseClass</keyword>
		<keyword>File::Stat</keyword>
		<keyword>File</keyword>
		<keyword>Fixnum</keyword>
		<keyword>Fload</keyword>
		<keyword>Hash</keyword>
		<keyword>Integer</keyword>
		<keyword>IO</keyword>
		<keyword>MatchData</keyword>
		<keyword>Method</keyword>
		<keyword>Module</keyword>
		<keyword>NilClass</keyword>
		<keyword>Numeric</keyword>
		<keyword>Object</keyword>
		<keyword>Proc</keyword>
		<keyword>Range</keyword>
		<keyword>Regexp</keyword>
		<keyword>String</keyword>
		<keyword>Struct::Tms</keyword>
		<keyword>Symbol</keyword>
		<keyword>Symbol</keyword>
		<keyword>ThreadGroup</keyword>
		<keyword>Thread</keyword>
		<keyword>Time</keyword>
		<keyword>TrueClass</keyword>
	</keyword-list>
	
	<pattern-item _name = "Variables" style = "Data Type">
		<regex>[ ]+[a-zA-Z_][a-zA-Z0-9_]*</regex>
	</pattern-item>

	<pattern-item _name = "Self" style = "Data Type">
		<regex>\bself\b</regex>
	</pattern-item>

</language>
============================================================



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