Skip to content

Instantly share code, notes, and snippets.

@ysc3839
Created July 30, 2016 13:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ysc3839/5a292dfc38cd1121176dc4696ab2458d to your computer and use it in GitHub Desktop.
Save ysc3839/5a292dfc38cd1121176dc4696ab2458d to your computer and use it in GitHub Desktop.
Squirrel hightlight js
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/wiki/SyntaxHighlighter:Donate
*
* @version
* 2.0.320 (May 03 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.Squirrel = function()
{
// Contributed by Erik Peterson.
var keywords = 'break case catch class clone continue default delegate delete else extends for function ' +
'if in local null resume return switch this throw try typeof while parent yield constructor ' +
'vargc vargv instanceof true false static';
var builtins = '_set _get _newslot _delslot _add _sub _mul _div _modulo _unm _typeof _cmp _call _cloned ' +
'_nexti _tostring _inherited _newmember array seterrorhandler setdebughook enabledebuginfo ' +
'getroottable assert print compilestring collectgarbage type getstackinfos newthread _version_ ' +
'_charsize_ _intsize_ tofloat tostring tointeger tochar weakref rawget rawset';
this.regexList = [
{ regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments
{ regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multi line comments
{ regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings
{ regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings
{ regex: /\b[A-Z0-9_]+\b/g, css: 'constants' }, // constants
{ regex: /:[a-z][A-Za-z0-9_]*/g, css: 'color2' }, // symbols
{ regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, // keywords
{ regex: new RegExp(this.getKeywords(builtins), 'gm'), css: 'color1' } // builtins
];
this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags);
};
SyntaxHighlighter.brushes.Squirrel.prototype = new SyntaxHighlighter.Highlighter();
SyntaxHighlighter.brushes.Squirrel.aliases = ['sq', 'nut', 'squirrel'];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment