google rss rss

          doneykoo [Ouditian]

          DKzone- Ouditian Technology

          [FW] 在UltraEdit里正確顯示Lua的塊注釋(語法著色)

           

          Origin Link http://blog.2ndboy.net/?p=116#comment-3104
          Thanks to 2ndboy


          在 UltraEdit 里正確顯示 Lua 的塊注釋(DoNeY注:語法著色問題)

            我算得上是 UltraEdit 的鐵桿用戶啦(雖然是 D 版用戶:)),所以寫 Lua 程序當然用 UltraEdit 啦!讓 UltraEdit 支持 Lua 的語法高亮很簡單,去 UE 的官網,下載 Lua 的語法文件集成在自帶的語法高亮文件里就可以啦。

            但是 UE 官網上這個語法文件貌似比較舊,是 02 年 8 月發布的,塊注釋居然用的是“[[”和“]]”:“Block Comment On = [[ Block Comment Off = ]]”。于是手工改成“Block Comment On = –[[ Block Comment Off = –]]”保存,結果發現行注釋“–”是可以正確顯示的,但是塊注釋就只能顯示快注釋開始標記所在的那一行。貌似是 UE 的 bug?估計跟行注釋有沖突,因為語法文件里是這么寫的“Line Comment = — Block Comment On = –[[ Block Comment Off = –]]”。試了一下把行注釋放在塊注釋后面也不行,開動 Google,結果在 UE 的論壇上找到了答案。

            把 Lua 的語法文件第一行改成如下這個樣子就可以啦:

           

          /L12″Lua” Block Comment On = --[[ Block Comment Off = ]] Block Comment On Alt = -- Escape Char = \ String Chars = “‘ File Extensions = LUA



          (DoNeY注:哈,終于有了解決方案,下面聽作者講一下這一微小滴奧妙所在)

            查了一下 UE 的幫助文檔,上面對“Block Comment On Alt”的描述是這樣的“The second set of block comments are in the form “Block Comment On Alt = ” and “Block Comment Off Alt = ” followed by up to five characters each that define the comment designators. If a Block Comment On Alt is defined but the Block Comment Off Alt is not defined the commenting will stop at the end of the line.”。看來塊注釋指示器有兩種,這個辦法還真是比較巧妙,但是要熟讀 UE 文檔才能想的到呀。
          (DoNeY注:意即如果ultraedit在wordfile中對某個語言的語法著色只定義其Block Comment On Alt =作為第二種塊注釋的起始符號,而不定義第二種塊注釋的結束符號Block Comment Off Alt =,那么這個Block Comment On Alt 所定義的符號將會只注釋掉從符號開始至行尾的部分,也就相當于換一個方法定義了行注釋的符號了)

            改完以后再看 Lua 代碼里的塊注釋,現在已經可以完美顯示啦:D

          posted on 2008-10-21 17:35 DoNeY 閱讀(3404) 評論(0)  編輯  收藏 所屬分類: LUA


          只有注冊用戶登錄后才能發表評論。


          網站導航:
           
            doneykoo blogjava
            
          主站蜘蛛池模板: 政和县| 安丘市| 香港| 新巴尔虎左旗| 瓦房店市| 谢通门县| 保定市| 锡林郭勒盟| 大城县| 西峡县| 万宁市| 岢岚县| 建瓯市| 宁乡县| 永靖县| 环江| 黄山市| 鸡泽县| 神农架林区| 武汉市| 胶南市| 峡江县| 于都县| 滨海县| 牡丹江市| 南和县| 临沧市| 许昌县| 无极县| 柳江县| 尚志市| 洛扎县| 霍林郭勒市| 宜良县| 缙云县| 九江县| 米脂县| 馆陶县| 锦州市| 孙吴县| 法库县|