diff --git a/assets/javascripts/vendor/prism.js b/assets/javascripts/vendor/prism.js index 0b960dcb..e92be7ff 100644 --- a/assets/javascripts/vendor/prism.js +++ b/assets/javascripts/vendor/prism.js @@ -494,6 +494,26 @@ Prism.languages.insertBefore('coffeescript', 'keyword', { 'attr-name': /[_?a-z-|A-Z-]+(\s*:)| @[_?$?a-z-|A-Z-]+(\s*)| /g }); ; +Prism.languages.c = Prism.languages.extend('clike', { + 'keyword': /\b(asm|typeof|inline|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|union|unsigned|void|volatile|while)\b/g, + 'operator': /[-+]{1,2}|!=?|<{1,2}=?|>{1,2}=?|\->|={1,2}|\^|~|%|(&){1,2}|\|?\||\?|\*|\//g +}); + +Prism.languages.insertBefore('c', 'keyword', { + //property class reused for macro statements + 'property': { + pattern:/#[a-zA-Z]+\ .*/g, + inside: { + property: /<[a-zA-Z.]+>/g + } + } +}); +; +Prism.languages.cpp = Prism.languages.extend('c', { + 'keyword': /\b(alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|class|compl|const|constexpr|const_cast|continue|decltype|default|delete|delete\[\]|do|double|dynamic_cast|else|enum|explicit|export|extern|float|for|friend|goto|if|inline|int|long|mutable|namespace|new|new\[\]|noexcept|nullptr|operator|private|protected|public|register|reinterpret_cast|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/g, + 'operator': /[-+]{1,2}|!=?|<{1,2}=?|>{1,2}=?|\->|:{1,2}|={1,2}|\^|~|%|(&){1,2}|\|?\||\?|\*|\/|\b(and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/g +}); +; Prism.languages.python= { 'comment': { pattern: /(^|[^\\])#.*?(\r?\n|$)/g,