1
0
Fork 0
management/front/dkha-web-sz-main/node_modules/highlight.js/lib/languages/step21.js

67 lines
1.4 KiB
JavaScript
Raw Normal View History

2024-01-16 21:26:16 +08:00
/*
Language: STEP Part 21
Contributors: Adam Joseph Cook <adam.joseph.cook@gmail.com>
Description: Syntax highlighter for STEP Part 21 files (ISO 10303-21).
Website: https://en.wikipedia.org/wiki/ISO_10303-21
*/
function step21(hljs) {
const STEP21_IDENT_RE = '[A-Z_][A-Z0-9_.]*';
const STEP21_KEYWORDS = {
$pattern: STEP21_IDENT_RE,
2023-12-18 13:12:25 +08:00
keyword: 'HEADER ENDSEC DATA'
};
2024-01-16 21:26:16 +08:00
const STEP21_START = {
2023-12-18 13:12:25 +08:00
className: 'meta',
begin: 'ISO-10303-21;',
relevance: 10
};
2024-01-16 21:26:16 +08:00
const STEP21_CLOSE = {
2023-12-18 13:12:25 +08:00
className: 'meta',
begin: 'END-ISO-10303-21;',
relevance: 10
};
return {
2024-01-16 21:26:16 +08:00
name: 'STEP Part 21',
aliases: [
'p21',
'step',
'stp'
],
2023-12-18 13:12:25 +08:00
case_insensitive: true, // STEP 21 is case insensitive in theory, in practice all non-comments are capitalized.
keywords: STEP21_KEYWORDS,
contains: [
STEP21_START,
STEP21_CLOSE,
hljs.C_LINE_COMMENT_MODE,
hljs.C_BLOCK_COMMENT_MODE,
hljs.COMMENT('/\\*\\*!', '\\*/'),
hljs.C_NUMBER_MODE,
2024-01-16 21:26:16 +08:00
hljs.inherit(hljs.APOS_STRING_MODE, {
illegal: null
}),
hljs.inherit(hljs.QUOTE_STRING_MODE, {
illegal: null
}),
2023-12-18 13:12:25 +08:00
{
className: 'string',
2024-01-16 21:26:16 +08:00
begin: "'",
end: "'"
2023-12-18 13:12:25 +08:00
},
{
className: 'symbol',
variants: [
{
2024-01-16 21:26:16 +08:00
begin: '#',
end: '\\d+',
2023-12-18 13:12:25 +08:00
illegal: '\\W'
}
]
}
]
};
2024-01-16 21:26:16 +08:00
}
module.exports = step21;