HEMMI, Shigeru wrote:
Hello,
I wanted to add a C-sharp (C#) style of source-highight.
What I did was:
1. cp cpp.lang csharp.lang
2. Edit csharp.lang only in keyword and type; other fields not changed.
3. Edit lang.map, Makefile.am and Makefile.in so that csharp.lang is included.
4. Make install
It seems OK at a glance.
However, I am wondering if there is a better way or I made somthing
mistakes in it.
Let me know if there is points to improve/correct.
Hi there!
thanks for the C# definition, which was really missing.
I'd like to add it to the source-highlight distribution; could you
please send me a test file that I can add to the test suite for C#?
Probably a better way to define the .lang file was to include cpp.lang
and redefine only the parts that are different.
hope to hear from you soon!
Lorenzo
----- FYI, my csharp.lang is as follows:
--------------------------------------------------------
# definitions for C-sharp
# by S. HEMMI, this is not authorized.
include "c_comment.lang"
state preproc start '^[[:blank:]]*#(?:[[:blank:]]*include)' begin
string delim "<" ">"
string delim "\"" "\"" escape "\\"
include "c_comment.lang"
end
preproc = '^[[:blank:]]*#([[:blank:]]*[[:word:]]*)'
include "number.lang"
include "c_string.lang"
keyword = "abstract|event|new|struct ",
"as|explicit|null|switch",
"base|extern|object|this ",
"bool|false|operator|throw ",
"break|finally|out|true ",
"byte|fixed|override|try ",
"case|float|params|typeof ",
"catch|for|private|uint ",
"char|foreach|protected|ulong ",
"checked|goto|public|unchecked ",
"class|if|readonly|unsafe ",
"const|implicit|ref|ushort ",
"continue|in|return|using ",
"decimal|int|sbyte|virtual ",
"default|interface|sealed|volatile ",
"delegate|internal|short|void ",
"do|is|sizeof|while ",
"double|lock|stackalloc ",
"else|long|static ",
"enum|namespace|string ",
"get|partial|set ",
"value|where|yield "
type = "bool|byte|sbyte|char|decimal|double",
"float|int|uint|long|ulong|object",
"short|ushort|string"
include "symbols.lang"
cbracket = "{|}"
include "function.lang"
####
--
+-----------------------------------------------------+
| Lorenzo Bettini ICQ# lbetto, 16080134 |
| PhD in Computer Science |
| Dip. Sistemi e Informatica, Univ. di Firenze |
| Tel +39 055 4237460, Fax +39 055 4237437 |
| Florence - Italy (GNU/Linux User # 158233) |
| Home Page : http://www.lorenzobettini.it |
| http://music.dsi.unifi.it XKlaim language |
| http://www.purplesucker.com Deep Purple Cover Band |
| http://www.gnu.org/software/src-highlite |
| http://www.gnu.org/software/gengetopt |
| http://www.lorenzobettini.it/software/gengen |
| http://www.lorenzobettini.it/software/doublecpp |
+-----------------------------------------------------+
_______________________________________________
Help-source-highlight mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-source-highlight