source: node_modules/highlight.js/lib/languages/xl.js@ d24f17c

main
Last change on this file since d24f17c was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago

Initial commit

  • Property mode set to 100644
File size: 2.6 KB
RevLine 
[d24f17c]1/*
2Language: XL
3Author: Christophe de Dinechin <christophe@taodyne.com>
4Description: An extensible programming language, based on parse tree rewriting
5Website: http://xlr.sf.net
6*/
7
8function xl(hljs) {
9 const BUILTIN_MODULES =
10 'ObjectLoader Animate MovieCredits Slides Filters Shading Materials LensFlare Mapping VLCAudioVideo ' +
11 'StereoDecoder PointCloud NetworkAccess RemoteControl RegExp ChromaKey Snowfall NodeJS Speech Charts';
12
13 const XL_KEYWORDS = {
14 $pattern: /[a-zA-Z][a-zA-Z0-9_?]*/,
15 keyword:
16 'if then else do while until for loop import with is as where when by data constant ' +
17 'integer real text name boolean symbol infix prefix postfix block tree',
18 literal:
19 'true false nil',
20 built_in:
21 'in mod rem and or xor not abs sign floor ceil sqrt sin cos tan asin ' +
22 'acos atan exp expm1 log log2 log10 log1p pi at text_length text_range ' +
23 'text_find text_replace contains page slide basic_slide title_slide ' +
24 'title subtitle fade_in fade_out fade_at clear_color color line_color ' +
25 'line_width texture_wrap texture_transform texture scale_?x scale_?y ' +
26 'scale_?z? translate_?x translate_?y translate_?z? rotate_?x rotate_?y ' +
27 'rotate_?z? rectangle circle ellipse sphere path line_to move_to ' +
28 'quad_to curve_to theme background contents locally time mouse_?x ' +
29 'mouse_?y mouse_buttons ' +
30 BUILTIN_MODULES
31 };
32
33 const DOUBLE_QUOTE_TEXT = {
34 className: 'string',
35 begin: '"',
36 end: '"',
37 illegal: '\\n'
38 };
39 const SINGLE_QUOTE_TEXT = {
40 className: 'string',
41 begin: '\'',
42 end: '\'',
43 illegal: '\\n'
44 };
45 const LONG_TEXT = {
46 className: 'string',
47 begin: '<<',
48 end: '>>'
49 };
50 const BASED_NUMBER = {
51 className: 'number',
52 begin: '[0-9]+#[0-9A-Z_]+(\\.[0-9-A-Z_]+)?#?([Ee][+-]?[0-9]+)?'
53 };
54 const IMPORT = {
55 beginKeywords: 'import',
56 end: '$',
57 keywords: XL_KEYWORDS,
58 contains: [ DOUBLE_QUOTE_TEXT ]
59 };
60 const FUNCTION_DEFINITION = {
61 className: 'function',
62 begin: /[a-z][^\n]*->/,
63 returnBegin: true,
64 end: /->/,
65 contains: [
66 hljs.inherit(hljs.TITLE_MODE, {
67 starts: {
68 endsWithParent: true,
69 keywords: XL_KEYWORDS
70 }
71 })
72 ]
73 };
74 return {
75 name: 'XL',
76 aliases: [ 'tao' ],
77 keywords: XL_KEYWORDS,
78 contains: [
79 hljs.C_LINE_COMMENT_MODE,
80 hljs.C_BLOCK_COMMENT_MODE,
81 DOUBLE_QUOTE_TEXT,
82 SINGLE_QUOTE_TEXT,
83 LONG_TEXT,
84 FUNCTION_DEFINITION,
85 IMPORT,
86 BASED_NUMBER,
87 hljs.NUMBER_MODE
88 ]
89 };
90}
91
92module.exports = xl;
Note: See TracBrowser for help on using the repository browser.