aboutsummaryrefslogtreecommitdiff
path: root/pycparser
diff options
context:
space:
mode:
authorEven <eventh@gmail.com>2011-11-06 16:02:43 +0100
committerEven <eventh@gmail.com>2011-11-06 16:02:43 +0100
commit13ad219ea4e2b1cee5effc566ea5e0d5cb9f3c45 (patch)
tree10d18e7637102e81cac4b531f7f9794f08cfbb5f /pycparser
parent3c69f8fdeb028ae9bc991056c239817856ed0678 (diff)
downloadpycparser-13ad219ea4e2b1cee5effc566ea5e0d5cb9f3c45.tar.gz
Fix for issue 50, added support for more windows chars in #line path.
Diffstat (limited to 'pycparser')
-rw-r--r--pycparser/c_lexer.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/pycparser/c_lexer.py b/pycparser/c_lexer.py
index 235f8f0..dec04ef 100644
--- a/pycparser/c_lexer.py
+++ b/pycparser/c_lexer.py
@@ -179,13 +179,13 @@ class CLexer(object):
bad_octal_constant = '0[0-7]*[89]'
# character constants (K&R2: A.2.5.2)
- # Note: a-zA-Z and '.' are allowed as escape chars to support #line
+ # Note: a-zA-Z and '.-~^_!=&;,' are allowed as escape chars to support #line
# directives with Windows paths as filenames (..\..\dir\file)
#
- simple_escape = r"""([a-zA-Z.\\?'"])"""
+ simple_escape = r"""([a-zA-Z._~!=&\^\-\\?'"])"""
octal_escape = r"""([0-7]{1,3})"""
hex_escape = r"""(x[0-9a-fA-F]+)"""
- bad_escape = r"""([\\][^a-zA-Z.\\?'"x0-7])"""
+ bad_escape = r"""([\\][^a-zA-Z._~^!=&\^\-\\?'"x0-7])"""
escape_sequence = r"""(\\("""+simple_escape+'|'+octal_escape+'|'+hex_escape+'))'
cconst_char = r"""([^'\\\n]|"""+escape_sequence+')'