source: node_modules/highlight.js/lib/languages/step21.js

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

Initial commit

  • Property mode set to 100644
File size: 1.4 KB
Line 
1/*
2Language: STEP Part 21
3Contributors: Adam Joseph Cook <adam.joseph.cook@gmail.com>
4Description: Syntax highlighter for STEP Part 21 files (ISO 10303-21).
5Website: https://en.wikipedia.org/wiki/ISO_10303-21
6*/
7
8function step21(hljs) {
9 const STEP21_IDENT_RE = '[A-Z_][A-Z0-9_.]*';
10 const STEP21_KEYWORDS = {
11 $pattern: STEP21_IDENT_RE,
12 keyword: 'HEADER ENDSEC DATA'
13 };
14 const STEP21_START = {
15 className: 'meta',
16 begin: 'ISO-10303-21;',
17 relevance: 10
18 };
19 const STEP21_CLOSE = {
20 className: 'meta',
21 begin: 'END-ISO-10303-21;',
22 relevance: 10
23 };
24
25 return {
26 name: 'STEP Part 21',
27 aliases: [
28 'p21',
29 'step',
30 'stp'
31 ],
32 case_insensitive: true, // STEP 21 is case insensitive in theory, in practice all non-comments are capitalized.
33 keywords: STEP21_KEYWORDS,
34 contains: [
35 STEP21_START,
36 STEP21_CLOSE,
37 hljs.C_LINE_COMMENT_MODE,
38 hljs.C_BLOCK_COMMENT_MODE,
39 hljs.COMMENT('/\\*\\*!', '\\*/'),
40 hljs.C_NUMBER_MODE,
41 hljs.inherit(hljs.APOS_STRING_MODE, {
42 illegal: null
43 }),
44 hljs.inherit(hljs.QUOTE_STRING_MODE, {
45 illegal: null
46 }),
47 {
48 className: 'string',
49 begin: "'",
50 end: "'"
51 },
52 {
53 className: 'symbol',
54 variants: [
55 {
56 begin: '#',
57 end: '\\d+',
58 illegal: '\\W'
59 }
60 ]
61 }
62 ]
63 };
64}
65
66module.exports = step21;
Note: See TracBrowser for help on using the repository browser.