码迷,mamicode.com
首页 > 其他好文 > 详细

七、关键词

时间:2020-03-02 20:50:10      阅读:84      评论:0      收藏:0      [点我收藏+]

标签:describe   multi   fun   start   for   round   you   sts   turn   

原文地址

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 \t if” <– one tab
“else \t\t if” <– two tabs
“else \n if” <– one new line
“else \n\n 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.

七、关键词

标签:describe   multi   fun   start   for   round   you   sts   turn   

原文地址:https://www.cnblogs.com/xin04/p/12397665.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!