Skip to content

Commit

Permalink
C: Used property as an alias for macro statements + added support for…
Browse files Browse the repository at this point in the history
… \r in macros
  • Loading branch information
Golmote committed Jul 12, 2015
1 parent dcce1a7 commit 4868635
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions components/prism-c.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ Prism.languages.c = Prism.languages.extend('clike', {
});

Prism.languages.insertBefore('c', 'string', {
// property class reused for macro statements
'property': {
'macro': {
// allow for multiline macro definitions
// spaces after the # character compile fine with gcc
pattern: /((^|\n)\s*)#\s*[a-z]+([^\n\\]|\\.|\\\r*\n)*/i,
pattern: /(^\s*)#\s*[a-z]+([^\r\n\\]|\\.|\\(?:\r\n?|\n))*/im,
lookbehind: true,
alias: 'property',
inside: {
// highlight the path of the include statement as a string
'string': {
Expand Down
2 changes: 1 addition & 1 deletion components/prism-c.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 4868635

Please sign in to comment.