Files
cloud-code/claude-code-source/node_modules/.ignored/highlight.js/lib/languages/properties.js
janlaywss 6187147b74 reconstruct and build @anthropic-ai/claude-code source from source map
- Extract 4756 source files from cli.js.map (57MB)
- Set up Bun build system with bun:bundle feature flag shim
- Configure 90+ compile-time feature flags matching production defaults
- Inject MACRO constants (VERSION, BUILD_TIME, etc.)
- Create stubs for private packages (color-diff-napi, modifiers-napi, etc.)
- Install all public dependencies via pnpm
- Patch commander v14 to allow multi-char short flags (-d2e)
- Build output: dist/cli.js (22MB), verified working
2026-03-31 19:19:50 +08:00

86 lines
2.1 KiB
JavaScript

/*
Language: .properties
Contributors: Valentin Aitken <valentin@nalisbg.com>, Egor Rogov <e.rogov@postgrespro.ru>
Website: https://en.wikipedia.org/wiki/.properties
Category: common, config
*/
function properties(hljs) {
// whitespaces: space, tab, formfeed
var WS0 = '[ \\t\\f]*';
var WS1 = '[ \\t\\f]+';
// delimiter
var EQUAL_DELIM = WS0+'[:=]'+WS0;
var WS_DELIM = WS1;
var DELIM = '(' + EQUAL_DELIM + '|' + WS_DELIM + ')';
var KEY_ALPHANUM = '([^\\\\\\W:= \\t\\f\\n]|\\\\.)+';
var KEY_OTHER = '([^\\\\:= \\t\\f\\n]|\\\\.)+';
var DELIM_AND_VALUE = {
// skip DELIM
end: DELIM,
relevance: 0,
starts: {
// value: everything until end of line (again, taking into account backslashes)
className: 'string',
end: /$/,
relevance: 0,
contains: [
{ begin: '\\\\\\\\'},
{ begin: '\\\\\\n' }
]
}
};
return {
name: '.properties',
case_insensitive: true,
illegal: /\S/,
contains: [
hljs.COMMENT('^\\s*[!#]', '$'),
// key: everything until whitespace or = or : (taking into account backslashes)
// case of a "normal" key
{
returnBegin: true,
variants: [
{ begin: KEY_ALPHANUM + EQUAL_DELIM, relevance: 1 },
{ begin: KEY_ALPHANUM + WS_DELIM, relevance: 0 }
],
contains: [
{
className: 'attr',
begin: KEY_ALPHANUM,
endsParent: true,
relevance: 0
}
],
starts: DELIM_AND_VALUE
},
// case of key containing non-alphanumeric chars => relevance = 0
{
begin: KEY_OTHER + DELIM,
returnBegin: true,
relevance: 0,
contains: [
{
className: 'meta',
begin: KEY_OTHER,
endsParent: true,
relevance: 0
}
],
starts: DELIM_AND_VALUE
},
// case of an empty key
{
className: 'attr',
relevance: 0,
begin: KEY_OTHER + WS0 + '$'
}
]
};
}
module.exports = properties;