代码之家  ›  专栏  ›  技术社区  ›  Migwell

如何为闪烁网添加新的语言设置?

  •  3
  • Migwell  · 技术社区  · 14 年前

    我正在编写一个C程序,该程序使用文本编辑器编辑类似于使用scintlanet(rbf)编译的lua的文件格式。我了解您可以通过添加XML文件并在customdirectory属性中引用该文件向scintila添加新语言。我希望该语言与Lua具有相同的lexer/parser,但没有关键字和代码完成。有人能像这样发布XML代码吗?我可以用它作为例子。

    目前看起来是这样的:

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

    如果有人能告诉我如何为不同的样式(字符串、注释、数字等)设置默认颜色,我也会很有帮助。

    1 回复  |  直到 9 年前
        1
  •  2
  •   Migwell    14 年前

    <Lexer LexerName="lua"/>