/**
 * SyntaxHighlighter
 * http://alexgorbatchev.com/
 *
 * SyntaxHighlighter is donationware. If you are using it, please donate.
 * http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
 *
 * @version
 * 2.1.364 (October 15 2009)
 * 
 * @copyright
 * Copyright (C) 2004-2009 Alex Gorbatchev.
 *
 * @license
 * This file is part of SyntaxHighlighter.
 * 
 * SyntaxHighlighter is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * SyntaxHighlighter is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with SyntaxHighlighter.  If not, see <http://www.gnu.org/copyleft/lesser.html>.
 */
SyntaxHighlighter.brushes.Lua = function()
{
	// Copyright 2009 Lee Gao

	var keywords =	'break do end else elseif function if local nil not or repeat return and then until while this for false true';
					
	var functions =	'math\\.\\w+ string\\.\\w+ os\\.\\w+ debug\\.\\w+ io\\.\\w+ error fopen dofile coroutine\\.\\w+ arg getmetatable ipairs '+
	'loadfile loadlib loadstring longjmp print rawget rawset seek setmetatable assert tonumber tostring require '+
	'table\\.\\w+';

	this.regexList = [
		{ regex: new RegExp('--\\[\\[[\\s\\S]*\\]\\]--', 'gm'),		css: 'comment'},			// one line comments
		{ regex: new RegExp('--[^\\[]{2}.*$', 'gm'),				css: 'comment' },			// multiline comments
		{ regex: /\[\[([^\*][\s\S]*)?\]\]/gm,						css: 'string' },			// multiline strings
		{ regex: SyntaxHighlighter.regexLib.doubleQuotedString,		css: 'string' },			// strings
		{ regex: SyntaxHighlighter.regexLib.singleQuotedString,		css: 'string' },			// strings
		{ regex: /\b\d+\.?\w*/g, 									css: 'value' },
		{ regex: new RegExp(this.getKeywords(functions), 'gm'),		css: 'functions bold' },
		{ regex: new RegExp(this.getKeywords(keywords), 'gm'),		css: 'keyword bold' },
		{ regex: /\+|\-|\~|\#|\*|\,|\/|\%|=|==|\<|\>|\^|\||\|\||\&\&|\.\.|\./gm, 							css: 'color2' },
		{ regex: /\{|}|\(|\)|\[|]/gm, 							css: 'color3 bold' },
		];
};

SyntaxHighlighter.brushes.Lua.prototype	= new SyntaxHighlighter.Highlighter();
SyntaxHighlighter.brushes.Lua.aliases	= ['lua'];