summaryrefslogtreecommitdiffstats
path: root/syntax
diff options
context:
space:
mode:
authorAdam Stankiewicz <sheerun@sher.pl>2013-10-07 11:07:27 +0200
committerAdam Stankiewicz <sheerun@sher.pl>2013-10-07 11:07:27 +0200
commite108a087b4a5a3acb55786643e5289a64c8b0c60 (patch)
treef0be0885c7076f64373a127acfd97e9bce6b70a2 /syntax
parentb3257271dbd3075507db3e8ad2e76571901c969d (diff)
downloadvim-polyglot-e108a087b4a5a3acb55786643e5289a64c8b0c60.tar.gz
vim-polyglot-e108a087b4a5a3acb55786643e5289a64c8b0c60.zip
Update latex, html, ruby, c, cpp
Diffstat (limited to 'syntax')
-rw-r--r--syntax/c.vim16
-rw-r--r--syntax/cpp.vim5
2 files changed, 15 insertions, 6 deletions
diff --git a/syntax/c.vim b/syntax/c.vim
index 6a62fe37..7a58ae71 100644
--- a/syntax/c.vim
+++ b/syntax/c.vim
@@ -1,7 +1,7 @@
" Vim syntax file
" Language: C
" Maintainer: Bram Moolenaar <Bram@vim.org>
-" Last Change: 2013 Jun 06
+" Last Change: 2013 Jul 05
" Quit when a (custom) syntax file was already loaded
if exists("b:current_syntax")
@@ -11,6 +11,8 @@ endif
let s:cpo_save = &cpo
set cpo&vim
+let s:ft = matchstr(&ft, '^\([^.]\)\+')
+
" A bunch of useful C keywords
syn keyword cStatement goto break return continue asm
syn keyword cLabel case default
@@ -110,7 +112,7 @@ endif
" But avoid matching <::.
syn cluster cParenGroup contains=cParenError,cIncluded,cSpecial,cCommentSkip,cCommentString,cComment2String,@cCommentGroup,cCommentStartError,cUserLabel,cBitField,cOctalZero,@cCppOutInGroup,cFormat,cNumber,cFloat,cOctal,cOctalError,cNumbersCom
if exists("c_no_curly_error")
- if &filetype ==# 'cpp' && !exists("cpp_no_cpp11")
+ if s:ft ==# 'cpp' && !exists("cpp_no_cpp11")
syn region cParen transparent start='(' end=')' contains=ALLBUT,@cParenGroup,cCppParen,cCppString,@Spell
" cCppParen: same as cParen but ends at end-of-line; used in cDefine
syn region cCppParen transparent start='(' skip='\\$' excludenl end=')' end='$' contained contains=ALLBUT,@cParenGroup,cParen,cString,@Spell
@@ -124,7 +126,7 @@ if exists("c_no_curly_error")
syn match cErrInParen display contained "^[{}]\|^<%\|^%>"
endif
elseif exists("c_no_bracket_error")
- if &filetype ==# 'cpp' && !exists("cpp_no_cpp11")
+ if s:ft ==# 'cpp' && !exists("cpp_no_cpp11")
syn region cParen transparent start='(' end=')' contains=ALLBUT,@cParenGroup,cCppParen,cCppString,@Spell
" cCppParen: same as cParen but ends at end-of-line; used in cDefine
syn region cCppParen transparent start='(' skip='\\$' excludenl end=')' end='$' contained contains=ALLBUT,@cParenGroup,cParen,cString,@Spell
@@ -138,7 +140,7 @@ elseif exists("c_no_bracket_error")
syn match cErrInParen display contained "[{}]\|<%\|%>"
endif
else
- if &filetype ==# 'cpp' && !exists("cpp_no_cpp11")
+ if s:ft ==# 'cpp' && !exists("cpp_no_cpp11")
syn region cParen transparent start='(' end=')' contains=ALLBUT,@cParenGroup,cCppParen,cErrInBracket,cCppBracket,cCppString,@Spell
" cCppParen: same as cParen but ends at end-of-line; used in cDefine
syn region cCppParen transparent start='(' skip='\\$' excludenl end=')' end='$' contained contains=ALLBUT,@cParenGroup,cErrInBracket,cParen,cBracket,cString,@Spell
@@ -158,7 +160,7 @@ else
syn match cErrInBracket display contained "[);{}]\|<%\|%>"
endif
-if &filetype ==# 'c' || exists("cpp_no_cpp11")
+if s:ft ==# 'c' || exists("cpp_no_cpp11")
syn region cBadBlock keepend start="{" end="}" contained containedin=cParen,cBracket,cBadBlock transparent fold
endif
@@ -370,7 +372,7 @@ syn region cPreProc start="^\s*\(%:\|#\)\s*\(pragma\>\|line\>\|warning\>\|warn\>
" Highlight User Labels
syn cluster cMultiGroup contains=cIncluded,cSpecial,cCommentSkip,cCommentString,cComment2String,@cCommentGroup,cCommentStartError,cUserCont,cUserLabel,cBitField,cOctalZero,cCppOutWrapper,cCppInWrapper,@cCppOutInGroup,cFormat,cNumber,cFloat,cOctal,cOctalError,cNumbersCom,cCppParen,cCppBracket,cCppString
-if &filetype ==# 'c' || exists("cpp_no_cpp11")
+if s:ft ==# 'c' || exists("cpp_no_cpp11")
syn region cMulti transparent start='?' skip='::' end=':' contains=ALLBUT,@cMultiGroup,@Spell
endif
" Avoid matching foo::bar() in C++ by requiring that the next char is not ':'
@@ -457,6 +459,8 @@ hi def link cCppOut Comment
let b:current_syntax = "c"
+unlet s:ft
+
let &cpo = s:cpo_save
unlet s:cpo_save
" vim: ts=8
diff --git a/syntax/cpp.vim b/syntax/cpp.vim
index ec95020e..f999fe7f 100644
--- a/syntax/cpp.vim
+++ b/syntax/cpp.vim
@@ -39,6 +39,9 @@ if !exists("cpp_no_cpp11")
syn keyword cppExceptions noexcept
syn keyword cppStorageClass constexpr decltype
syn keyword cppConstant nullptr
+ " A C++11 raw-string literal. It tries to follow 2.14.5 and 2.14.5.2 of the
+ " standard.
+ syn region cppRawString matchgroup=cppRawDelim start=+\%(u8\=\|[LU]\)\=R"\z(\%([ ()\\\d9-\d12]\@![\d0-\d127]\)\{,16}\)(+ end=+)\z1"+ contains=@Spell
endif
" The minimum and maximum operators in GNU C++
@@ -62,6 +65,8 @@ if version >= 508 || !exists("did_cpp_syntax_inits")
HiLink cppStructure Structure
HiLink cppBoolean Boolean
HiLink cppConstant Constant
+ HiLink cppRawDelim cFormat
+ HiLink cppRawString String
delcommand HiLink
endif