How to add a new language in ScintillaNet?

I am writing a C # program that uses a text editor to edit a file format similar to compiled lua using ScintillaNet (rbf). I understand that you can add new languages ​​to Scintilla by adding an Xml file and referencing this in the CustomDirectory property. I would like the language to have the same Lexer / Parser as lua, but without keywords and code completion. Can anyone post such Xml code that I can use as an example?

Now it looks like this:

<?xml version="1.0" encoding="utf-8"?>
<ScintillaNET>
  <Language Name="rbf">
    <Indentation TabWidth="4" SmartIndentType="cpp" />
    <Lexer LineCommentPrefix="--" StreamCommentPrefix="[[" StreamCommentSuffix="]]" >
    </Lexer>
    <Styles>
      <Style Name="DEFAULT" FontName="Courier New" Size="10"/>
      <Style Name="COMMENT" ForeColor="Green" Size="8"/>
      <Style Name="COMMENTLINE" ForeColor="Green" Size="8"/>
      <Style Name="NUMBER" ForeColor="Orange"/>
      <Style Name="WORD" ForeColor="Blue" Bold="Yes"/>
      <Style Name="WORD3" ForeColor="DarkBlue" Bold="Yes"/>
      <Style Name="WORD4" ForeColor="DarkBlue" Bold="Yes"/>
      <Style Name="WORD5" ForeColor="LightGreen" Bold="Yes"/>
    </Styles>
  </Language>
</ScintillaNET >

It would also be useful for me if someone could tell me how to set the default colors for different styles (lines, comments, numbers, etc.).

+3
1

, , lexer :

<Lexer LexerName="lua"/>

, .

+2

Source: https://habr.com/ru/post/1777285/


All Articles