1. [代码]shBrushLua.js

/**
 * SyntaxHighlighter
 * http://alexgorbatchev.com/SyntaxHighlighter
 *
 * SyntaxHighlighter is donationware. If you are using it, please donate.
 * http://alexgorbatchev.com/SyntaxHighlighter/donate.html
 *
 * @version
 * 3.0.83 (July 02 2010)
 *
 * @copyright
 * Copyright (C) 2004-2010 Alex Gorbatchev.
 *
 * @license
 * Dual licensed under the MIT and GPL licenses.
 */
;(function()
{
    // CommonJS
    typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
  
    function Brush()
    {
        // maker is IkPil, Choi
        // http://www.ikpil.com
              
        var keywords = 'and break do else elseif end false for function if in ' +
                       'local nil not or repeat return then true until while';
   
        var functions = '_G _VERSION assert collectgarbage dofile error getfenv ' +
                        'getmetatable ipairs load module next pairs pcall print ' +
                        ' rawequal rawget rawset require select setfenv setmetatable ' +
                        'tonumber tostring type unpack xpcall ' +
                        'coroutine.create coroutine.resume coroutine.running ' +
                        'coroutine.status coroutine.wrap coroutine.yield ' +
                        'debug.debug debug.getfenv debug.gethook debug.getinfo ' +
                        'debug.getlocal debug.getmetatable debug.getregistry ' +
                        'debug.getupvalue debug.setfenv debug.sethook debug.setlocal ' +
                        'debug.setmetatable debug.setupvalue debug.traceback ' +
                        'file:close file:flush file:lines file:read file:seek ' +
                        'file:setvbuf file:write' +flash教程
                        'io.close io.flush io.input io.lines io.open io.output ' +
                        'io.popen io.read io.stderr io.stdin io.stdout io.tmpfile ' +
                        'io.type io.write ' +
                        'math.abs math.acos math.asin math.atan math.atan2 math.ceil ' +
                        'math.cos math.cosh math.deg math.exp math.floor math.fmod ' +
                        'math.frexp math.huge math.ldexp math.log math.log10 math.max ' +
                        'math.min math.modf math.pi math.pow math.rad math.random ' +
                        'math.randomseed math.sin math.sinh math.sqrt math.tan math.tanh ' +
                        'os.clock os.date os.difftime os.execute os.exit os.getenv os.remove ' +
                        'os.rename os.setlocale os.time os.tmpname ' +
                        'package.cpath package.loaded package.loaders package.loadlib ' +
                        'package.path package.preload package.seeall ' +
                        'string.byte string.char string.dump string.find string.format ' +
                        'string.gmatch string.gsub string.len string.lower string.match ' +
                        'string.rep string.reverse string.sub string.upper table.concat ' +
                        'table.insert table.maxn table.remove table.sort';
          
        this.regexList = [
            { regex: /--.*/gm,                                                  css: 'comments' },  // one line comments
            { regex: /--\[\[[\S\s]*\]\]/gm,                                     css: 'comments' },  // multi line comments
            { regex: SyntaxHighlighter.regexLib.doubleQuotedString,             css: 'string' },    // strings
            { regex: SyntaxHighlighter.regexLib.singleQuotedString,             css: 'string' },    // strings
            { regex: SyntaxHighlighter.regexLib.multiLineDoubleQuotedString,    css: 'string' },    // strings
            { regex: SyntaxHighlighter.regexLib.multiLineSingleQuotedString,    css: 'string' },    // strings
            { regex: new RegExp(this.getKeywords(keywords), 'gm'),              css: 'keyword' },   // keywords
            { regex: new RegExp(this.getKeywords(functions), 'gm'),             css: 'functions' }  // functions
            ];http://www.huiyi8.com/flashjc/shipin/
    }
  
    Brush.prototype = new SyntaxHighlighter.Highlighter();
    Brush.aliases   = ['lua'];
  
    SyntaxHighlighter.brushes.Lua = Brush;
  
    // CommonJS
    typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
})();
2. [代码]使用方法   
<html>
    <head>
        <link type="text/css" rel="stylesheet" href="/styles/shCore.css" />
        <link type="text/css" rel="stylesheet" href="/styles/shThemeDefault.css" />
        <script type="text/javascript" src="/scripts/shCore.js"></script>
        <script type="text/javascript" src="/scripts/shBrushJScript.js"></script>
        <script type="text/javascript" src="/scripts/shBrushBash.js"></script>
        <script type="text/javascript" src="/scripts/shBrushCpp.js"></script>
        <script type="text/javascript" src="/scripts/shBrushLua.js"></script>
        <script type="text/javascript">SyntaxHighlighter.all();</script>
    </head>
   
    ...

