Revision a4a7127dadf79ebf0deacf49f70ed9e588c40596 authored by yaroslav-o on 25 September 2019, 12:44:54 UTC, committed by Eli Bendersky on 25 September 2019, 12:44:54 UTC
Recognize integer multicharacter constants like 'ABCD' The feature I am adding is defined here - 5th case. https://en.cppreference.com/w/c/language/character_constant Also here: 6.4.4.4.10 of C99. Put simply, pycparser thought a statement like this is an error: int a = 'ABCD'; However it is not. It is likely possible to just modify char_const regular expression in c_lexer.py:240 to allow longer characters, but the way it is done in this PR - multicharacter constants are clearly separated. I am also limiting the length of multicharacter const integers to 4 characters - this matches VS compiler behavior (gcc allows any length with a warning) and lets pycparser NOT consider lengthy single-quoted strings as integers - these would be nonsensical anyway.
1 parent 62ee4ba
File | Mode | Size |
---|---|---|
examples | ||
pycparser | ||
tests | ||
utils | ||
.gitattributes | -rw-r--r-- | 32 bytes |
.gitignore | -rw-r--r-- | 144 bytes |
.travis.yml | -rw-r--r-- | 286 bytes |
.vimrc | -rw-r--r-- | 274 bytes |
CHANGES | -rw-r--r-- | 9.9 KB |
CONTRIBUTORS | -rw-r--r-- | 598 bytes |
LICENSE | -rw-r--r-- | 1.5 KB |
MANIFEST.in | -rw-r--r-- | 335 bytes |
README.rst | -rw-r--r-- | 8.7 KB |
TODO.txt | -rw-r--r-- | 1.4 KB |
_clean_tables.py | -rw-r--r-- | 871 bytes |
appveyor.yml | -rw-r--r-- | 213 bytes |
setup.cfg | -rw-r--r-- | 63 bytes |
setup.py | -rw-r--r-- | 2.3 KB |
tox.ini | -rw-r--r-- | 88 bytes |

Computing file changes ...
README.rst

Loading README.rst ...