• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            悲情土仔一生

              C++博客 :: 首頁(yè) :: 新隨筆 :: 聯(lián)系 :: 聚合  :: 管理 ::
              14 隨筆 :: 0 文章 :: 74 評(píng)論 :: 0 Trackbacks

            讓UltraEdit完美支持Lua語(yǔ)法

            作者:Tuuzed(土仔)   發(fā)表于:2008年12月27日
            版權(quán)聲明:可以任意轉(zhuǎn)載,轉(zhuǎn)載時(shí)請(qǐng)務(wù)必以超鏈接形式標(biāo)明文章原始出處和作者信息及本聲明
            http://www.shnenglu.com/tuuzed/archive/2008/12/27/70516.html




                 最近在研究Lua腳本語(yǔ)言(個(gè)人覺(jué)得它是Basic、C、C++的結(jié)合體),可是“強(qiáng)大”的UltraEdit默認(rèn)安裝后是不支持Lua語(yǔ)法高亮顯示的,滿(mǎn)屏幕“黑黑”的雞腸字符讓人感覺(jué)編程是那么的索然無(wú)味,沒(méi)有了靈感。
                 終于有一天GOOGLE了一下,發(fā)現(xiàn)了很多解決辦法,最好的辦法就是:先去UltraEdit的官網(wǎng)下載支持Lua的Wordfiles文件(這里),是個(gè)文本文件(lua.txt)。打開(kāi)UltraEdit安裝目錄下的wordfile.txt,把lua.txt文件中的內(nèi)容拷貝粘貼到wordfile.txt的末尾,存盤(pán),OK,于是UltraEdit語(yǔ)法高亮項(xiàng)多出Lua一項(xiàng),可以選擇使用了。比起網(wǎng)上說(shuō)的02年版的lua.txt,這個(gè)04版(也是很舊)已經(jīng)完美支持“注釋塊”和“注釋行”高亮了,所以無(wú)需在改它的第一行。
                 但是,使用一段時(shí)間后,還是發(fā)現(xiàn)有問(wèn)題,比如:有部分關(guān)鍵字沒(méi)有加亮(如:os,pair, ipair等);不支持代碼折疊(不能很好地知道結(jié)束關(guān)鍵字end是屬于哪個(gè)while、for、function等);對(duì)UltraEdit的F8(函數(shù)列表)功能支持得不完美。還好,看了UltraEdit幫助后,自己修改了一下,解決了上述問(wèn)題,下面就貼出我的lua.txt在這里下載修改后的Lua.txt

             1 /L20"Lua" Line Comment = -- Block Comment On = [[ Block Comment Off = ]] String Chars = "' Escape Char = \ File Extensions = LUA BIN
             2 /Delimiters = ~!@%^&*()-+=|\/{}[]:;"'<> ,    .?
             3 /Function String 1 = "function[ ]++[a-zA-Z]*)"
             4 /Function String 2 = "function[ ]++([ a-zA-Z]*)"
             5 /Open Fold Strings = "function" "if" "while" "for"
             6 /Close Fold Strings = "end"
             7 /C1 "key words"
             8 and
             9 break
            10 do
            11 else 
            12 elseif 
            13 end
            14 function
            15 if in
            16 local
            17 nil not
            18 or
            19 repeat return
            20 then
            21 until
            22 while
            23 /C2
            24 abs acos appendto ascii asin assert atan atan2
            25 call ceil clock collectgarbage copytagmethods cos
            26 date deg dofile dostring
            27 error execute exit
            28 false find floor foreach foreachvar format frexp
            29 getbinmethod getenv getglobal gettagmethod gfind gmatch gsub
            30 insert ipairs
            31 ldexp log log10
            32 match max min mod
            33 newtag next nextvar
            34 os
            35 pairs print
            36 rad random randomseed rawgetglobal rawgettable rawsetglobal rawsettable read
            37 readfrom remove rename
            38 seterrormethod setglobal setlocale settag settagmethod sin sqrt strbyte sub
            39 strchar strfind string strlen strlower strrep strsub strupper
            40 table tag tan tmpname tonumber tostring true type
            41 write writeto
            42 /C3
            43 $debug
            44 $else
            45 $end
            46 $endinput
            47 $if
            48 $ifnot
            49 $nodebug
            50 /C4
            51 PI
            52 _INPUT _OUTPUT _STDERR _STDIN _STDOUT
            53 /C5
            54 +
            55 -
            56 *
            57 // /
            58 ^
            59 <
            60 >
            61 =
            62 ~
            63 %
            64 .
            65 :
            66 /C6
            67 ;
            68 ,
            69 (
            70 )
            71 {
            72 }
            73 [
            74 ]
            75 /C7
            76 cgi cgilua cgilua_url char2hexa chdir
            77 dbluaerrorfb dblua_escape decode default_script
            78 encodecgi encodetable escape
            79 filetype
            80 getvalue
            81 hexa hexa2char html_mask
            82 includehtml insertfield
            83 lua_mask
            84 maketable map mkurl
            85 nopipe
            86 preprocess
            87 redirect relativeurl relative_url
            88 saveluavar savestate script_path script_pdir script_vdir stateerrormethod
            89 statefile stdin strsplit
            90 unescape
            91 /C8
            92 DBClose DBExec DBOpen DBRow

                
                 支持UltraEdit的F8(函數(shù)列表)功能的是3、4行;支持代碼折疊的是5、6行;增加了部分關(guān)鍵字(io,pair,ipair等),但還不完整,可以根據(jù)以后編程需要自己再添加,添加時(shí)一定要按字母排列順序“插”對(duì)位置!


            posted on 2008-12-27 17:19 土仔 閱讀(7875) 評(píng)論(5)  編輯 收藏 引用 所屬分類(lèi): 土仔編程

            評(píng)論

            # re: 讓UltraEdit完美支持Lua語(yǔ)法 2008-12-27 22:34 5193
            轉(zhuǎn)載文章的時(shí)候需要加版權(quán)...

            順便問(wèn)一句
            你的ultraedit有版權(quán)么...  回復(fù)  更多評(píng)論
              

            # re: 讓UltraEdit完美支持Lua語(yǔ)法 2008-12-28 10:03 土仔
            @5193
            回答問(wèn)題:此文章為原創(chuàng);UltraEdit是公司買(mǎi)的license。  回復(fù)  更多評(píng)論
              

            # re: 讓UltraEdit完美支持Lua語(yǔ)法 2008-12-28 13:14 Xw.Y
            支持原創(chuàng)
            支持正版

            可惜偶等窮人只能用emacs……  回復(fù)  更多評(píng)論
              

            # re: 讓UltraEdit完美支持Lua語(yǔ)法[未登錄](méi) 2009-01-30 15:35 Betty
            非常感謝,很有用~~  回復(fù)  更多評(píng)論
              

            # re: 讓UltraEdit完美支持Lua語(yǔ)法[未登錄](méi) 2011-10-06 09:58 阿炳
            棒棒的,贊一個(gè),已經(jīng)使用中  回復(fù)  更多評(píng)論
              

            久久亚洲中文字幕精品一区| 国产成人精品久久一区二区三区av| 久久久久久亚洲精品影院| 免费精品久久久久久中文字幕| 久久精品国产亚洲AV忘忧草18| 丰满少妇人妻久久久久久| 久久久久人妻一区精品果冻| 久久精品国产久精国产思思| 亚洲AV伊人久久青青草原| 日韩精品国产自在久久现线拍| 久久这里都是精品| 99久久夜色精品国产网站| 午夜精品久久久久久99热| 亚洲精品tv久久久久| 狠狠色丁香婷综合久久| 97精品国产97久久久久久免费| 国产综合免费精品久久久| 99久久精品国产高清一区二区| 亚洲国产精品狼友中文久久久 | 国产精品99久久久久久董美香| 久久久这里有精品| 亚洲七七久久精品中文国产| 久久精品无码一区二区三区日韩| 久久免费国产精品一区二区| 蜜臀久久99精品久久久久久小说| 综合久久给合久久狠狠狠97色| 国产综合精品久久亚洲| 亚洲一本综合久久| 一本大道久久a久久精品综合| 久久99国产亚洲高清观看首页| 久久夜色精品国产噜噜噜亚洲AV| 久久久久久久女国产乱让韩| 久久婷婷色香五月综合激情| 伊人久久国产免费观看视频| 中文字幕无码av激情不卡久久 | 久久久亚洲裙底偷窥综合| 性做久久久久久久久久久| 老男人久久青草av高清| 国产亚洲精久久久久久无码77777 国产亚洲精品久久久久秋霞 | 亚洲综合伊人久久综合| 狠狠色狠狠色综合久久|