語法突顯
範例
下面是一例C++的語法突顯范例:
// Allocate all the windows
for (int i = 0; i < max; i++) {
pWins[i] = new Window();
}
在這個範例中,編輯器辨認出關鍵字為for,int和new,并辨認出變數的名字i,pWins和max,相應地將它們以高亮颜色顯示,註解则以灰色﹝或異於關鍵字的颜色﹞顯示,以避免與程式碼相混淆。
基本上现代专业的代碼編輯器都支援語法突顯功能,並且支援重新定義語法突顯功能。亦有不少常规文本编辑器支持这种功能。
參見
参考资料
This article is issued from Wikipedia. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.