让 SyntaxHighlighter 3.x 支持 Lua 语法着色的更多相关文章

  1. 转:OpenResty最佳实践(推荐了解lua语法)

    看点: 1. Lua 语法的说明, 排版清晰易懂. 转: https://moonbingbing.gitbooks.io/openresty-best-practices/content/lua/m ...

  2. 图文解说PhpStorm 7.0版本语法着色

    前不久,我们测试了PhpStorm7.0版本对PHP 5.5的支持,今天我们将继续对PhpStorm 7.0版本对代码支持进行测试. 我们知道,在PhpStorm 6.0版本中,提供一个黑色背景的代码 ...

  3. lua 语法的使用总结

    1.字符串连接 local tmp = "abc" local tmp1 = "ddd" tmp..tmp1 2. table 类型 就是关联数组 local ...

  4. Lua语法基础(2)--基本语法、函数

    上一篇编辑编辑着,发现,缩进出了问题.作为一个不是强迫症的人,实在是忍受不了同一级内容不同缩进方式的槽点,于是重开一篇吧.(万幸,这样的文章也只有我自己看.) 第四 基本语法 赋值语句,Lua可以对多 ...

  5. UltraEdit-14.10.0.1024版本语法着色配置

    用了UltraEdit有段时间了,一直没做语法着色,当做普通文本编辑器使用,这也太委屈这个“神器”了. 今天就让它物尽其用吧.体验一把UltraEdit的语法高亮功能. 参考:http://www.1 ...

  6. nginx编译安装支持lua脚本

    一.准备编译环境 1.操作系统:CentOS7.6 2.安装编译所需安装包 yum install gcc pcre pcre-devel zlib zlib-devel openssl openss ...

  7. sublime 支持php语法错误提示的插件

    求一个好用的sublime 支持php语法错误提示的插件.我装过sublimelinter,但是有时候出现错误也不会提示. 可以试试http://cs.sensiolabs.org/ 这个看哦它有对应 ...

  8. 【Markdown】notepad++ 支持 markdown语法、预览

    Notepad++中支持Markdown   最近在学习Markdown语言的使用,很想在XP主机上使用Markdown的离线编辑器,但MarkdownPad.作业部分的离线客户端都不能再XP上运行, ...

  9. vim 支持 markdown 语法

    /************************************************************************* * vim 支持 markdown 语法 * 说明 ...

随机推荐

  1. hdu4619 / 最大独立集

    题意,一个矩阵,上面可以横放或者竖着放骨牌(1X2)保证横的与横的不重叠,竖的和竖的不重叠,求拿掉最小的牌,使所有的都不重叠. 分析:一看,不重叠就是没有边,拿最少,就是留最多,最大独立集啊!二分图, ...

  2. HTTP请求的缓存(Cache)机制

    原文地址:http://small.aiweimeng.top/index.php/archives/58.html 先来一张图: ####下面简单的来描述一下HTTP Cache机制: 当资源资源第 ...

  3. SELinux 服务检查与关闭

    查看SELinux状态: 1./usr/sbin/sestatus -v      ##如果SELinux status参数为enabled即为开启状态 SELinux status:         ...

  4. Codeforces 837 E Vasya's Function

    Discription Vasya is studying number theory. He has denoted a function f(a, b) such that: f(a, 0) =  ...

  5. @InsertProvider 根据bean属性,自动生成插入sql语句

    以Test为例,用mybatis的@InsertProvider的注解插入数据的时候,每次都要写类似于 Mapper类 @Mapper public interface TestDao { @Inse ...

  6. Apdex——衡量服务器性能的标准

    Apdex 全称是 Application Performance Index,是由 Apdex 联盟开放的用于评估应用性能的工业标准.Apdex 联盟起源于 2004 年,由 Peter Sevci ...

  7. Android自己定义View基础篇(三)之SwitchButton开关

    自己定义View基础篇(二) 自己定义View基础篇(一) 自己定义View原理 我在解说之前,先来看看效果图,有图有真相:(转换gif图片效果太差) 那来看看真实图片: 假设你要更改样式,请改动例如 ...

  8. Variable 'bop' is uninitialized when captured by block

    代码: - (void)doTest { NSBlockOperation * bop = [NSBlockOperation blockOperationWithBlock:^{ if (!bop. ...

  9. 浅谈xss原理

    近日,论坛上面XSS满天飞,各处都能够见到XSS的痕迹,前段时间论坛上面也出现了XSS的迹象.然后我等小菜不是太懂啊,怎么办?没办法仅仅有求助度娘跟谷歌这对情侣了. 能够说小菜也算懂了一些.不敢藏私, ...

  10. 手动编译一个c文件(Win7下如何使用GCC编译器)

    主要参考这篇http://jingyan.baidu.com/article/c275f6bacc0126e33c756771.html 我没找到minGW的下载地址,而是直接用codeblocks自 ...