Notepad++ 语法高亮:规则冲突

Notepad++ syntax highlighting : conflict in rules

我在Notepad++中定制了一种新语言。

我的问题是我有两个关键字:LAYERLAYER_ENCODING。在菜单 Languages > Define Your language > Select your defined language 中,第一个选项卡中提到 LAYER Syntax foldingLAYER_ENCODING 在第二个选项卡 关键字列表 中被提及。这是我为 LAYER_ENCODING:

得到的语法着色

我似乎无法识别 LAYER_ENCODING 关键字,因为 LAYER 已经存在...知道如何解决这个问题吗?

编辑: 这是我的自定义规则:

<NotepadPlus>
    <UserLang name="Mapfile" ext="map" udlVersion="2.1">
        <Settings>
            <Global caseIgnored="no" allowFoldOfComments="no" foldCompact="no" forcePureLC="0" decimalSeparator="0" />
            <Prefix Keywords1="no" Keywords2="no" Keywords3="no" Keywords4="no" Keywords5="no" Keywords6="no" Keywords7="no" Keywords8="no" />
        </Settings>
        <KeywordLists>
            <Keywords name="Comments">03 04 00# 01 02</Keywords>
            <Keywords name="Numbers, prefix1"></Keywords>
            <Keywords name="Numbers, prefix2"></Keywords>
            <Keywords name="Numbers, extras1"></Keywords>
            <Keywords name="Numbers, extras2"></Keywords>
            <Keywords name="Numbers, suffix1"></Keywords>
            <Keywords name="Numbers, suffix2"></Keywords>
            <Keywords name="Numbers, range"></Keywords>
            <Keywords name="Operators1">&apos; ! &quot; $ % &amp; ( ) * , . / : ; ? @ [ \ ] ^ { | } ~ + &lt; = &gt;</Keywords>
            <Keywords name="Operators2"></Keywords>
            <Keywords name="Folders in code1, open">MAP LINESET MARKERSET POINTS SHADESET STYLE CLASS FEATURE JOIN LABEL LAYER LEGEND PROJECTION GRID QUERY OUTPUTFORMAT QUERYMAP REFERENCE SCALEBAR WEB METADATA</Keywords>
            <Keywords name="Folders in code1, middle"></Keywords>
            <Keywords name="Folders in code1, close">END</Keywords>
            <Keywords name="Folders in code2, open"></Keywords>
            <Keywords name="Folders in code2, middle"></Keywords>
            <Keywords name="Folders in code2, close"></Keywords>
            <Keywords name="Folders in comment, open"></Keywords>
            <Keywords name="Folders in comment, middle"></Keywords>
            <Keywords name="Folders in comment, close"></Keywords>
            <Keywords name="Keywords1">FONTSET GRID OUTPUTFORMAT SYMBOLSET</Keywords>
            <Keywords name="Keywords2">ANGLE ANTIALIAS BACKGROUNDCOLOR BACKGROUNDSHADOWCOLOR BACKGROUNDSHADOWSIZE BUFFER CHARACTER CLASSITEM COLOR CONNECTION CONNECTIONTYPE CONFIG DATAPATTERN DATA DESCRIPTION DEBUG DRIVER DUMP EMPTY ERROR EXPRESSION EXTENT EXTENSION FILLED FONT FOOTER FORCE FROM FILTER FILTERITEM FORMATOPTION GROUP HEADER IMAGE IMAGECOLOR IMAGEPATH IMAGEURL INTERLACE INTERVALS IMAGETYPE IMAGEMODE INCLUDE KEYIMAGE KEYSIZE KEYSPACING LABELANGLEITEM LABELCACHE LABELITEM LABELMAXSCALE LABELMINSCALE LABELSIZEITEM LAYER_ENCODING LOG LABELREQUIRES LABELFORMAT MAXFEATURES MAXSCALE MAXSCALEDENOM MAXSIZE MAXTEMPLATE MINDISTANCE MINFEATURESIZE MINSCALE MINSIZE MINTEMPLATE MINARCS MAXARCS MININTERVAL MAXINTERVAL MINSUBDIVIDE MINWIDTH MAXSUBDIVIDE MAXWIDTH MIMETYPE MARKER MARKERSIZE MINBOXSIZE MAXBOXSIZE NAME OFFSET OUTLINECOLOR OFFSITE OVERLAYOUTLINECOLOR OVERLAYCOLOR OVERLAYSYMBOL OVERLAYSIZE OVERLAYMINSIZE OVERLAYMAXSIZE OVERLAYBACKGROUNDCOLOR PARTIALS POSITION POSTLABELCACHE PROCESSING QUERYITEM REQUIRES RESULT_FIELDS RESULT_HEADERS SCALE SHAPEPATH SIZE SPACING STATUS STYLED SYMBOL SYMBOLSCALE SYMBOLSCALEDENOM STYLEITEM SIZEUNITS SHADOWCOLOR SHADOWSIZE TABLE TEMPLATE TEXT TILEINDEX TILEITEM TO TOLERANCE TOLERANCEUNITS TRANSFORM TRANSPARENT TRANSPARENCY TYPE TEMPLATEPATTERN UNITS WRAP WIDTH</Keywords>
            <Keywords name="Keywords3">annotation auto bitmap cc cl cr dd default ddmm ddmmss embed ellipse embed epsg false feet giant gif gtiff hilite inches jpeg kilometers large lc line ll local lr medium meters miles multiple normal off on ogr pixmap pixels point polygon polyline png queryonly raster sde selected single small swf tiny true truetype uc ul ur vector wbmp wms wms_srs wms_name wms_server_version wms_format wms_connectiontimeout wms_latlonboundingbox wms_formatlist wms_style wms_time wms_force_separate_request</Keywords>
            <Keywords name="Keywords4"></Keywords>
            <Keywords name="Keywords5"></Keywords>
            <Keywords name="Keywords6"></Keywords>
            <Keywords name="Keywords7"></Keywords>
            <Keywords name="Keywords8"></Keywords>
            <Keywords name="Delimiters">00&quot; 01 02&quot; 03&apos; 04 05&apos; 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23</Keywords>
        </KeywordLists>
        <Styles>
            <WordsStyle name="DEFAULT" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="COMMENTS" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="LINE COMMENTS" fgColor="808080" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="NUMBERS" fgColor="FF0000" bgColor="FFFFFF" fontName="Consolas" fontStyle="0" fontSize="12" nesting="0" />
            <WordsStyle name="KEYWORDS1" fgColor="0000FF" bgColor="FFFFFF" fontName="" fontStyle="1" nesting="0" />
            <WordsStyle name="KEYWORDS2" fgColor="808000" bgColor="FFFFFF" fontName="" fontStyle="1" nesting="0" />
            <WordsStyle name="KEYWORDS3" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="1" nesting="0" />
            <WordsStyle name="KEYWORDS4" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="KEYWORDS5" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="KEYWORDS6" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="KEYWORDS7" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="KEYWORDS8" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="OPERATORS" fgColor="0000FF" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="FOLDER IN CODE1" fgColor="0000FF" bgColor="FFFFFF" fontName="" fontStyle="1" nesting="0" />
            <WordsStyle name="FOLDER IN CODE2" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="FOLDER IN COMMENT" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="DELIMITERS1" fgColor="800040" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="DELIMITERS2" fgColor="800000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="DELIMITERS3" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="DELIMITERS4" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="DELIMITERS5" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="DELIMITERS6" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="DELIMITERS7" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
            <WordsStyle name="DELIMITERS8" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" nesting="0" />
        </Styles>
    </UserLang>
</NotepadPlus>

您需要将代码折叠 LAYER 移动到 代码 2 样式中的折叠。代码 2 样式中的折叠从第一个使用前向搜索并可以粘附到任何其他关键字的样式开始工作 differently。代码风格二尊重空格和其他特殊字符。