Skip to content

Commit 4868635

Browse files
committed
C: Used property as an alias for macro statements + added support for \r in macros
1 parent dcce1a7 commit 4868635

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

components/prism-c.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ Prism.languages.c = Prism.languages.extend('clike', {
44
});
55

66
Prism.languages.insertBefore('c', 'string', {
7-
// property class reused for macro statements
8-
'property': {
7+
'macro': {
98
// allow for multiline macro definitions
109
// spaces after the # character compile fine with gcc
11-
pattern: /((^|\n)\s*)#\s*[a-z]+([^\n\\]|\\.|\\\r*\n)*/i,
10+
pattern: /(^\s*)#\s*[a-z]+([^\r\n\\]|\\.|\\(?:\r\n?|\n))*/im,
1211
lookbehind: true,
12+
alias: 'property',
1313
inside: {
1414
// highlight the path of the include statement as a string
1515
'string': {

components/prism-c.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)