UNPKG

1.03 kBJavaScriptView Raw
1Prism.languages.makefile = {
2 'comment': {
3 pattern: /(^|[^\\])#(?:\\(?:\r\n|[\s\S])|[^\\\r\n])*/,
4 lookbehind: true
5 },
6 'string': {
7 pattern: /(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,
8 greedy: true
9 },
10
11 // Built-in target names
12 'builtin': /\.[A-Z][^:#=\s]+(?=\s*:(?!=))/,
13
14 // Targets
15 'symbol': {
16 pattern: /^[^:=\r\n]+(?=\s*:(?!=))/m,
17 inside: {
18 'variable': /\$+(?:[^(){}:#=\s]+|(?=[({]))/
19 }
20 },
21 'variable': /\$+(?:[^(){}:#=\s]+|\([@*%<^+?][DF]\)|(?=[({]))/,
22
23 'keyword': [
24 // Directives
25 /-include\b|\b(?:define|else|endef|endif|export|ifn?def|ifn?eq|include|override|private|sinclude|undefine|unexport|vpath)\b/,
26 // Functions
27 {
28 pattern: /(\()(?:addsuffix|abspath|and|basename|call|dir|error|eval|file|filter(?:-out)?|findstring|firstword|flavor|foreach|guile|if|info|join|lastword|load|notdir|or|origin|patsubst|realpath|shell|sort|strip|subst|suffix|value|warning|wildcard|word(?:s|list)?)(?=[ \t])/,
29 lookbehind: true
30 }
31 ],
32 'operator': /(?:::|[?:+!])?=|[|@]/,
33 'punctuation': /[:;(){}]/
34};
\No newline at end of file