NotePad++ 使用者定義語言不顯示條件語句

NotePad++ 使用者定義語言不顯示條件語句

我在 NotePad+ 中下載了 Powerbuilder 的使用者定義語言。除了它不在突出顯示中顯示條件語句之外,一切都運作良好。我查看了 XML,但沒有發現任何問題,因為它應該突出顯示。

關於這裡可能有什麼粗略的想法嗎?這是它在 NotePad++ 中的螢幕截圖:

條件語句使用者定義語言

PowerBuilder.xml <- 使用者定義的語言

<NotepadPlus>
    <UserLang name="PowerBuilder" ext="srw sru srs srm">
        <Settings>
            <Global caseIgnored="yes"/>
            <TreatAsSymbol comment="yes" commentLine="yes"/>
            <Prefix words1="no" words2="no" words3="no" words4="no"/>
        </Settings>
            <KeywordLists>
                <Keywords name="Delimiters">"00"00</Keywords>
                <Keywords name="Folder+">if choose subroutine type</Keywords>
                <Keywords name="Folder-">end</Keywords>
                <Keywords name="Operators">( ) . ;</Keywords>
                <Keywords name="Comment">1/* 2*/ 0//</Keywords>
                <Keywords name="Words1">
                alias and autoinstantiate call case catch choose close commit connect constant continue create cursor declare delete describe descriptor destory disconnect do dynamic else elseif end enumerated event execute exit external false fetch finally first for forward from function global goto halt if immediate indirect insert into intrinsic is last library loop namespace native next not of on open or parent post prepare prior private privateread privatewrite procedure protected protectedread protectedwrite prototypes public readonly ref return rollback rpcfunc select selectblob shared static step subroutine super system systemread systemwrite then this throw throws to trigger true try type until update updateblob using variables while with within xor _debug
                </Keywords>
                <Keywords name="Words2">
                any Blob Boolean Byte Char Character Date DateTime Decimal Dec Double Integer Int Long LongLong Real String Time UnsignedInteger UnsignedInt UInt UnsignedLong ULong
                </Keywords>
                <Keywords name="Words3">this parent super</Keywords>
                <Keywords name="Words4"/>
            </KeywordLists>
        <Styles>
            <WordsStyle name="DEFAULT" styleID="11" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0"/>
            <WordsStyle name="FOLDEROPEN" styleID="12" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0"/>
            <WordsStyle name="FOLDERCLOSE" styleID="13" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0"/>
            <WordsStyle name="KEYWORD1" styleID="5" fgColor="0000FF" bgColor="FFFFFF" fontName="" fontStyle="1"/>
            <WordsStyle name="KEYWORD2" styleID="6" fgColor="800080" bgColor="FFFFFF" fontName="" fontStyle="0"/>
            <WordsStyle name="KEYWORD3" styleID="7" fgColor="0000FF" bgColor="FFFFFF" fontName="" fontStyle="1"/>
            <WordsStyle name="KEYWORD4" styleID="8" fgColor="0000FF" bgColor="FFFFFF" fontName="" fontStyle="0"/>
            <WordsStyle name="COMMENT" styleID="1" fgColor="008000" bgColor="FFFFFF" fontName="" fontStyle="0"/>
            <WordsStyle name="COMMENT LINE" styleID="2" fgColor="008000" bgColor="FFFFFF" fontName="" fontStyle="0"/>
            <WordsStyle name="NUMBER" styleID="4" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0"/>
            <WordsStyle name="OPERATOR" styleID="10" fgColor="000000" bgColor="FFFFFF" fontName="@Arial Unicode MS" fontStyle="0"/>
            <WordsStyle name="DELIMINER1" styleID="14" fgColor="959595" bgColor="FFFFFF" fontName="" fontStyle="0"/>
            <WordsStyle name="DELIMINER2" styleID="15" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0"/>
            <WordsStyle name="DELIMINER3" styleID="16" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0"/>
        </Styles>
    </UserLang>
</NotepadPlus>

答案1

我知道您的評論說您嘗試if從 XML 中的資料夾+ 中刪除...但是當我使用 UDL 對話框更改設定時,它確認它if位於以代碼 1 樣式折疊這就是罪魁禍首:

  • 由於您有 UDL 定義,我看到的內容與您所展示的類似:
  • 如果我然後改變造型器為了以代碼 1 樣式折疊Chooseif遵循end折疊顏色:
  • 如果我然後if刪除以代碼 1 樣式折疊if從粉紅色變為藍色。

如果您將一個單字同時列為“folding”和“keyword”,它將套用“folding”樣式的格式,因為UDL 詞法分析器在反白顯示“keyword”之前會尋找“folding”,並在反白後停止。

(另外,我建議添加elseif到“中間”部分以代碼 1 樣式折疊,如果您保留ifas 折疊而不是關鍵字。

相關內容