]>
luflow.net public git repositories - flow-web.git/blob - static/highlight/languages/smalltalk.js
1 /*! `smalltalk` grammar compiled for Highlight.js 11.11.1 */
3 var hljsGrammar
= (function () {
8 Description: Smalltalk is an object-oriented, dynamically typed reflective programming language.
9 Author: Vladimir Gubarkov <xonixx@gmail.com>
10 Website: https://en.wikipedia.org/wiki/Smalltalk
14 function smalltalk(hljs
) {
15 const VAR_IDENT_RE
= '[a-z][a-zA-Z0-9_]*';
22 begin: '#' + hljs
.UNDERSCORE_IDENT_RE
36 hljs
.COMMENT('"', '"'),
37 hljs
.APOS_STRING_MODE
,
40 begin: '\\b[A-Z][A-Za-z0-9_]*',
44 begin: VAR_IDENT_RE
+ ':',
51 // This looks more complicated than needed to avoid combinatorial
52 // explosion under V8. It effectively means `| var1 var2 ... |` with
53 // whitespace adjacent to `|` being optional.
54 begin: '\\|[ ]*' + VAR_IDENT_RE
+ '([ ]+' + VAR_IDENT_RE
+ ')*[ ]*\\|',
58 contains: [ { begin: '(\\|[ ]*)?' + VAR_IDENT_RE
} ]
64 hljs
.APOS_STRING_MODE
,
78 hljs
.registerLanguage('smalltalk', hljsGrammar
);