0
This repository has been archived on 2024-08-27. You can view files and clone it, but cannot push or open issues or pull requests.
highlight_js-rails/vendor/assets/javascripts/highlight_js/languages/smalltalk.js
Rogaboru Kujimoshi a52831ccdb Update to 8.0
2014-06-08 21:04:39 +04:00

61 lines
1.4 KiB
JavaScript

/*
Language: Smalltalk
Author: Vladimir Gubarkov <xonixx@gmail.com>
*/
function(hljs) {
var VAR_IDENT_RE = '[a-z][a-zA-Z0-9_]*';
var CHAR = {
className: 'char',
begin: '\\$.{1}'
};
var SYMBOL = {
className: 'symbol',
begin: '#' + hljs.UNDERSCORE_IDENT_RE
};
return {
aliases: ['st'],
keywords: 'self super nil true false thisContext', // only 6
contains: [
{
className: 'comment',
begin: '"', end: '"'
},
hljs.APOS_STRING_MODE,
{
className: 'class',
begin: '\\b[A-Z][A-Za-z0-9_]*',
relevance: 0
},
{
className: 'method',
begin: VAR_IDENT_RE + ':',
relevance: 0
},
hljs.C_NUMBER_MODE,
SYMBOL,
CHAR,
{
className: 'localvars',
// This looks more complicated than needed to avoid combinatorial
// explosion under V8. It effectively means `| var1 var2 ... |` with
// whitespace adjacent to `|` being optional.
begin: '\\|[ ]*' + VAR_IDENT_RE + '([ ]+' + VAR_IDENT_RE + ')*[ ]*\\|',
returnBegin: true, end: /\|/,
illegal: /\S/,
contains: [{begin: '(\\|[ ]*)?' + VAR_IDENT_RE}]
},
{
className: 'array',
begin: '\\#\\(', end: '\\)',
contains: [
hljs.APOS_STRING_MODE,
CHAR,
hljs.C_NUMBER_MODE,
SYMBOL
]
}
]
};
}