[svn merge][r426] Updated C++ syntax highlighting to terminate strings at newline characters.

Also fixed a bug that prevented the '--no-rcfile' and '--rcfile' command line
options from being used with other options.
This commit is contained in:
Romain Failliot 2016-07-08 23:19:12 -04:00
parent 2aecb941d7
commit 4d54a00041
2 changed files with 8 additions and 9 deletions

View File

@ -154,7 +154,6 @@ whitespace = ' \t\n\r\x0b\x0c'
# escape special glob characters
def globEscape(s):
print 'globEscape', repr(s)
m = dict([ (c, u'[%s]' % (c, )) for c in u'[]?*' ])
return u''.join([ m.get(c, c) for c in s ])
@ -8364,9 +8363,9 @@ if __name__ == '__main__':
data_dir = make_subdirs(data_dir, subdirs)
# load resource files
i, rc_files = 1, []
if argc == 2 and args[1] == '--no-rcfile':
if i < argc and args[i] == '--no-rcfile':
i += 1
elif argc == 3 and args[1] == '--rcfile':
elif i + 1 < argc and args[i] == '--rcfile':
i += 1
rc_files.append(args[i])
i += 1

View File

@ -47,15 +47,15 @@ syntax_pattern cpp cpp c++_cpp '.[^\\/\r\n]*'
# char
syntax_pattern normal char c++_string "[uUL]?'"
syntax_pattern char normal c++_string "'"
syntax_pattern char char c++_escapedchar '(\\([0-7]{1,3}|x[0-9a-fA-F]{1,2}|u[0-9a-fA-F]{4}|U[0-9a-fA-F]{8}|.))+'
syntax_pattern char char c++_string ".[^\\\\']*"
syntax_pattern char normal c++_string "['\\n]"
syntax_pattern char char c++_escapedchar '(\\([0-7]{1,3}|x[0-9a-fA-F]{1,2}|u[0-9a-fA-F]{4}|U[0-9a-fA-F]{8}|.|\n))+'
syntax_pattern char char c++_string ".[^\\\\\\n']*"
# string
syntax_pattern normal string c++_string '(u|u8|U|L)?"'
syntax_pattern string normal c++_string '"'
syntax_pattern string string c++_escapedchar '(\\([0-7]{1,3}|x[0-9a-fA-F]{1,2}|u[0-9a-fA-F]{4}|U[0-9a-fA-F]{8}|.))+'
syntax_pattern string string c++_string '.[^\\"]*'
syntax_pattern string normal c++_string '["\n]'
syntax_pattern string string c++_escapedchar '(\\([0-7]{1,3}|x[0-9a-fA-F]{1,2}|u[0-9a-fA-F]{4}|U[0-9a-fA-F]{8}|.|\n))+'
syntax_pattern string string c++_string '.[^\\\n"]*'
# raw string
syntax_pattern normal raw_string c++_string '(u|u8|U|L)?R"[^\(]*\('