diff options
author | Efimov Vasily <real@ispras.ru> | 2016-02-09 20:35:42 +0300 |
---|---|---|
committer | Efimov Vasily <real@ispras.ru> | 2017-10-30 19:58:20 +0300 |
commit | 12f4bd55dd789d95218367ec8a3978f6fff5e00e (patch) | |
tree | fee953402c5f695b523224332082266fcbfca187 /ply | |
parent | 40bec356f44293671ce7af0c4f1742ad040cbe82 (diff) | |
download | ply-12f4bd55dd789d95218367ec8a3978f6fff5e00e.tar.gz |
cpp: avoid infinite attempts to expand a word same as a parameterized macro
Signed-off-by: Efimov Vasily <real@ispras.ru>
Diffstat (limited to 'ply')
-rw-r--r-- | ply/cpp.py | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -536,6 +536,12 @@ class Preprocessor(object): r.lineno = t.lineno tokens[i:j+tokcount] = rep i += len(rep) + else: + # This is not a macro. It is just a word which + # equals to name of the macro. Hence, go to the + # next token. + i += 1 + del expanded[t.value] continue elif t.value == '__LINE__': |