rhighlightjs 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +5 -0
- data/.gitignore +7 -0
- data/LICENSE +20 -0
- data/MIT-LICENSE +20 -0
- data/README.rdoc +51 -0
- data/Rakefile +58 -0
- data/VERSION +1 -0
- data/assets/images/brown_papersq.png +0 -0
- data/assets/images/paperbg.gif +0 -0
- data/assets/images/school_book.png +0 -0
- data/assets/javascripts/highlight.js +570 -0
- data/assets/javascripts/highlight.pack.js +1 -0
- data/assets/javascripts/languages/1c.js +95 -0
- data/assets/javascripts/languages/apache.js +442 -0
- data/assets/javascripts/languages/avrasm.js +89 -0
- data/assets/javascripts/languages/axapta.js +52 -0
- data/assets/javascripts/languages/bash.js +81 -0
- data/assets/javascripts/languages/cpp.js +42 -0
- data/assets/javascripts/languages/cs.js +47 -0
- data/assets/javascripts/languages/css.js +81 -0
- data/assets/javascripts/languages/delphi.js +82 -0
- data/assets/javascripts/languages/diff.js +65 -0
- data/assets/javascripts/languages/django.js +61 -0
- data/assets/javascripts/languages/dos.js +33 -0
- data/assets/javascripts/languages/dynamic.js +460 -0
- data/assets/javascripts/languages/html-xml.js +140 -0
- data/assets/javascripts/languages/ini.js +40 -0
- data/assets/javascripts/languages/java.js +58 -0
- data/assets/javascripts/languages/javascript.js +50 -0
- data/assets/javascripts/languages/lisp.js +89 -0
- data/assets/javascripts/languages/mel.js +51 -0
- data/assets/javascripts/languages/parser3.js +54 -0
- data/assets/javascripts/languages/perl.js +152 -0
- data/assets/javascripts/languages/php.js +54 -0
- data/assets/javascripts/languages/profile.js +51 -0
- data/assets/javascripts/languages/python.js +75 -0
- data/assets/javascripts/languages/renderman.js +239 -0
- data/assets/javascripts/languages/ruby.js +176 -0
- data/assets/javascripts/languages/smalltalk.js +52 -0
- data/assets/javascripts/languages/sql.js +52 -0
- data/assets/javascripts/languages/static.js +223 -0
- data/assets/javascripts/languages/vbscript.js +27 -0
- data/assets/javascripts/languages/www.js +257 -0
- data/assets/javascripts/styleswitch.js +57 -0
- data/assets/stylesheets/ascetic.css +42 -0
- data/assets/stylesheets/brown_paper.css +104 -0
- data/assets/stylesheets/brown_papersq.png +0 -0
- data/assets/stylesheets/dark.css +101 -0
- data/assets/stylesheets/default.css +103 -0
- data/assets/stylesheets/far.css +113 -0
- data/assets/stylesheets/github.css +90 -0
- data/assets/stylesheets/idea.css +74 -0
- data/assets/stylesheets/ir_black.css +67 -0
- data/assets/stylesheets/magula.css +105 -0
- data/assets/stylesheets/notebook.css +106 -0
- data/assets/stylesheets/school_book.css +106 -0
- data/assets/stylesheets/school_book.png +0 -0
- data/assets/stylesheets/sunburst.css +112 -0
- data/assets/stylesheets/vs.css +68 -0
- data/assets/stylesheets/zenburn.css +113 -0
- data/assets/stylesheets/zenburn.css.txt +108 -0
- data/bin/rhighlightjs +6 -0
- data/init.rb +2 -0
- data/install.rb +3 -0
- data/lib/rhighlightjs.rb +28 -0
- data/rhighlightjs.gemspec +170 -0
- data/tasks/rhighlightjs_tasks.rake +18 -0
- data/test/rhighlightjs_test.rb +7 -0
- data/test/test_helper.rb +10 -0
- data/uninstall.rb +1 -0
- metadata +135 -0
@@ -0,0 +1,75 @@
|
|
1
|
+
/*
|
2
|
+
Language: Python
|
3
|
+
*/
|
4
|
+
|
5
|
+
hljs.LANGUAGES.python = {
|
6
|
+
defaultMode: {
|
7
|
+
lexems: [hljs.UNDERSCORE_IDENT_RE],
|
8
|
+
illegal: '(</|->)',
|
9
|
+
contains: ['comment', 'string', 'function', 'class', 'number', 'decorator'],
|
10
|
+
keywords: {
|
11
|
+
'keyword': {'and': 1, 'elif': 1, 'is': 1, 'global': 1, 'as': 1, 'in': 1, 'if': 1, 'from': 1, 'raise': 1, 'for': 1, 'except': 1, 'finally': 1, 'print': 1, 'import': 1, 'pass': 1, 'return': 1, 'exec': 1, 'else': 1, 'break': 1, 'not': 1, 'with': 1, 'class': 1, 'assert': 1, 'yield': 1, 'try': 1, 'while': 1, 'continue': 1, 'del': 1, 'or': 1, 'def': 1, 'lambda': 1},
|
12
|
+
'built_in': {'None': 1, 'True': 1, 'False': 1, 'Ellipsis': 1, 'NotImplemented': 1}
|
13
|
+
}
|
14
|
+
},
|
15
|
+
modes: [
|
16
|
+
{
|
17
|
+
className: 'function',
|
18
|
+
lexems: [hljs.UNDERSCORE_IDENT_RE],
|
19
|
+
begin: '\\bdef ', end: ':',
|
20
|
+
illegal: '$',
|
21
|
+
keywords: {'def': 1},
|
22
|
+
contains: ['title', 'params'],
|
23
|
+
relevance: 10
|
24
|
+
},
|
25
|
+
{
|
26
|
+
className: 'class',
|
27
|
+
lexems: [hljs.UNDERSCORE_IDENT_RE],
|
28
|
+
begin: '\\bclass ', end: ':',
|
29
|
+
illegal: '[${]',
|
30
|
+
keywords: {'class': 1},
|
31
|
+
contains: ['title', 'params',],
|
32
|
+
relevance: 10
|
33
|
+
},
|
34
|
+
{
|
35
|
+
className: 'title',
|
36
|
+
begin: hljs.UNDERSCORE_IDENT_RE, end: '^'
|
37
|
+
},
|
38
|
+
{
|
39
|
+
className: 'params',
|
40
|
+
begin: '\\(', end: '\\)',
|
41
|
+
contains: ['string']
|
42
|
+
},
|
43
|
+
hljs.HASH_COMMENT_MODE,
|
44
|
+
hljs.C_NUMBER_MODE,
|
45
|
+
{
|
46
|
+
className: 'string',
|
47
|
+
begin: 'u?r?\'\'\'', end: '\'\'\'',
|
48
|
+
relevance: 10
|
49
|
+
},
|
50
|
+
{
|
51
|
+
className: 'string',
|
52
|
+
begin: 'u?r?"""', end: '"""',
|
53
|
+
relevance: 10
|
54
|
+
},
|
55
|
+
hljs.APOS_STRING_MODE,
|
56
|
+
hljs.QUOTE_STRING_MODE,
|
57
|
+
hljs.BACKSLASH_ESCAPE,
|
58
|
+
{
|
59
|
+
className: 'string',
|
60
|
+
begin: '(u|r|ur)\'', end: '\'',
|
61
|
+
contains: ['escape'],
|
62
|
+
relevance: 10
|
63
|
+
},
|
64
|
+
{
|
65
|
+
className: 'string',
|
66
|
+
begin: '(u|r|ur)"', end: '"',
|
67
|
+
contains: ['escape'],
|
68
|
+
relevance: 10
|
69
|
+
},
|
70
|
+
{
|
71
|
+
className: 'decorator',
|
72
|
+
begin: '@', end: '$'
|
73
|
+
}
|
74
|
+
]
|
75
|
+
};
|
@@ -0,0 +1,239 @@
|
|
1
|
+
/*
|
2
|
+
Language: RenderMan
|
3
|
+
Description: RenderMan Languages RIB and RSL
|
4
|
+
Author: Konstantin Evdokimenko <qewerty@gmail.com>
|
5
|
+
Contributors: Shuen-Huei Guan <drake.guan@gmail.com>
|
6
|
+
*/
|
7
|
+
|
8
|
+
hljs.LANGUAGES.rib = {
|
9
|
+
defaultMode: {
|
10
|
+
lexems: [hljs.UNDERSCORE_IDENT_RE],
|
11
|
+
illegal: '</',
|
12
|
+
contains: ['comment', 'string', 'number'],
|
13
|
+
keywords: {
|
14
|
+
'keyword': {
|
15
|
+
'ArchiveRecord': 1,
|
16
|
+
'AreaLightSource': 1,
|
17
|
+
'Atmosphere': 1,
|
18
|
+
'Attribute': 1,
|
19
|
+
'AttributeBegin': 1,
|
20
|
+
'AttributeEnd': 1,
|
21
|
+
'Basis': 1,
|
22
|
+
'Begin': 1,
|
23
|
+
'Blobby': 1,
|
24
|
+
'Bound': 1,
|
25
|
+
'Clipping': 1,
|
26
|
+
'ClippingPlane': 1,
|
27
|
+
'Color': 1,
|
28
|
+
'ColorSamples': 1,
|
29
|
+
'ConcatTransform': 1,
|
30
|
+
'Cone': 1,
|
31
|
+
'CoordinateSystem': 1,
|
32
|
+
'CoordSysTransform': 1,
|
33
|
+
'CropWindow': 1,
|
34
|
+
'Curves': 1,
|
35
|
+
'Cylinder': 1,
|
36
|
+
'DepthOfField': 1,
|
37
|
+
'Detail': 1,
|
38
|
+
'DetailRange': 1,
|
39
|
+
'Disk': 1,
|
40
|
+
'Displacement': 1,
|
41
|
+
'Display': 1,
|
42
|
+
'End': 1,
|
43
|
+
'ErrorHandler': 1,
|
44
|
+
'Exposure': 1,
|
45
|
+
'Exterior': 1,
|
46
|
+
'Format': 1,
|
47
|
+
'FrameAspectRatio': 1,
|
48
|
+
'FrameBegin': 1,
|
49
|
+
'FrameEnd': 1,
|
50
|
+
'GeneralPolygon': 1,
|
51
|
+
'GeometricApproximation': 1,
|
52
|
+
'Geometry': 1,
|
53
|
+
'Hider': 1,
|
54
|
+
'Hyperboloid': 1,
|
55
|
+
'Identity': 1,
|
56
|
+
'Illuminate': 1,
|
57
|
+
'Imager': 1,
|
58
|
+
'Interior': 1,
|
59
|
+
'LightSource': 1,
|
60
|
+
'MakeCubeFaceEnvironment': 1,
|
61
|
+
'MakeLatLongEnvironment': 1,
|
62
|
+
'MakeShadow': 1,
|
63
|
+
'MakeTexture': 1,
|
64
|
+
'Matte': 1,
|
65
|
+
'MotionBegin': 1,
|
66
|
+
'MotionEnd': 1,
|
67
|
+
'NuPatch': 1,
|
68
|
+
'ObjectBegin': 1,
|
69
|
+
'ObjectEnd': 1,
|
70
|
+
'ObjectInstance': 1,
|
71
|
+
'Opacity': 1,
|
72
|
+
'Option': 1,
|
73
|
+
'Orientation': 1,
|
74
|
+
'Paraboloid': 1,
|
75
|
+
'Patch': 1,
|
76
|
+
'PatchMesh': 1,
|
77
|
+
'Perspective': 1,
|
78
|
+
'PixelFilter': 1,
|
79
|
+
'PixelSamples': 1,
|
80
|
+
'PixelVariance': 1,
|
81
|
+
'Points': 1,
|
82
|
+
'PointsGeneralPolygons': 1,
|
83
|
+
'PointsPolygons': 1,
|
84
|
+
'Polygon': 1,
|
85
|
+
'Procedural': 1,
|
86
|
+
'Projection': 1,
|
87
|
+
'Quantize': 1,
|
88
|
+
'ReadArchive': 1,
|
89
|
+
'RelativeDetail': 1,
|
90
|
+
'ReverseOrientation': 1,
|
91
|
+
'Rotate': 1,
|
92
|
+
'Scale': 1,
|
93
|
+
'ScreenWindow': 1,
|
94
|
+
'ShadingInterpolation': 1,
|
95
|
+
'ShadingRate': 1,
|
96
|
+
'Shutter': 1,
|
97
|
+
'Sides': 1,
|
98
|
+
'Skew': 1,
|
99
|
+
'SolidBegin': 1,
|
100
|
+
'SolidEnd': 1,
|
101
|
+
'Sphere': 1,
|
102
|
+
'SubdivisionMesh': 1,
|
103
|
+
'Surface': 1,
|
104
|
+
'TextureCoordinates': 1,
|
105
|
+
'Torus': 1,
|
106
|
+
'Transform': 1,
|
107
|
+
'TransformBegin': 1,
|
108
|
+
'TransformEnd': 1,
|
109
|
+
'TransformPoints': 1,
|
110
|
+
'Translate': 1,
|
111
|
+
'TrimCurve': 1,
|
112
|
+
'WorldBegin': 1,
|
113
|
+
'WorldEnd': 1
|
114
|
+
}
|
115
|
+
}
|
116
|
+
},
|
117
|
+
modes: [
|
118
|
+
hljs.HASH_COMMENT_MODE,
|
119
|
+
hljs.C_NUMBER_MODE,
|
120
|
+
hljs.APOS_STRING_MODE,
|
121
|
+
hljs.QUOTE_STRING_MODE,
|
122
|
+
hljs.BACKSLASH_ESCAPE
|
123
|
+
]
|
124
|
+
};
|
125
|
+
|
126
|
+
hljs.LANGUAGES.rsl = {
|
127
|
+
defaultMode: {
|
128
|
+
lexems: [hljs.UNDERSCORE_IDENT_RE],
|
129
|
+
illegal: '</',
|
130
|
+
contains: ['comment', 'string', 'number', 'preprocessor',
|
131
|
+
'shader', 'shading'],
|
132
|
+
keywords: {
|
133
|
+
'keyword': {'float': 1, 'color': 1, 'point': 1, 'normal': 1, 'vector': 1,
|
134
|
+
'matrix': 1, 'while': 1, 'for': 1, 'if': 1, 'do': 1,
|
135
|
+
'return': 1, 'else': 1, 'break': 1, 'extern': 1, 'continue': 1},
|
136
|
+
'built_in': {
|
137
|
+
'abs': 1,
|
138
|
+
'acos': 1,
|
139
|
+
'ambient': 1,
|
140
|
+
'area': 1,
|
141
|
+
'asin': 1,
|
142
|
+
'atan': 1,
|
143
|
+
'atmosphere': 1,
|
144
|
+
'attribute': 1,
|
145
|
+
'calculatenormal': 1,
|
146
|
+
'ceil': 1,
|
147
|
+
'cellnoise': 1,
|
148
|
+
'clamp': 1,
|
149
|
+
'comp': 1,
|
150
|
+
'concat': 1,
|
151
|
+
'cos': 1,
|
152
|
+
'degrees': 1,
|
153
|
+
'depth': 1,
|
154
|
+
'Deriv': 1,
|
155
|
+
'diffuse': 1,
|
156
|
+
'distance': 1,
|
157
|
+
'Du': 1,
|
158
|
+
'Dv': 1,
|
159
|
+
'environment': 1,
|
160
|
+
'exp': 1,
|
161
|
+
'faceforward': 1,
|
162
|
+
'filterstep': 1,
|
163
|
+
'floor': 1,
|
164
|
+
'format': 1,
|
165
|
+
'fresnel': 1,
|
166
|
+
'incident': 1,
|
167
|
+
'length': 1,
|
168
|
+
'lightsource': 1,
|
169
|
+
'log': 1,
|
170
|
+
'match': 1,
|
171
|
+
'max': 1,
|
172
|
+
'min': 1,
|
173
|
+
'mod': 1,
|
174
|
+
'noise': 1,
|
175
|
+
'normalize': 1,
|
176
|
+
'ntransform': 1,
|
177
|
+
'opposite': 1,
|
178
|
+
'option': 1,
|
179
|
+
'phong': 1,
|
180
|
+
'pnoise': 1,
|
181
|
+
'pow': 1,
|
182
|
+
'printf': 1,
|
183
|
+
'ptlined': 1,
|
184
|
+
'radians': 1,
|
185
|
+
'random': 1,
|
186
|
+
'reflect': 1,
|
187
|
+
'refract': 1,
|
188
|
+
'renderinfo': 1,
|
189
|
+
'round': 1,
|
190
|
+
'setcomp': 1,
|
191
|
+
'setxcomp': 1,
|
192
|
+
'setycomp': 1,
|
193
|
+
'setzcomp': 1,
|
194
|
+
'shadow': 1,
|
195
|
+
'sign': 1,
|
196
|
+
'sin': 1,
|
197
|
+
'smoothstep': 1,
|
198
|
+
'specular': 1,
|
199
|
+
'specularbrdf': 1,
|
200
|
+
'spline': 1,
|
201
|
+
'sqrt': 1,
|
202
|
+
'step': 1,
|
203
|
+
'tan': 1,
|
204
|
+
'texture': 1,
|
205
|
+
'textureinfo': 1,
|
206
|
+
'trace': 1,
|
207
|
+
'transform': 1,
|
208
|
+
'vtransform': 1,
|
209
|
+
'xcomp': 1,
|
210
|
+
'ycomp': 1,
|
211
|
+
'zcomp': 1
|
212
|
+
}
|
213
|
+
}
|
214
|
+
},
|
215
|
+
modes: [
|
216
|
+
{
|
217
|
+
className: 'shader',
|
218
|
+
begin: 'surface |displacement |light |volume |imager ', end: '\\(',
|
219
|
+
lexems: [hljs.IDENT_RE],
|
220
|
+
keywords: {'surface': 1, 'displacement': 1, 'light': 1, 'volume': 1, 'imager': 1}
|
221
|
+
},
|
222
|
+
{
|
223
|
+
className: 'shading',
|
224
|
+
begin: 'illuminate|illuminance|gather', end: '\\(',
|
225
|
+
lexems: [hljs.IDENT_RE],
|
226
|
+
keywords: {'illuminate': 1, 'illuminance': 1, 'gather': 1}
|
227
|
+
},
|
228
|
+
hljs.C_LINE_COMMENT_MODE,
|
229
|
+
hljs.C_BLOCK_COMMENT_MODE,
|
230
|
+
hljs.C_NUMBER_MODE,
|
231
|
+
hljs.QUOTE_STRING_MODE,
|
232
|
+
hljs.APOS_STRING_MODE,
|
233
|
+
hljs.BACKSLASH_ESCAPE,
|
234
|
+
{
|
235
|
+
className: 'preprocessor',
|
236
|
+
begin: '#', end: '$'
|
237
|
+
}
|
238
|
+
]
|
239
|
+
};
|
@@ -0,0 +1,176 @@
|
|
1
|
+
/*
|
2
|
+
Language: Ruby
|
3
|
+
Author: Anton Kovalyov <anton@kovalyov.net>
|
4
|
+
Contributors: Peter Leonov <gojpeg@yandex.ru>, Vasily Polovnyov <vast@whiteants.net>
|
5
|
+
*/
|
6
|
+
|
7
|
+
hljs.LANGUAGES.ruby = function(){
|
8
|
+
var RUBY_IDENT_RE = '[a-zA-Z_][a-zA-Z0-9_]*(\\!|\\?)?';
|
9
|
+
var RUBY_DEFAULT_CONTAINS = ['comment', 'string', 'char', 'class', 'function', 'module_name', 'symbol', 'number', 'variable', 'regexp_container']
|
10
|
+
var RUBY_KEYWORDS = {
|
11
|
+
'keyword': {'and': 1, 'false': 1, 'then': 1, 'defined': 1, 'module': 1, 'in': 1, 'return': 1, 'redo': 1, 'if': 1, 'BEGIN': 1, 'retry': 1, 'end': 1, 'for': 1, 'true': 1, 'self': 1, 'when': 1, 'next': 1, 'until': 1, 'do': 1, 'begin': 1, 'unless': 1, 'END': 1, 'rescue': 1, 'nil': 1, 'else': 1, 'break': 1, 'undef': 1, 'not': 1, 'super': 1, 'class': 1, 'case': 1, 'require': 1, 'yield': 1, 'alias': 1, 'while': 1, 'ensure': 1, 'elsif': 1, 'or': 1, 'def': 1},
|
12
|
+
'keymethods': {'__id__': 1, '__send__': 1, 'abort': 1, 'abs': 1, 'all?': 1, 'allocate': 1, 'ancestors': 1, 'any?': 1, 'arity': 1, 'assoc': 1, 'at': 1, 'at_exit': 1, 'autoload': 1, 'autoload?': 1, 'between?': 1, 'binding': 1, 'binmode': 1, 'block_given?': 1, 'call': 1, 'callcc': 1, 'caller': 1, 'capitalize': 1, 'capitalize!': 1, 'casecmp': 1, 'catch': 1, 'ceil': 1, 'center': 1, 'chomp': 1, 'chomp!': 1, 'chop': 1, 'chop!': 1, 'chr': 1, 'class': 1, 'class_eval': 1, 'class_variable_defined?': 1, 'class_variables': 1, 'clear': 1, 'clone': 1, 'close': 1, 'close_read': 1, 'close_write': 1, 'closed?': 1, 'coerce': 1, 'collect': 1, 'collect!': 1, 'compact': 1, 'compact!': 1, 'concat': 1, 'const_defined?': 1, 'const_get': 1, 'const_missing': 1, 'const_set': 1, 'constants': 1, 'count': 1, 'crypt': 1, 'default': 1, 'default_proc': 1, 'delete': 1, 'delete!': 1, 'delete_at': 1, 'delete_if': 1, 'detect': 1, 'display': 1, 'div': 1, 'divmod': 1, 'downcase': 1, 'downcase!': 1, 'downto': 1, 'dump': 1, 'dup': 1, 'each': 1, 'each_byte': 1, 'each_index': 1, 'each_key': 1, 'each_line': 1, 'each_pair': 1, 'each_value': 1, 'each_with_index': 1, 'empty?': 1, 'entries': 1, 'eof': 1, 'eof?': 1, 'eql?': 1, 'equal?': 1, 'eval': 1, 'exec': 1, 'exit': 1, 'exit!': 1, 'extend': 1, 'fail': 1, 'fcntl': 1, 'fetch': 1, 'fileno': 1, 'fill': 1, 'find': 1, 'find_all': 1, 'first': 1, 'flatten': 1, 'flatten!': 1, 'floor': 1, 'flush': 1, 'for_fd': 1, 'foreach': 1, 'fork': 1, 'format': 1, 'freeze': 1, 'frozen?': 1, 'fsync': 1, 'getc': 1, 'gets': 1, 'global_variables': 1, 'grep': 1, 'gsub': 1, 'gsub!': 1, 'has_key?': 1, 'has_value?': 1, 'hash': 1, 'hex': 1, 'id': 1, 'include?': 1, 'included_modules': 1, 'index': 1, 'indexes': 1, 'indices': 1, 'induced_from': 1, 'inject': 1, 'insert': 1, 'inspect': 1, 'instance_eval': 1, 'instance_method': 1, 'instance_methods': 1, 'instance_of?': 1, 'instance_variable_defined?': 1, 'instance_variable_get': 1, 'instance_variable_set': 1, 'instance_variables': 1, 'integer?': 1, 'intern': 1, 'invert': 1, 'ioctl': 1, 'is_a?': 1, 'isatty': 1, 'iterator?': 1, 'join': 1, 'key?': 1, 'keys': 1, 'kind_of?': 1, 'lambda': 1, 'last': 1, 'length': 1, 'lineno': 1, 'ljust': 1, 'load': 1, 'local_variables': 1, 'loop': 1, 'lstrip': 1, 'lstrip!': 1, 'map': 1, 'map!': 1, 'match': 1, 'max': 1, 'member?': 1, 'merge': 1, 'merge!': 1, 'method': 1, 'method_defined?': 1, 'method_missing': 1, 'methods': 1, 'min': 1, 'module_eval': 1, 'modulo': 1, 'name': 1, 'nesting': 1, 'new': 1, 'next': 1, 'next!': 1, 'nil?': 1, 'nitems': 1, 'nonzero?': 1, 'object_id': 1, 'oct': 1, 'open': 1, 'pack': 1, 'partition': 1, 'pid': 1, 'pipe': 1, 'pop': 1, 'popen': 1, 'pos': 1, 'prec': 1, 'prec_f': 1, 'prec_i': 1, 'print': 1, 'printf': 1, 'private_class_method': 1, 'private_instance_methods': 1, 'private_method_defined?': 1, 'private_methods': 1, 'proc': 1, 'protected_instance_methods': 1, 'protected_method_defined?': 1, 'protected_methods': 1, 'public_class_method': 1, 'public_instance_methods': 1, 'public_method_defined?': 1, 'public_methods': 1, 'push': 1, 'putc': 1, 'puts': 1, 'quo': 1, 'raise': 1, 'rand': 1, 'rassoc': 1, 'read': 1, 'read_nonblock': 1, 'readchar': 1, 'readline': 1, 'readlines': 1, 'readpartial': 1, 'rehash': 1, 'reject': 1, 'reject!': 1, 'remainder': 1, 'reopen': 1, 'replace': 1, 'require': 1, 'respond_to?': 1, 'reverse': 1, 'reverse!': 1, 'reverse_each': 1, 'rewind': 1, 'rindex': 1, 'rjust': 1, 'round': 1, 'rstrip': 1, 'rstrip!': 1, 'scan': 1, 'seek': 1, 'select': 1, 'send': 1, 'set_trace_func': 1, 'shift': 1, 'singleton_method_added': 1, 'singleton_methods': 1, 'size': 1, 'sleep': 1, 'slice': 1, 'slice!': 1, 'sort': 1, 'sort!': 1, 'sort_by': 1, 'split': 1, 'sprintf': 1, 'squeeze': 1, 'squeeze!': 1, 'srand': 1, 'stat': 1, 'step': 1, 'store': 1, 'strip': 1, 'strip!': 1, 'sub': 1, 'sub!': 1, 'succ': 1, 'succ!': 1, 'sum': 1, 'superclass': 1, 'swapcase': 1, 'swapcase!': 1, 'sync': 1, 'syscall': 1, 'sysopen': 1, 'sysread': 1, 'sysseek': 1, 'system': 1, 'syswrite': 1, 'taint': 1, 'tainted?': 1, 'tell': 1, 'test': 1, 'throw': 1, 'times': 1, 'to_a': 1, 'to_ary': 1, 'to_f': 1, 'to_hash': 1, 'to_i': 1, 'to_int': 1, 'to_io': 1, 'to_proc': 1, 'to_s': 1, 'to_str': 1, 'to_sym': 1, 'tr': 1, 'tr!': 1, 'tr_s': 1, 'tr_s!': 1, 'trace_var': 1, 'transpose': 1, 'trap': 1, 'truncate': 1, 'tty?': 1, 'type': 1, 'ungetc': 1, 'uniq': 1, 'uniq!': 1, 'unpack': 1, 'unshift': 1, 'untaint': 1, 'untrace_var': 1, 'upcase': 1, 'upcase!': 1, 'update': 1, 'upto': 1, 'value?': 1, 'values': 1, 'values_at': 1, 'warn': 1, 'write': 1, 'write_nonblock': 1, 'zero?': 1, 'zip': 1}
|
13
|
+
}
|
14
|
+
return {
|
15
|
+
defaultMode: {
|
16
|
+
lexems: [RUBY_IDENT_RE],
|
17
|
+
contains: RUBY_DEFAULT_CONTAINS,
|
18
|
+
keywords: RUBY_KEYWORDS
|
19
|
+
},
|
20
|
+
modes: [
|
21
|
+
hljs.HASH_COMMENT_MODE,
|
22
|
+
{
|
23
|
+
className: 'comment',
|
24
|
+
begin: '^\\=begin', end: '^\\=end',
|
25
|
+
relevance: 10
|
26
|
+
},
|
27
|
+
{
|
28
|
+
className: 'comment',
|
29
|
+
begin: '^__END__', end: '\\n$'
|
30
|
+
},
|
31
|
+
{
|
32
|
+
className: 'params',
|
33
|
+
begin: '\\(', end: '\\)',
|
34
|
+
lexems: [RUBY_IDENT_RE],
|
35
|
+
keywords: RUBY_KEYWORDS,
|
36
|
+
contains: RUBY_DEFAULT_CONTAINS
|
37
|
+
},
|
38
|
+
{
|
39
|
+
className: 'function',
|
40
|
+
begin: '\\bdef\\b', end: '$|;',
|
41
|
+
lexems: [RUBY_IDENT_RE],
|
42
|
+
keywords: RUBY_KEYWORDS,
|
43
|
+
contains: ['title', 'params', 'comment']
|
44
|
+
},
|
45
|
+
{
|
46
|
+
className: 'class',
|
47
|
+
begin: '\\b(class|module)\\b', end: '$',
|
48
|
+
lexems: [hljs.UNDERSCORE_IDENT_RE],
|
49
|
+
keywords: RUBY_KEYWORDS,
|
50
|
+
contains: ['title', 'inheritance', 'comment'],
|
51
|
+
keywords: {'class': 1, 'module': 1}
|
52
|
+
},
|
53
|
+
{
|
54
|
+
className: 'title',
|
55
|
+
begin: '[A-Za-z_]\\w*(::\\w+)*(\\?|\\!)?', end: '^',
|
56
|
+
relevance: 0
|
57
|
+
},
|
58
|
+
{
|
59
|
+
className: 'inheritance',
|
60
|
+
begin: '<\\s*', end: '^',
|
61
|
+
contains: ['parent']
|
62
|
+
},
|
63
|
+
{
|
64
|
+
className: 'parent',
|
65
|
+
begin: '(' + hljs.IDENT_RE + '::)?' + hljs.IDENT_RE, end: '^'
|
66
|
+
},
|
67
|
+
{
|
68
|
+
className: 'number',
|
69
|
+
begin: '(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b', end: '^',
|
70
|
+
relevance: 0
|
71
|
+
},
|
72
|
+
{
|
73
|
+
className: 'number',
|
74
|
+
begin: '\\?\\w', end: '^'
|
75
|
+
},
|
76
|
+
{
|
77
|
+
className: 'string',
|
78
|
+
begin: '\'', end: '\'',
|
79
|
+
contains: ['escape', 'subst'],
|
80
|
+
relevance: 0
|
81
|
+
},
|
82
|
+
{
|
83
|
+
className: 'string',
|
84
|
+
begin: '"', end: '"',
|
85
|
+
contains: ['escape', 'subst'],
|
86
|
+
relevance: 0
|
87
|
+
},
|
88
|
+
{
|
89
|
+
className: 'string',
|
90
|
+
begin: '%[qw]?\\(', end: '\\)',
|
91
|
+
contains: ['escape', 'subst'],
|
92
|
+
relevance: 10
|
93
|
+
},
|
94
|
+
{
|
95
|
+
className: 'string',
|
96
|
+
begin: '%[qw]?\\[', end: '\\]',
|
97
|
+
contains: ['escape', 'subst'],
|
98
|
+
relevance: 10
|
99
|
+
},
|
100
|
+
{
|
101
|
+
className: 'string',
|
102
|
+
begin: '%[qw]?{', end: '}',
|
103
|
+
contains: ['escape', 'subst'],
|
104
|
+
relevance: 10
|
105
|
+
},
|
106
|
+
{
|
107
|
+
className: 'string',
|
108
|
+
begin: '%[qw]?<', end: '>',
|
109
|
+
contains: ['escape', 'subst'],
|
110
|
+
relevance: 10
|
111
|
+
},
|
112
|
+
{
|
113
|
+
className: 'string',
|
114
|
+
begin: '%[qw]?/', end: '/',
|
115
|
+
contains: ['escape', 'subst'],
|
116
|
+
relevance: 10
|
117
|
+
},
|
118
|
+
{
|
119
|
+
className: 'string',
|
120
|
+
begin: '%[qw]?%', end: '%',
|
121
|
+
contains: ['escape', 'subst'],
|
122
|
+
relevance: 10
|
123
|
+
},
|
124
|
+
{
|
125
|
+
className: 'string',
|
126
|
+
begin: '%[qw]?-', end: '-',
|
127
|
+
contains: ['escape', 'subst'],
|
128
|
+
relevance: 10
|
129
|
+
},
|
130
|
+
{
|
131
|
+
className: 'string',
|
132
|
+
begin: '%[qw]?\\|', end: '\\|',
|
133
|
+
contains: ['escape', 'subst'],
|
134
|
+
relevance: 10
|
135
|
+
},
|
136
|
+
{
|
137
|
+
className: 'module_name',
|
138
|
+
begin: ':{2}' + RUBY_IDENT_RE, end: '^',
|
139
|
+
noMarkup: true
|
140
|
+
},
|
141
|
+
{
|
142
|
+
className: 'symbol',
|
143
|
+
begin: ':' + RUBY_IDENT_RE, end: '^'
|
144
|
+
},
|
145
|
+
{
|
146
|
+
className: 'symbol',
|
147
|
+
begin: ':', end: '^',
|
148
|
+
contains: ['string']
|
149
|
+
},
|
150
|
+
hljs.BACKSLASH_ESCAPE,
|
151
|
+
{
|
152
|
+
className: 'subst',
|
153
|
+
begin: '#\\{', end: '}',
|
154
|
+
lexems: [RUBY_IDENT_RE],
|
155
|
+
keywords: RUBY_KEYWORDS,
|
156
|
+
contains: RUBY_DEFAULT_CONTAINS
|
157
|
+
},
|
158
|
+
{
|
159
|
+
className: 'regexp_container',
|
160
|
+
begin: '(' + hljs.RE_STARTERS_RE + ')\\s*', end: '^', noMarkup: true,
|
161
|
+
contains: ['comment', 'regexp'],
|
162
|
+
relevance: 0
|
163
|
+
},
|
164
|
+
{
|
165
|
+
className: 'regexp',
|
166
|
+
begin: '/', end: '/[a-z]*',
|
167
|
+
illegal: '\\n',
|
168
|
+
contains: ['escape']
|
169
|
+
},
|
170
|
+
{
|
171
|
+
className: 'variable',
|
172
|
+
begin: '(\\$\\W)|((\\$|\\@\\@?)(\\w+))', end: '^'
|
173
|
+
}
|
174
|
+
]
|
175
|
+
};
|
176
|
+
}();
|
@@ -0,0 +1,52 @@
|
|
1
|
+
/*
|
2
|
+
Language: Smalltalk
|
3
|
+
Author: Vladimir Gubarkov <xonixx@gmail.com>
|
4
|
+
*/
|
5
|
+
|
6
|
+
hljs.LANGUAGES.smalltalk = function(){
|
7
|
+
var VAR_IDENT_RE = '[a-z][a-zA-Z0-9_]*';
|
8
|
+
return {
|
9
|
+
defaultMode: {
|
10
|
+
lexems: [hljs.UNDERSCORE_IDENT_RE],
|
11
|
+
contains: ['comment', 'string', 'class', 'method',
|
12
|
+
'number', 'symbol', 'char', 'localvars', 'array'],
|
13
|
+
keywords: {'self': 1, 'super': 1, 'nil': 1, 'true': 1, 'false': 1, 'thisContext': 1} // only 6
|
14
|
+
},
|
15
|
+
modes: [
|
16
|
+
{
|
17
|
+
className: 'class',
|
18
|
+
begin: '\\b[A-Z][A-Za-z0-9_]*', end: '^',
|
19
|
+
relevance: 0
|
20
|
+
},
|
21
|
+
{
|
22
|
+
className: 'symbol',
|
23
|
+
begin: '#' + hljs.UNDERSCORE_IDENT_RE, end: '^'
|
24
|
+
},
|
25
|
+
hljs.C_NUMBER_MODE,
|
26
|
+
hljs.APOS_STRING_MODE,
|
27
|
+
{
|
28
|
+
className: 'comment',
|
29
|
+
begin: '"', end: '"',
|
30
|
+
relevance: 0
|
31
|
+
},
|
32
|
+
{
|
33
|
+
className: 'method',
|
34
|
+
begin: VAR_IDENT_RE + ':', end:'^'
|
35
|
+
},
|
36
|
+
{
|
37
|
+
className: 'char',
|
38
|
+
begin: '\\$.{1}', end: '^'
|
39
|
+
},
|
40
|
+
{
|
41
|
+
className: 'localvars',
|
42
|
+
begin: '\\|\\s*((' + VAR_IDENT_RE + ')\\s*)+\\|', end: '^',
|
43
|
+
relevance: 10
|
44
|
+
},
|
45
|
+
{
|
46
|
+
className: 'array',
|
47
|
+
begin: '\\#\\(', end: '\\)',
|
48
|
+
contains: ['string', 'char', 'number', 'symbol']
|
49
|
+
}
|
50
|
+
]
|
51
|
+
};
|
52
|
+
}();
|
@@ -0,0 +1,52 @@
|
|
1
|
+
/*
|
2
|
+
Language: SQL
|
3
|
+
*/
|
4
|
+
|
5
|
+
hljs.LANGUAGES.sql =
|
6
|
+
{
|
7
|
+
case_insensitive: true,
|
8
|
+
defaultMode:
|
9
|
+
{
|
10
|
+
lexems: [hljs.IDENT_RE],
|
11
|
+
contains: ['string', 'number', 'comment'],
|
12
|
+
keywords: {
|
13
|
+
'keyword': {'all': 1, 'partial': 1, 'global': 1, 'month': 1, 'current_timestamp': 1, 'using': 1, 'go': 1, 'revoke': 1, 'smallint': 1, 'indicator': 1, 'end-exec': 1, 'disconnect': 1, 'zone': 1, 'with': 1, 'character': 1, 'assertion': 1, 'to': 1, 'add': 1, 'current_user': 1, 'usage': 1, 'input': 1, 'local': 1, 'alter': 1, 'match': 1, 'collate': 1, 'real': 1, 'then': 1, 'rollback': 1, 'get': 1, 'read': 1, 'timestamp': 1, 'session_user': 1, 'not': 1, 'integer': 1, 'bit': 1, 'unique': 1, 'day': 1, 'minute': 1, 'desc': 1, 'insert': 1, 'execute': 1, 'like': 1, 'ilike': 2, 'level': 1, 'decimal': 1, 'drop': 1, 'continue': 1, 'isolation': 1, 'found': 1, 'where': 1, 'constraints': 1, 'domain': 1, 'right': 1, 'national': 1, 'some': 1, 'module': 1, 'transaction': 1, 'relative': 1, 'second': 1, 'connect': 1, 'escape': 1, 'close': 1, 'system_user': 1, 'for': 1, 'deferred': 1, 'section': 1, 'cast': 1, 'current': 1, 'sqlstate': 1, 'allocate': 1, 'intersect': 1, 'deallocate': 1, 'numeric': 1, 'public': 1, 'preserve': 1, 'full': 1, 'goto': 1, 'initially': 1, 'asc': 1, 'no': 1, 'key': 1, 'output': 1, 'collation': 1, 'group': 1, 'by': 1, 'union': 1, 'session': 1, 'both': 1, 'last': 1, 'language': 1, 'constraint': 1, 'column': 1, 'of': 1, 'space': 1, 'foreign': 1, 'deferrable': 1, 'prior': 1, 'connection': 1, 'unknown': 1, 'action': 1, 'commit': 1, 'view': 1, 'or': 1, 'first': 1, 'into': 1, 'float': 1, 'year': 1, 'primary': 1, 'cascaded': 1, 'except': 1, 'restrict': 1, 'set': 1, 'references': 1, 'names': 1, 'table': 1, 'outer': 1, 'open': 1, 'select': 1, 'size': 1, 'are': 1, 'rows': 1, 'from': 1, 'prepare': 1, 'distinct': 1, 'leading': 1, 'create': 1, 'only': 1, 'next': 1, 'inner': 1, 'authorization': 1, 'schema': 1, 'corresponding': 1, 'option': 1, 'declare': 1, 'precision': 1, 'immediate': 1, 'else': 1, 'timezone_minute': 1, 'external': 1, 'varying': 1, 'translation': 1, 'true': 1, 'case': 1, 'exception': 1, 'join': 1, 'hour': 1, 'default': 1, 'double': 1, 'scroll': 1, 'value': 1, 'cursor': 1, 'descriptor': 1, 'values': 1, 'dec': 1, 'fetch': 1, 'procedure': 1, 'delete': 1, 'and': 1, 'false': 1, 'int': 1, 'is': 1, 'describe': 1, 'char': 1, 'as': 1, 'at': 1, 'in': 1, 'varchar': 1, 'null': 1, 'trailing': 1, 'any': 1, 'absolute': 1, 'current_time': 1, 'end': 1, 'grant': 1, 'privileges': 1, 'when': 1, 'cross': 1, 'check': 1, 'write': 1, 'current_date': 1, 'pad': 1, 'begin': 1, 'temporary': 1, 'exec': 1, 'time': 1, 'update': 1, 'catalog': 1, 'user': 1, 'sql': 1, 'date': 1, 'on': 1, 'identity': 1, 'timezone_hour': 1, 'natural': 1, 'whenever': 1, 'interval': 1, 'work': 1, 'order': 1, 'cascade': 1, 'diagnostics': 1, 'nchar': 1, 'having': 1, 'left': 1},
|
14
|
+
'aggregate': {'count': 1, 'sum': 1, 'min': 1, 'max': 1, 'avg': 1}
|
15
|
+
}
|
16
|
+
},
|
17
|
+
|
18
|
+
modes: [
|
19
|
+
hljs.C_NUMBER_MODE,
|
20
|
+
hljs.C_BLOCK_COMMENT_MODE,
|
21
|
+
{
|
22
|
+
className: 'comment',
|
23
|
+
begin: '--', end: '$'
|
24
|
+
},
|
25
|
+
{
|
26
|
+
className: 'string',
|
27
|
+
begin: '\'', end: '\'',
|
28
|
+
contains: ['escape', 'squote'],
|
29
|
+
relevance: 0
|
30
|
+
},
|
31
|
+
{
|
32
|
+
className: 'squote',
|
33
|
+
begin: '\'\'', end: '^', noMarkup: true
|
34
|
+
},
|
35
|
+
{
|
36
|
+
className: 'string',
|
37
|
+
begin: '"', end: '"',
|
38
|
+
contains: [ 'escape', 'dquote'],
|
39
|
+
relevance: 0
|
40
|
+
},
|
41
|
+
{
|
42
|
+
className: 'dquote',
|
43
|
+
begin: '""', end: '^', noMarkup: true
|
44
|
+
},
|
45
|
+
{
|
46
|
+
className: 'string',
|
47
|
+
begin: '`', end: '`',
|
48
|
+
contains: ['escape']
|
49
|
+
},
|
50
|
+
hljs.BACKSLASH_ESCAPE
|
51
|
+
]
|
52
|
+
};
|