hljs 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/README.md +11 -1
- data/lib/hljs.rb +17 -5
- data/lib/hljs/adapter.rb +15 -4
- data/lib/hljs/adapters/highlight_js.rb +3 -3
- data/lib/hljs/adapters/syntax_highlighter.rb +25 -0
- data/lib/hljs/version.rb +1 -1
- data/spec/fixtures/SyntaxHighlighter/html.xml.html +1 -0
- data/spec/fixtures/SyntaxHighlighter/javascript.js.html +1 -0
- data/spec/fixtures/SyntaxHighlighter/python.py.html +1 -0
- data/spec/fixtures/SyntaxHighlighter/ruby.rb.html +1 -0
- data/spec/fixtures/highlight.js/{output/output.xml.html → html.xml.html} +0 -0
- data/spec/fixtures/highlight.js/{output/output.js.html → javascript.js.html} +0 -0
- data/spec/fixtures/highlight.js/{output/output.py.html → python.py.html} +0 -0
- data/spec/fixtures/highlight.js/{output/output.rb.html → ruby.rb.html} +0 -0
- data/spec/fixtures/{highlight.js/input/input.xml → input/html.xml} +0 -0
- data/spec/fixtures/{highlight.js/input/input.js → input/javascript.js} +0 -0
- data/spec/fixtures/{highlight.js/input/input.py → input/python.py} +0 -0
- data/spec/fixtures/{highlight.js/input/input.rb → input/ruby.rb} +0 -0
- data/spec/higlight_js_spec.rb +24 -9
- data/spec/hljs_spec.rb +25 -15
- data/spec/shared_examples_for_adapter.rb +14 -0
- data/spec/spec_helper.rb +9 -6
- data/spec/syntax_highlighter_spec.rb +24 -0
- data/vendor/SyntaxHighlighter/shBrushAS3.js +59 -0
- data/vendor/SyntaxHighlighter/shBrushAppleScript.js +75 -0
- data/vendor/SyntaxHighlighter/shBrushBash.js +59 -0
- data/vendor/SyntaxHighlighter/shBrushCSharp.js +65 -0
- data/vendor/SyntaxHighlighter/shBrushColdFusion.js +100 -0
- data/vendor/SyntaxHighlighter/shBrushCpp.js +97 -0
- data/vendor/SyntaxHighlighter/shBrushCss.js +91 -0
- data/vendor/SyntaxHighlighter/shBrushDelphi.js +55 -0
- data/vendor/SyntaxHighlighter/shBrushDiff.js +41 -0
- data/vendor/SyntaxHighlighter/shBrushErlang.js +52 -0
- data/vendor/SyntaxHighlighter/shBrushGroovy.js +67 -0
- data/vendor/SyntaxHighlighter/shBrushJScript.js +52 -0
- data/vendor/SyntaxHighlighter/shBrushJava.js +57 -0
- data/vendor/SyntaxHighlighter/shBrushJavaFX.js +58 -0
- data/vendor/SyntaxHighlighter/shBrushPerl.js +72 -0
- data/vendor/SyntaxHighlighter/shBrushPhp.js +88 -0
- data/vendor/SyntaxHighlighter/shBrushPlain.js +33 -0
- data/vendor/SyntaxHighlighter/shBrushPowerShell.js +74 -0
- data/vendor/SyntaxHighlighter/shBrushPython.js +64 -0
- data/vendor/SyntaxHighlighter/shBrushRuby.js +55 -0
- data/vendor/SyntaxHighlighter/shBrushSass.js +94 -0
- data/vendor/SyntaxHighlighter/shBrushScala.js +51 -0
- data/vendor/SyntaxHighlighter/shBrushSql.js +66 -0
- data/vendor/SyntaxHighlighter/shBrushVb.js +56 -0
- data/vendor/SyntaxHighlighter/shBrushXml.js +69 -0
- data/vendor/SyntaxHighlighter/shCore.js +17 -0
- metadata +57 -18
@@ -0,0 +1,41 @@
|
|
1
|
+
/**
|
2
|
+
* SyntaxHighlighter
|
3
|
+
* http://alexgorbatchev.com/SyntaxHighlighter
|
4
|
+
*
|
5
|
+
* SyntaxHighlighter is donationware. If you are using it, please donate.
|
6
|
+
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
|
7
|
+
*
|
8
|
+
* @version
|
9
|
+
* 3.0.83 (July 02 2010)
|
10
|
+
*
|
11
|
+
* @copyright
|
12
|
+
* Copyright (C) 2004-2010 Alex Gorbatchev.
|
13
|
+
*
|
14
|
+
* @license
|
15
|
+
* Dual licensed under the MIT and GPL licenses.
|
16
|
+
*/
|
17
|
+
;(function()
|
18
|
+
{
|
19
|
+
// CommonJS
|
20
|
+
typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
|
21
|
+
|
22
|
+
function Brush()
|
23
|
+
{
|
24
|
+
this.regexList = [
|
25
|
+
{ regex: /^\+\+\+.*$/gm, css: 'color2' },
|
26
|
+
{ regex: /^\-\-\-.*$/gm, css: 'color2' },
|
27
|
+
{ regex: /^\s.*$/gm, css: 'color1' },
|
28
|
+
{ regex: /^@@.*@@$/gm, css: 'variable' },
|
29
|
+
{ regex: /^\+[^\+]{1}.*$/gm, css: 'string' },
|
30
|
+
{ regex: /^\-[^\-]{1}.*$/gm, css: 'comments' }
|
31
|
+
];
|
32
|
+
};
|
33
|
+
|
34
|
+
Brush.prototype = new SyntaxHighlighter.Highlighter();
|
35
|
+
Brush.aliases = ['diff', 'patch'];
|
36
|
+
|
37
|
+
SyntaxHighlighter.brushes.Diff = Brush;
|
38
|
+
|
39
|
+
// CommonJS
|
40
|
+
typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
|
41
|
+
})();
|
@@ -0,0 +1,52 @@
|
|
1
|
+
/**
|
2
|
+
* SyntaxHighlighter
|
3
|
+
* http://alexgorbatchev.com/SyntaxHighlighter
|
4
|
+
*
|
5
|
+
* SyntaxHighlighter is donationware. If you are using it, please donate.
|
6
|
+
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
|
7
|
+
*
|
8
|
+
* @version
|
9
|
+
* 3.0.83 (July 02 2010)
|
10
|
+
*
|
11
|
+
* @copyright
|
12
|
+
* Copyright (C) 2004-2010 Alex Gorbatchev.
|
13
|
+
*
|
14
|
+
* @license
|
15
|
+
* Dual licensed under the MIT and GPL licenses.
|
16
|
+
*/
|
17
|
+
;(function()
|
18
|
+
{
|
19
|
+
// CommonJS
|
20
|
+
typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
|
21
|
+
|
22
|
+
function Brush()
|
23
|
+
{
|
24
|
+
// Contributed by Jean-Lou Dupont
|
25
|
+
// http://jldupont.blogspot.com/2009/06/erlang-syntax-highlighter.html
|
26
|
+
|
27
|
+
// According to: http://erlang.org/doc/reference_manual/introduction.html#1.5
|
28
|
+
var keywords = 'after and andalso band begin bnot bor bsl bsr bxor '+
|
29
|
+
'case catch cond div end fun if let not of or orelse '+
|
30
|
+
'query receive rem try when xor'+
|
31
|
+
// additional
|
32
|
+
' module export import define';
|
33
|
+
|
34
|
+
this.regexList = [
|
35
|
+
{ regex: new RegExp("[A-Z][A-Za-z0-9_]+", 'g'), css: 'constants' },
|
36
|
+
{ regex: new RegExp("\\%.+", 'gm'), css: 'comments' },
|
37
|
+
{ regex: new RegExp("\\?[A-Za-z0-9_]+", 'g'), css: 'preprocessor' },
|
38
|
+
{ regex: new RegExp("[a-z0-9_]+:[a-z0-9_]+", 'g'), css: 'functions' },
|
39
|
+
{ regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' },
|
40
|
+
{ regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' },
|
41
|
+
{ regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }
|
42
|
+
];
|
43
|
+
};
|
44
|
+
|
45
|
+
Brush.prototype = new SyntaxHighlighter.Highlighter();
|
46
|
+
Brush.aliases = ['erl', 'erlang'];
|
47
|
+
|
48
|
+
SyntaxHighlighter.brushes.Erlang = Brush;
|
49
|
+
|
50
|
+
// CommonJS
|
51
|
+
typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
|
52
|
+
})();
|
@@ -0,0 +1,67 @@
|
|
1
|
+
/**
|
2
|
+
* SyntaxHighlighter
|
3
|
+
* http://alexgorbatchev.com/SyntaxHighlighter
|
4
|
+
*
|
5
|
+
* SyntaxHighlighter is donationware. If you are using it, please donate.
|
6
|
+
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
|
7
|
+
*
|
8
|
+
* @version
|
9
|
+
* 3.0.83 (July 02 2010)
|
10
|
+
*
|
11
|
+
* @copyright
|
12
|
+
* Copyright (C) 2004-2010 Alex Gorbatchev.
|
13
|
+
*
|
14
|
+
* @license
|
15
|
+
* Dual licensed under the MIT and GPL licenses.
|
16
|
+
*/
|
17
|
+
;(function()
|
18
|
+
{
|
19
|
+
// CommonJS
|
20
|
+
typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
|
21
|
+
|
22
|
+
function Brush()
|
23
|
+
{
|
24
|
+
// Contributed by Andres Almiray
|
25
|
+
// http://jroller.com/aalmiray/entry/nice_source_code_syntax_highlighter
|
26
|
+
|
27
|
+
var keywords = 'as assert break case catch class continue def default do else extends finally ' +
|
28
|
+
'if in implements import instanceof interface new package property return switch ' +
|
29
|
+
'throw throws try while public protected private static';
|
30
|
+
var types = 'void boolean byte char short int long float double';
|
31
|
+
var constants = 'null';
|
32
|
+
var methods = 'allProperties count get size '+
|
33
|
+
'collect each eachProperty eachPropertyName eachWithIndex find findAll ' +
|
34
|
+
'findIndexOf grep inject max min reverseEach sort ' +
|
35
|
+
'asImmutable asSynchronized flatten intersect join pop reverse subMap toList ' +
|
36
|
+
'padRight padLeft contains eachMatch toCharacter toLong toUrl tokenize ' +
|
37
|
+
'eachFile eachFileRecurse eachB yte eachLine readBytes readLine getText ' +
|
38
|
+
'splitEachLine withReader append encodeBase64 decodeBase64 filterLine ' +
|
39
|
+
'transformChar transformLine withOutputStream withPrintWriter withStream ' +
|
40
|
+
'withStreams withWriter withWriterAppend write writeLine '+
|
41
|
+
'dump inspect invokeMethod print println step times upto use waitForOrKill '+
|
42
|
+
'getText';
|
43
|
+
|
44
|
+
this.regexList = [
|
45
|
+
{ regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments
|
46
|
+
{ regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments
|
47
|
+
{ regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings
|
48
|
+
{ regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings
|
49
|
+
{ regex: /""".*"""/g, css: 'string' }, // GStrings
|
50
|
+
{ regex: new RegExp('\\b([\\d]+(\\.[\\d]+)?|0x[a-f0-9]+)\\b', 'gi'), css: 'value' }, // numbers
|
51
|
+
{ regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }, // goovy keyword
|
52
|
+
{ regex: new RegExp(this.getKeywords(types), 'gm'), css: 'color1' }, // goovy/java type
|
53
|
+
{ regex: new RegExp(this.getKeywords(constants), 'gm'), css: 'constants' }, // constants
|
54
|
+
{ regex: new RegExp(this.getKeywords(methods), 'gm'), css: 'functions' } // methods
|
55
|
+
];
|
56
|
+
|
57
|
+
this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags);
|
58
|
+
}
|
59
|
+
|
60
|
+
Brush.prototype = new SyntaxHighlighter.Highlighter();
|
61
|
+
Brush.aliases = ['groovy'];
|
62
|
+
|
63
|
+
SyntaxHighlighter.brushes.Groovy = Brush;
|
64
|
+
|
65
|
+
// CommonJS
|
66
|
+
typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
|
67
|
+
})();
|
@@ -0,0 +1,52 @@
|
|
1
|
+
/**
|
2
|
+
* SyntaxHighlighter
|
3
|
+
* http://alexgorbatchev.com/SyntaxHighlighter
|
4
|
+
*
|
5
|
+
* SyntaxHighlighter is donationware. If you are using it, please donate.
|
6
|
+
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
|
7
|
+
*
|
8
|
+
* @version
|
9
|
+
* 3.0.83 (July 02 2010)
|
10
|
+
*
|
11
|
+
* @copyright
|
12
|
+
* Copyright (C) 2004-2010 Alex Gorbatchev.
|
13
|
+
*
|
14
|
+
* @license
|
15
|
+
* Dual licensed under the MIT and GPL licenses.
|
16
|
+
*/
|
17
|
+
;(function()
|
18
|
+
{
|
19
|
+
// CommonJS
|
20
|
+
typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
|
21
|
+
|
22
|
+
function Brush()
|
23
|
+
{
|
24
|
+
var keywords = 'break case catch continue ' +
|
25
|
+
'default delete do else false ' +
|
26
|
+
'for function if in instanceof ' +
|
27
|
+
'new null return super switch ' +
|
28
|
+
'this throw true try typeof var while with'
|
29
|
+
;
|
30
|
+
|
31
|
+
var r = SyntaxHighlighter.regexLib;
|
32
|
+
|
33
|
+
this.regexList = [
|
34
|
+
{ regex: r.multiLineDoubleQuotedString, css: 'string' }, // double quoted strings
|
35
|
+
{ regex: r.multiLineSingleQuotedString, css: 'string' }, // single quoted strings
|
36
|
+
{ regex: r.singleLineCComments, css: 'comments' }, // one line comments
|
37
|
+
{ regex: r.multiLineCComments, css: 'comments' }, // multiline comments
|
38
|
+
{ regex: /\s*#.*/gm, css: 'preprocessor' }, // preprocessor tags like #region and #endregion
|
39
|
+
{ regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // keywords
|
40
|
+
];
|
41
|
+
|
42
|
+
this.forHtmlScript(r.scriptScriptTags);
|
43
|
+
};
|
44
|
+
|
45
|
+
Brush.prototype = new SyntaxHighlighter.Highlighter();
|
46
|
+
Brush.aliases = ['js', 'jscript', 'javascript'];
|
47
|
+
|
48
|
+
SyntaxHighlighter.brushes.JScript = Brush;
|
49
|
+
|
50
|
+
// CommonJS
|
51
|
+
typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
|
52
|
+
})();
|
@@ -0,0 +1,57 @@
|
|
1
|
+
/**
|
2
|
+
* SyntaxHighlighter
|
3
|
+
* http://alexgorbatchev.com/SyntaxHighlighter
|
4
|
+
*
|
5
|
+
* SyntaxHighlighter is donationware. If you are using it, please donate.
|
6
|
+
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
|
7
|
+
*
|
8
|
+
* @version
|
9
|
+
* 3.0.83 (July 02 2010)
|
10
|
+
*
|
11
|
+
* @copyright
|
12
|
+
* Copyright (C) 2004-2010 Alex Gorbatchev.
|
13
|
+
*
|
14
|
+
* @license
|
15
|
+
* Dual licensed under the MIT and GPL licenses.
|
16
|
+
*/
|
17
|
+
;(function()
|
18
|
+
{
|
19
|
+
// CommonJS
|
20
|
+
typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
|
21
|
+
|
22
|
+
function Brush()
|
23
|
+
{
|
24
|
+
var keywords = 'abstract assert boolean break byte case catch char class const ' +
|
25
|
+
'continue default do double else enum extends ' +
|
26
|
+
'false final finally float for goto if implements import ' +
|
27
|
+
'instanceof int interface long native new null ' +
|
28
|
+
'package private protected public return ' +
|
29
|
+
'short static strictfp super switch synchronized this throw throws true ' +
|
30
|
+
'transient try void volatile while';
|
31
|
+
|
32
|
+
this.regexList = [
|
33
|
+
{ regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments
|
34
|
+
{ regex: /\/\*([^\*][\s\S]*)?\*\//gm, css: 'comments' }, // multiline comments
|
35
|
+
{ regex: /\/\*(?!\*\/)\*[\s\S]*?\*\//gm, css: 'preprocessor' }, // documentation comments
|
36
|
+
{ regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // strings
|
37
|
+
{ regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // strings
|
38
|
+
{ regex: /\b([\d]+(\.[\d]+)?|0x[a-f0-9]+)\b/gi, css: 'value' }, // numbers
|
39
|
+
{ regex: /(?!\@interface\b)\@[\$\w]+\b/g, css: 'color1' }, // annotation @anno
|
40
|
+
{ regex: /\@interface\b/g, css: 'color2' }, // @interface keyword
|
41
|
+
{ regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // java keyword
|
42
|
+
];
|
43
|
+
|
44
|
+
this.forHtmlScript({
|
45
|
+
left : /(<|<)%[@!=]?/g,
|
46
|
+
right : /%(>|>)/g
|
47
|
+
});
|
48
|
+
};
|
49
|
+
|
50
|
+
Brush.prototype = new SyntaxHighlighter.Highlighter();
|
51
|
+
Brush.aliases = ['java'];
|
52
|
+
|
53
|
+
SyntaxHighlighter.brushes.Java = Brush;
|
54
|
+
|
55
|
+
// CommonJS
|
56
|
+
typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
|
57
|
+
})();
|
@@ -0,0 +1,58 @@
|
|
1
|
+
/**
|
2
|
+
* SyntaxHighlighter
|
3
|
+
* http://alexgorbatchev.com/SyntaxHighlighter
|
4
|
+
*
|
5
|
+
* SyntaxHighlighter is donationware. If you are using it, please donate.
|
6
|
+
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
|
7
|
+
*
|
8
|
+
* @version
|
9
|
+
* 3.0.83 (July 02 2010)
|
10
|
+
*
|
11
|
+
* @copyright
|
12
|
+
* Copyright (C) 2004-2010 Alex Gorbatchev.
|
13
|
+
*
|
14
|
+
* @license
|
15
|
+
* Dual licensed under the MIT and GPL licenses.
|
16
|
+
*/
|
17
|
+
;(function()
|
18
|
+
{
|
19
|
+
// CommonJS
|
20
|
+
typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
|
21
|
+
|
22
|
+
function Brush()
|
23
|
+
{
|
24
|
+
// Contributed by Patrick Webster
|
25
|
+
// http://patrickwebster.blogspot.com/2009/04/javafx-brush-for-syntaxhighlighter.html
|
26
|
+
var datatypes = 'Boolean Byte Character Double Duration '
|
27
|
+
+ 'Float Integer Long Number Short String Void'
|
28
|
+
;
|
29
|
+
|
30
|
+
var keywords = 'abstract after and as assert at before bind bound break catch class '
|
31
|
+
+ 'continue def delete else exclusive extends false finally first for from '
|
32
|
+
+ 'function if import in indexof init insert instanceof into inverse last '
|
33
|
+
+ 'lazy mixin mod nativearray new not null on or override package postinit '
|
34
|
+
+ 'protected public public-init public-read replace return reverse sizeof '
|
35
|
+
+ 'step super then this throw true try tween typeof var where while with '
|
36
|
+
+ 'attribute let private readonly static trigger'
|
37
|
+
;
|
38
|
+
|
39
|
+
this.regexList = [
|
40
|
+
{ regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' },
|
41
|
+
{ regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' },
|
42
|
+
{ regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' },
|
43
|
+
{ regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' },
|
44
|
+
{ regex: /(-?\.?)(\b(\d*\.?\d+|\d+\.?\d*)(e[+-]?\d+)?|0x[a-f\d]+)\b\.?/gi, css: 'color2' }, // numbers
|
45
|
+
{ regex: new RegExp(this.getKeywords(datatypes), 'gm'), css: 'variable' }, // datatypes
|
46
|
+
{ regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }
|
47
|
+
];
|
48
|
+
this.forHtmlScript(SyntaxHighlighter.regexLib.aspScriptTags);
|
49
|
+
};
|
50
|
+
|
51
|
+
Brush.prototype = new SyntaxHighlighter.Highlighter();
|
52
|
+
Brush.aliases = ['jfx', 'javafx'];
|
53
|
+
|
54
|
+
SyntaxHighlighter.brushes.JavaFX = Brush;
|
55
|
+
|
56
|
+
// CommonJS
|
57
|
+
typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
|
58
|
+
})();
|
@@ -0,0 +1,72 @@
|
|
1
|
+
/**
|
2
|
+
* SyntaxHighlighter
|
3
|
+
* http://alexgorbatchev.com/SyntaxHighlighter
|
4
|
+
*
|
5
|
+
* SyntaxHighlighter is donationware. If you are using it, please donate.
|
6
|
+
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
|
7
|
+
*
|
8
|
+
* @version
|
9
|
+
* 3.0.83 (July 02 2010)
|
10
|
+
*
|
11
|
+
* @copyright
|
12
|
+
* Copyright (C) 2004-2010 Alex Gorbatchev.
|
13
|
+
*
|
14
|
+
* @license
|
15
|
+
* Dual licensed under the MIT and GPL licenses.
|
16
|
+
*/
|
17
|
+
;(function()
|
18
|
+
{
|
19
|
+
// CommonJS
|
20
|
+
typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
|
21
|
+
|
22
|
+
function Brush()
|
23
|
+
{
|
24
|
+
// Contributed by David Simmons-Duffin and Marty Kube
|
25
|
+
|
26
|
+
var funcs =
|
27
|
+
'abs accept alarm atan2 bind binmode chdir chmod chomp chop chown chr ' +
|
28
|
+
'chroot close closedir connect cos crypt defined delete each endgrent ' +
|
29
|
+
'endhostent endnetent endprotoent endpwent endservent eof exec exists ' +
|
30
|
+
'exp fcntl fileno flock fork format formline getc getgrent getgrgid ' +
|
31
|
+
'getgrnam gethostbyaddr gethostbyname gethostent getlogin getnetbyaddr ' +
|
32
|
+
'getnetbyname getnetent getpeername getpgrp getppid getpriority ' +
|
33
|
+
'getprotobyname getprotobynumber getprotoent getpwent getpwnam getpwuid ' +
|
34
|
+
'getservbyname getservbyport getservent getsockname getsockopt glob ' +
|
35
|
+
'gmtime grep hex index int ioctl join keys kill lc lcfirst length link ' +
|
36
|
+
'listen localtime lock log lstat map mkdir msgctl msgget msgrcv msgsnd ' +
|
37
|
+
'oct open opendir ord pack pipe pop pos print printf prototype push ' +
|
38
|
+
'quotemeta rand read readdir readline readlink readpipe recv rename ' +
|
39
|
+
'reset reverse rewinddir rindex rmdir scalar seek seekdir select semctl ' +
|
40
|
+
'semget semop send setgrent sethostent setnetent setpgrp setpriority ' +
|
41
|
+
'setprotoent setpwent setservent setsockopt shift shmctl shmget shmread ' +
|
42
|
+
'shmwrite shutdown sin sleep socket socketpair sort splice split sprintf ' +
|
43
|
+
'sqrt srand stat study substr symlink syscall sysopen sysread sysseek ' +
|
44
|
+
'system syswrite tell telldir time times tr truncate uc ucfirst umask ' +
|
45
|
+
'undef unlink unpack unshift utime values vec wait waitpid warn write';
|
46
|
+
|
47
|
+
var keywords =
|
48
|
+
'bless caller continue dbmclose dbmopen die do dump else elsif eval exit ' +
|
49
|
+
'for foreach goto if import last local my next no our package redo ref ' +
|
50
|
+
'require return sub tie tied unless untie until use wantarray while';
|
51
|
+
|
52
|
+
this.regexList = [
|
53
|
+
{ regex: new RegExp('#[^!].*$', 'gm'), css: 'comments' },
|
54
|
+
{ regex: new RegExp('^\\s*#!.*$', 'gm'), css: 'preprocessor' }, // shebang
|
55
|
+
{ regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' },
|
56
|
+
{ regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' },
|
57
|
+
{ regex: new RegExp('(\\$|@|%)\\w+', 'g'), css: 'variable' },
|
58
|
+
{ regex: new RegExp(this.getKeywords(funcs), 'gmi'), css: 'functions' },
|
59
|
+
{ regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' }
|
60
|
+
];
|
61
|
+
|
62
|
+
this.forHtmlScript(SyntaxHighlighter.regexLib.phpScriptTags);
|
63
|
+
}
|
64
|
+
|
65
|
+
Brush.prototype = new SyntaxHighlighter.Highlighter();
|
66
|
+
Brush.aliases = ['perl', 'Perl', 'pl'];
|
67
|
+
|
68
|
+
SyntaxHighlighter.brushes.Perl = Brush;
|
69
|
+
|
70
|
+
// CommonJS
|
71
|
+
typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
|
72
|
+
})();
|
@@ -0,0 +1,88 @@
|
|
1
|
+
/**
|
2
|
+
* SyntaxHighlighter
|
3
|
+
* http://alexgorbatchev.com/SyntaxHighlighter
|
4
|
+
*
|
5
|
+
* SyntaxHighlighter is donationware. If you are using it, please donate.
|
6
|
+
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
|
7
|
+
*
|
8
|
+
* @version
|
9
|
+
* 3.0.83 (July 02 2010)
|
10
|
+
*
|
11
|
+
* @copyright
|
12
|
+
* Copyright (C) 2004-2010 Alex Gorbatchev.
|
13
|
+
*
|
14
|
+
* @license
|
15
|
+
* Dual licensed under the MIT and GPL licenses.
|
16
|
+
*/
|
17
|
+
;(function()
|
18
|
+
{
|
19
|
+
// CommonJS
|
20
|
+
typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;
|
21
|
+
|
22
|
+
function Brush()
|
23
|
+
{
|
24
|
+
var funcs = 'abs acos acosh addcslashes addslashes ' +
|
25
|
+
'array_change_key_case array_chunk array_combine array_count_values array_diff '+
|
26
|
+
'array_diff_assoc array_diff_key array_diff_uassoc array_diff_ukey array_fill '+
|
27
|
+
'array_filter array_flip array_intersect array_intersect_assoc array_intersect_key '+
|
28
|
+
'array_intersect_uassoc array_intersect_ukey array_key_exists array_keys array_map '+
|
29
|
+
'array_merge array_merge_recursive array_multisort array_pad array_pop array_product '+
|
30
|
+
'array_push array_rand array_reduce array_reverse array_search array_shift '+
|
31
|
+
'array_slice array_splice array_sum array_udiff array_udiff_assoc '+
|
32
|
+
'array_udiff_uassoc array_uintersect array_uintersect_assoc '+
|
33
|
+
'array_uintersect_uassoc array_unique array_unshift array_values array_walk '+
|
34
|
+
'array_walk_recursive atan atan2 atanh base64_decode base64_encode base_convert '+
|
35
|
+
'basename bcadd bccomp bcdiv bcmod bcmul bindec bindtextdomain bzclose bzcompress '+
|
36
|
+
'bzdecompress bzerrno bzerror bzerrstr bzflush bzopen bzread bzwrite ceil chdir '+
|
37
|
+
'checkdate checkdnsrr chgrp chmod chop chown chr chroot chunk_split class_exists '+
|
38
|
+
'closedir closelog copy cos cosh count count_chars date decbin dechex decoct '+
|
39
|
+
'deg2rad delete ebcdic2ascii echo empty end ereg ereg_replace eregi eregi_replace error_log '+
|
40
|
+
'error_reporting escapeshellarg escapeshellcmd eval exec exit exp explode extension_loaded '+
|
41
|
+
'feof fflush fgetc fgetcsv fgets fgetss file_exists file_get_contents file_put_contents '+
|
42
|
+
'fileatime filectime filegroup fileinode filemtime fileowner fileperms filesize filetype '+
|
43
|
+
'floatval flock floor flush fmod fnmatch fopen fpassthru fprintf fputcsv fputs fread fscanf '+
|
44
|
+
'fseek fsockopen fstat ftell ftok getallheaders getcwd getdate getenv gethostbyaddr gethostbyname '+
|
45
|
+
'gethostbynamel getimagesize getlastmod getmxrr getmygid getmyinode getmypid getmyuid getopt '+
|
46
|
+
'getprotobyname getprotobynumber getrandmax getrusage getservbyname getservbyport gettext '+
|
47
|
+
'gettimeofday gettype glob gmdate gmmktime ini_alter ini_get ini_get_all ini_restore ini_set '+
|
48
|
+
'interface_exists intval ip2long is_a is_array is_bool is_callable is_dir is_double '+
|
49
|
+
'is_executable is_file is_finite is_float is_infinite is_int is_integer is_link is_long '+
|
50
|
+
'is_nan is_null is_numeric is_object is_readable is_real is_resource is_scalar is_soap_fault '+
|
51
|
+
'is_string is_subclass_of is_uploaded_file is_writable is_writeable mkdir mktime nl2br '+
|
52
|
+
'parse_ini_file parse_str parse_url passthru pathinfo print readlink realpath rewind rewinddir rmdir '+
|
53
|
+
'round str_ireplace str_pad str_repeat str_replace str_rot13 str_shuffle str_split '+
|
54
|
+
'str_word_count strcasecmp strchr strcmp strcoll strcspn strftime strip_tags stripcslashes '+
|
55
|
+
'stripos stripslashes stristr strlen strnatcasecmp strnatcmp strncasecmp strncmp strpbrk '+
|
56
|
+
'strpos strptime strrchr strrev strripos strrpos strspn strstr strtok strtolower strtotime '+
|
57
|
+
'strtoupper strtr strval substr substr_compare';
|
58
|
+
|
59
|
+
var keywords = 'abstract and array as break case catch cfunction class clone const continue declare default die do ' +
|
60
|
+
'else elseif enddeclare endfor endforeach endif endswitch endwhile extends final for foreach ' +
|
61
|
+
'function include include_once global goto if implements interface instanceof namespace new ' +
|
62
|
+
'old_function or private protected public return require require_once static switch ' +
|
63
|
+
'throw try use var while xor ';
|
64
|
+
|
65
|
+
var constants = '__FILE__ __LINE__ __METHOD__ __FUNCTION__ __CLASS__';
|
66
|
+
|
67
|
+
this.regexList = [
|
68
|
+
{ regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments
|
69
|
+
{ regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments
|
70
|
+
{ regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings
|
71
|
+
{ regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings
|
72
|
+
{ regex: /\$\w+/g, css: 'variable' }, // variables
|
73
|
+
{ regex: new RegExp(this.getKeywords(funcs), 'gmi'), css: 'functions' }, // common functions
|
74
|
+
{ regex: new RegExp(this.getKeywords(constants), 'gmi'), css: 'constants' }, // constants
|
75
|
+
{ regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // keyword
|
76
|
+
];
|
77
|
+
|
78
|
+
this.forHtmlScript(SyntaxHighlighter.regexLib.phpScriptTags);
|
79
|
+
};
|
80
|
+
|
81
|
+
Brush.prototype = new SyntaxHighlighter.Highlighter();
|
82
|
+
Brush.aliases = ['php'];
|
83
|
+
|
84
|
+
SyntaxHighlighter.brushes.Php = Brush;
|
85
|
+
|
86
|
+
// CommonJS
|
87
|
+
typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
|
88
|
+
})();
|