七关键词
Posted xin04
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了七关键词相关的知识,希望对你有一定的参考价值。
目录
Keywords
七、关键词
This section describes new options user have when defining keyword lists.
Number of keyword lists has been expanded to eight (as suggested by Don, if more is needed, please state so in discussion on Notepad++ forum). Functionality is the same as in UDL 1.0. You can set ‘font options’ (font type, color, size and so on), and you can turn on ‘prefix mode’. Prefix mode simply means that anything that starts with your string will be identified as keyword.
But there is something new, an idea that comes from CChris: In UDL 2.0 you can define multi-part keywords. To do it, just put two or more words in quotation marks. e.g “else if”
Double quotes around multi-part keywords
Assuming that “else” and “if” are not defined as separate keywords, multi part keyword “else if” will be recognized as a keyword only if both strings are present. So, “else if” will be a keyword, but just “else”, or just “if”, will be treated as default text. Also note that any number of white space characters might separate “else” and “if”.
All these combinations will be correctly recognized:
“else if” <– one space
“else if” <– three spaces
“else if” <– one tab
“else if” <– two tabs
“else
if” <– one new line
“else
if” <– two new lines
That’s right, you can even hit ENTER in the middle of multi-part keyword and it will still be recognized!
Single quotes around multi-part keywords
Now, what if you want to limit multi-part keywords to be recognized only on the same line? You can do that simply by using single quotes instead of double quotes. So, if you define ‘else if’, than ‘else’ and ‘if’ can be separated by any number of spaces and tabs, but not new lines. This is important if you are defining multi-part keywords that are embedded (nested) in line comments.
Prefix mode
Prefix mode for multi-part keywords simply means “next word” will be highlighted too.
以上是关于七关键词的主要内容,如果未能解决你的问题,请参考以下文章