]>
luflow.net public git repositories - flow-web.git/blob - static/highlight/languages/makefile.js
1 /*! `makefile` grammar compiled for Highlight.js 11.11.1 */
3 var hljsGrammar
= (function () {
8 Author: Ivan Sagalaev <maniac@softwaremaniacs.org>
9 Contributors: Joël Porquet <joel@porquet.org>
10 Website: https://www.gnu.org/software/make/manual/html_node/Introduction.html
11 Category: common, build-system
14 function makefile(hljs
) {
15 /* Variables: simple (eg $(var)) and special (eg $@) */
17 className: 'variable',
20 begin: '\\$\\(' + hljs
.UNDERSCORE_IDENT_RE
+ '\\)',
21 contains: [ hljs
.BACKSLASH_ESCAPE
]
23 { begin: /\$[@%<?\^\+\*]/ }
26 /* Quoted string with variables inside */
27 const QUOTE_STRING
= {
32 hljs
.BACKSLASH_ESCAPE
,
36 /* Function: $(func arg,...) */
38 className: 'variable',
39 begin: /\$\([\w-]+\s/,
42 'subst patsubst strip findstring filter filter-out sort '
43 + 'word wordlist firstword lastword dir notdir suffix basename '
44 + 'addsuffix addprefix join wildcard realpath abspath error warning '
45 + 'shell origin flavor foreach if or and call eval file value' },
48 QUOTE_STRING
// Added QUOTE_STRING as they can be a part of functions
51 /* Variable assignment */
52 const ASSIGNMENT
= { begin: '^' + hljs
.UNDERSCORE_IDENT_RE
+ '\\s*(?=[:+?]?=)' };
53 /* Meta targets (.PHONY) */
68 contains: [ VARIABLE
]
79 keyword: 'define endef undefine ifdef ifndef ifeq ifneq else endif '
80 + 'include -include sinclude override export unexport private vpath'
83 hljs
.HASH_COMMENT_MODE
,
98 hljs
.registerLanguage('makefile', hljsGrammar
);