Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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 Go to previous message
koldo is currently offline  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
 
Read Message
Read Message
Read Message
Previous Topic: Closing parentheses for arguments list
Next Topic: [BUG / C++11 support] Braced initializer list and Assist++
Goto Forum:
  


Current Time: Mon Jun 23 13:53:41 CEST 2025

Total time taken to generate the page: 0.07323 seconds