summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Add OSp1Eli Bendersky2020-09-221-1/+2
|
* Test changeEli Bendersky2020-09-221-0/+1
|
* Merge branch 'master' of github.com:eliben/pycparserEli Bendersky2020-09-221-2/+2
|\
| * Fix #349: convert to raw strings in lexer tests (#389)hodbn2020-08-181-2/+2
| |
* | Add initial github workflow file for actionsEli Bendersky2020-09-221-0/+26
|/
* Fix issues #378, #379, #385 (#387)Zecong Hu2020-07-184-12/+61
| | | | | | | | | | | | * Fix #385: generate code with nested sizeofs * Fix #378: replace assertion with check Only the assertion inside `_build_function_definition` is replaced. The assertion is not appropriate because there are possible inputs that would trigger the assertion, they're just grammatically incorrect. Thus, it is replaced with a check that raises `ParseError` on failure. * Fix #379: parse struct with nested enum
* Add example of modifying an AST and printing out modified codeEli Bendersky2020-04-151-0/+58
|
* Move code to __main__ blockEli Bendersky2020-04-151-9/+10
|
* Clean up whitespace in generated AST codeEli Bendersky2020-04-152-10/+10
|
* Move internal testing stuff from c-to-c example into utils/internalEli Bendersky2020-04-152-31/+28
|
* Replace define by typedef for typeEli Bendersky2020-03-111-1/+1
|
* Add some "types" to zlib.h (#368)Thomas Nilefalk2020-03-111-0/+31
|
* Update instructions to release. Release 2.20 was pushedrelease_v2.20Eli Bendersky2020-03-042-3/+3
|
* Merge branch 'master' of github.com:eliben/pycparserEli Bendersky2020-03-041-17/+8
|\
| * Update README.rstEli Bendersky2020-03-031-3/+0
| |
| * Move CI indicatorsEli Bendersky2020-03-031-15/+9
| |
* | Update version 2.19 --> 2.20Eli Bendersky2020-03-044-3/+17
|/
* Add travis testing for python 3.7 and 3.8 and remove workaroundEli Bendersky2020-03-031-8/+2
|
* Trim whitespaceEli Bendersky2020-03-031-12/+12
|
* Fix #363 incorrect AST when parsing offsetof (#364)Zecong Hu2020-03-032-2/+25
|
* Update README to mention non-installation of fake headersEli Bendersky2020-03-031-0/+3
| | | | | | Based on #358 by @WasabiFan Fixes #358
* Add unaligned versions of intel vector types (#357)Thom Wiggers2019-12-071-9/+18
|
* Recognize integer multicharacter constants like 'ABCD' (#350)yaroslav-o2019-09-253-5/+15
| | | | | | | | | | | | | 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.
* Fix slow backtracking when parsing strings (no external deps) (#347)Tyson Andre2019-08-262-8/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Fix slow backtracking when parsing strings (no external deps) Fixes #61 This uses negative lookaheads to avoid ambiguity in how string should be parsed by the regex. - https://docs.python.org/2/library/re.html#regular-expression-syntax - Previously, if it didn't immediately succeed at parsing an escape sequence such as `\123`, it would have to try `\1`+`23`, `\12` + `3`, and `\123`, which multiplied the time taken by 3 per additional escape sequence. This solves that by only allowing `\123` - The same fix was added for hex escapes. Also fix a test that relied on the incorrect handling of regexes. The implementation documentation says that it intends to allow **decimal** escapes permissively. * WIP debug * Fix ambiguity caused by allowing #path directives Solve this by allowing "\x" when not followed by hex, in the regular string literal. In the previous commits, `\x12` could be parsed both as `\x`+`12` and `\x12`, which caused exponential options for backtracking. * Document changes to lexer, remove debug code * Optimize this for strings
* Move .gitattributes to project root dirEli Bendersky2019-08-262-0/+7
|
* Add .gitattributes file per https://github.com/github/linguist#overridesEli Bendersky2019-08-241-0/+2
| | | | | Label .ppout files as vendored so Github doesn't count them as pycparser's source
* Rename files to prevent Github from thinking this is a Pascal projectEli Bendersky2019-08-234-1/+1
|
* Move benchmarking stuff to its own dirEli Bendersky2019-08-235-2/+26050
|
* Enhance measurement scriptEli Bendersky2019-08-231-7/+28
|
* Add local .vimrcEli Bendersky2019-08-231-0/+8
|
* Add internal utility for benchmarking parsing timeEli Bendersky2019-08-231-0/+15
|
* Fix error transforming an empty switch (#346)Tyson Andre2019-08-212-1/+16
| | | | | | | | | | | | | * Fix error transforming an empty switch The parser would crash on that line for `switch(1) {}` because NoneType is not iterable. Fixes #345 * Add a test of empty switch statements * Address review comments
* Add more intrinsics (#343)Thom Wiggers2019-08-202-0/+10
|
* Headers for Vectors (#339)sachet-mittal2019-07-293-0/+7
|
* Clean up extra whitespaceEli Bendersky2019-06-271-1/+0
|
* Fix issue #99: parser for FuncDecl incorrectly sets declname attribute on ↵Saullo Carvalho Castelo Branco2019-06-272-8/+46
| | | | return type (#329)
* Fix issue #314: Failed parsing unnamed function parameters with array dim ↵Saullo Carvalho Castelo Branco2019-06-012-3/+29
| | | | | qualifiers (#327) Fixes #314
* Bump Python version fo AppVeyorEli Bendersky2019-05-091-1/+1
|
* Followup on #326 - simplify building up type stringEli Bendersky2019-05-091-9/+2
|
* Fix issue #324: u/l constant integer suffix (#326)Kevin2019-05-092-2/+38
|
* Insert '.' and '..' to sys.path before import statements (#321)Thomas Krennwallner2019-04-131-2/+6
| | | | Restricted environments like embeddable python do not include the current working directory on startup.
* Generate pointer types correctly (#315)Amir Gonnen2019-03-272-23/+37
| | | | | | | | | | | | * Add visit_PtrDecl to generate ptr types correctly Also removed code duplication from visit_ArrayDecl and visit_TypeDecl by calling _generate_type instead, without emitting the declname. Added tests for ptr type generation * Truncate lines longer than 80 characters per https://github.com/eliben/pycparser/pull/315/files#r269553083
* Fix array type generation (#312) (#313)Amir Gonnen2019-03-263-2/+24
| | | | | | | | | | | | | | | * Fix array type generation (#312) Also added dim_quals handling to _generate_type Exmaple: >>> ast = parser.parse('int g(const int a[const 20]){}') >>> gen.visit(ast.ext[0].decl.type.args.params[0]) 'const int a[const 20]' >>> gen.visit(ast.ext[0].decl.type.args.params[0].type) 'int[const 20]' * Added TypeDecl generation. Added tests
* Fix crash when file starts with a semicolon (#310)Simon Lindholm2019-03-062-3/+24
|
* Remove non-qualified 3.7 buildEli Bendersky2019-02-151-1/+0
|
* Attempt to fix travis 3.7 buildEli Bendersky2019-02-151-0/+8
|
* Bump travis Python 3 versions to 3.6&7Eli Bendersky2019-02-151-2/+1
|
* Protect visiting recursion against empty argument listsEli Bendersky2019-02-151-1/+2
| | | | Fixes #308
* extended and cleaned up #pragma testcases (#297)Julian2018-12-071-5/+15
|
* Revert "Fix encoding problem by adding `encoding` parameter to parse_file ↵Eli Bendersky2018-12-061-10/+4
| | | | | | | | | | function. (#295)" This reverts commit 1083b55c64d6235b00f40070e452b9b2605b23da. encoding is not portable across the list of supported Python versions See #296