Notepad ++语法高亮显示:规则冲突 [英] Notepad++ syntax highlighting : conflict in rules

查看:60
本文介绍了Notepad ++语法高亮显示:规则冲突的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在Notepad ++中自定义了一种新语言.

I have customized a new language in Notepad++.

我的问题是我有两个关键字:LAYERLAYER_ENCODING.在菜单语言>定义您的语言>选择您定义的语言中,第一个标签语法折叠中提到了LAYER,而第二个标签中则提到了LAYER_ENCODING em>关键字列表.这是我为LAYER_ENCODING获得的语法颜色:

My problem is that I have two keywords : LAYER and LAYER_ENCODING. In the menu Languages > Define Your language > Select your defined language, LAYER is mentionned in the first tab Syntax folding whereas LAYER_ENCODING is mentionned in the second tab Keywords lists. Here is the syntax coloration I get for LAYER_ENCODING:

我似乎无法识别LAYER_ENCODING关键字,因为LAYER已经存在...关于如何解决此问题的任何想法?

I seems that LAYER_ENCODING keyword is not recognized because LAYER already exists... Any idea on how I could solve this problem?

:这是我的自定义规则:

EDIT : Here are my custom rules:

<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种使用前向搜索并可以进行折叠的代码相比,以代码2样式进行折叠有所不同粘合到其他任何关键字.代码样式二使用空格和其他特殊字符.

You need to move code folding LAYER to folding in code 2 style. Folding in code 2 style works differently from the first which uses forward search and can glue to any other key words. Code style two honors white spaces and other special characters.

这篇关于Notepad ++语法高亮显示:规则冲突的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