]> luflow.net public git repositories - flow-web.git/blob - static/highlight/languages/step21.js
Initial commit.
[flow-web.git] / static / highlight / languages / step21.js
1 /*! `step21` grammar compiled for Highlight.js 11.11.1 */
2 (function(){
3 var hljsGrammar = (function () {
4 'use strict';
5
6 /*
7 Language: STEP Part 21
8 Contributors: Adam Joseph Cook <adam.joseph.cook@gmail.com>
9 Description: Syntax highlighter for STEP Part 21 files (ISO 10303-21).
10 Website: https://en.wikipedia.org/wiki/ISO_10303-21
11 Category: syntax
12 */
13
14 function step21(hljs) {
15 const STEP21_IDENT_RE = '[A-Z_][A-Z0-9_.]*';
16 const STEP21_KEYWORDS = {
17 $pattern: STEP21_IDENT_RE,
18 keyword: [
19 "HEADER",
20 "ENDSEC",
21 "DATA"
22 ]
23 };
24 const STEP21_START = {
25 className: 'meta',
26 begin: 'ISO-10303-21;',
27 relevance: 10
28 };
29 const STEP21_CLOSE = {
30 className: 'meta',
31 begin: 'END-ISO-10303-21;',
32 relevance: 10
33 };
34
35 return {
36 name: 'STEP Part 21',
37 aliases: [
38 'p21',
39 'step',
40 'stp'
41 ],
42 case_insensitive: true, // STEP 21 is case insensitive in theory, in practice all non-comments are capitalized.
43 keywords: STEP21_KEYWORDS,
44 contains: [
45 STEP21_START,
46 STEP21_CLOSE,
47 hljs.C_LINE_COMMENT_MODE,
48 hljs.C_BLOCK_COMMENT_MODE,
49 hljs.COMMENT('/\\*\\*!', '\\*/'),
50 hljs.C_NUMBER_MODE,
51 hljs.inherit(hljs.APOS_STRING_MODE, { illegal: null }),
52 hljs.inherit(hljs.QUOTE_STRING_MODE, { illegal: null }),
53 {
54 className: 'string',
55 begin: "'",
56 end: "'"
57 },
58 {
59 className: 'symbol',
60 variants: [
61 {
62 begin: '#',
63 end: '\\d+',
64 illegal: '\\W'
65 }
66 ]
67 }
68 ]
69 };
70 }
71
72 return step21;
73
74 })();
75
76 hljs.registerLanguage('step21', hljsGrammar);
77 })();