Home » U++ TheIDE » U++ TheIDE: CodeEditor, Assist++, Topic++ » To load a new syntax in CodeEditor
Re: To load a new syntax in CodeEditor [message #43195 is a reply to message #43194] |
Tue, 03 June 2014 12:53  |
 |
koldo
Messages: 3437 Registered: August 2008
|
Senior Veteran |
|
|
Hello Mirek
Now, with a public LoadSyntax(), the code I use to implement a new language ("my") is:
void CreateCSyntax(One<EditorSyntax>& e, int kind) {
CSyntax& s = e.Create<CSyntax>();
s.SetHighlight(kind);
}
...
static const char *my_keywords[] = {..., NULL};
static const char *my_names[] = {..., NULL};
int syntaxId = CSyntax::LoadSyntax(my_keywords, my_names);
EditorSyntax::Register("my", callback1(CreateCSyntax, syntaxId), "*.my", "MyLanguage");
...
myCode.Highlight("my");
How would have to be the best way to implement it?
Best regards
IƱaki
|
|
|
Goto Forum:
Current Time: Mon Jun 23 13:53:41 CEST 2025
Total time taken to generate the page: 0.07323 seconds
|