|
|
|
@ -13,15 +13,15 @@
|
|
|
|
* Category: scripting
|
|
|
|
* Category: scripting
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
import type { HLJSApi } from "highlight.js";
|
|
|
|
import type { HLJSApi, Language, Mode } from "highlight.js";
|
|
|
|
|
|
|
|
|
|
|
|
export default function hljsDefineTerraform(hljs: HLJSApi) {
|
|
|
|
export default function hljsDefineTerraform(hljs: HLJSApi): Language {
|
|
|
|
var NUMBERS = {
|
|
|
|
const NUMBERS: Mode = {
|
|
|
|
className: 'number',
|
|
|
|
className: 'number',
|
|
|
|
begin: '\\b\\d+(\\.\\d+)?',
|
|
|
|
begin: '\\b\\d+(\\.\\d+)?',
|
|
|
|
relevance: 0
|
|
|
|
relevance: 0
|
|
|
|
};
|
|
|
|
};
|
|
|
|
var STRINGS = {
|
|
|
|
const STRINGS: Mode = {
|
|
|
|
className: 'string',
|
|
|
|
className: 'string',
|
|
|
|
begin: '"',
|
|
|
|
begin: '"',
|
|
|
|
end: '"',
|
|
|
|
end: '"',
|
|
|
|
@ -63,15 +63,30 @@ export default function hljsDefineTerraform(hljs: HLJSApi) {
|
|
|
|
}]
|
|
|
|
}]
|
|
|
|
}]
|
|
|
|
}]
|
|
|
|
},
|
|
|
|
},
|
|
|
|
'self']
|
|
|
|
'self' as const]
|
|
|
|
}]
|
|
|
|
}]
|
|
|
|
}]
|
|
|
|
}]
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
aliases: ['tf', 'hcl'],
|
|
|
|
aliases: ['tf', 'hcl'],
|
|
|
|
keywords: 'resource variable provider output locals module data terraform|10',
|
|
|
|
keywords: {
|
|
|
|
literal: 'false true null',
|
|
|
|
keyword: [
|
|
|
|
|
|
|
|
"resource",
|
|
|
|
|
|
|
|
"variable",
|
|
|
|
|
|
|
|
"provider",
|
|
|
|
|
|
|
|
"output",
|
|
|
|
|
|
|
|
"locals",
|
|
|
|
|
|
|
|
"module",
|
|
|
|
|
|
|
|
"data",
|
|
|
|
|
|
|
|
"terraform|10"
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
literal: [
|
|
|
|
|
|
|
|
"false",
|
|
|
|
|
|
|
|
"true",
|
|
|
|
|
|
|
|
"null"
|
|
|
|
|
|
|
|
]
|
|
|
|
|
|
|
|
},
|
|
|
|
contains: [
|
|
|
|
contains: [
|
|
|
|
hljs.COMMENT('\\#', '$'),
|
|
|
|
hljs.COMMENT('\\#', '$'),
|
|
|
|
NUMBERS,
|
|
|
|
NUMBERS,
|
|
|
|
|