Git Product home page Git Product logo

cpip's People

Contributors

h4ck3rm1k3 avatar kolanich avatar paulross avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

cpip's Issues

Problems with Python 3.7

When I try to use cpip with Python 3.7 I run into some problems:

the verbose flag on namedtuple has been removed. this was easy to patch into your code. Once I passed this hurdle I get this callstack, which I can't understand:

1> File "C:\src\honey\tools\cpip\core\PpLexer.py", line 480, in ppTokens
1> for aTok in self._genPreIncludeTokens():
1> File "C:\src\honey\tools\cpip\core\PpLexer.py", line 375, in _genPreIncludeTokens
1> for aTok in self._genPpTokensRecursive(myGen):
1>RuntimeError: generator raised StopIteration

This is for the latest commit (hash: 10e6959). I had to use the master as the last official release 0.9.7 does not contain the bugfix for file/line related to the missing currentFileIsSystemFile property of FileIncludeStack.

passing Defines to PpLexer

For some reason I am not able to pass Defines to the PpLexer using the preDefines.
Like in the Demo, how do i pass AUSTRALIAN & LANG_SUPPORT for example ?

myLex = PpLexer.PpLexer(cpp_file, handlerObj)

Support wide character-literal variants and comparison

We currently support the L e.g. L'A' prefix for character-literal (ISO/IEC 14882:1998(E) 2.13.2 Character literals [lex.ccon]). However we do not support comparison between wide and narrow characters. For example this produces FAIL:

#if L'A' == 'A'
PASS
#else
FAIL
#endif

Also later versions of the standard have u, U as equivalents (ISO/IEC 14882 / N3242 :2011(E) 2.14.2 Character literals [lex.ccon], ISO/IEC 9899:2011 6.4.4.4 etc.).

This requires some simple changes to PpToken.evalConstExpr() and PpTokeniser._sliceCharacterLiteral() plus tests.

Discovered when processing Python-3.6.2/Python/sysmodule.c

File line/column mapping is wrong

There are some xfailing tests in tests/unit/test_core/test_FileLocation.py that illustrate the problem. The remedy is being worked on the fileLineColumn branch.

Accidental token pasting

The preprocessor can be coerced into accidentally pasting tokens to create significant other tokens. For example:

#define PLUS +
+PLUS

This should produce + + not ++.

There are some xfailing tests in tests/unit/test_core/test_PpLexer.py. Search for @pytest.mark.xfail(reason='Need to fix accidental token pasting.')

Some links:

Remove duplicate HTML when processing directories

When processing a directory of code each include is rendered in HTML for each translation unit. This is quite expensive in space. The idea is to post process the output of cpipmain by finding identical files and copying them into a common area and deleting the duplicates. The links need to be updated as well, both ways.

Make a tool cpipduperelink that accomplishes this.

SVG include graphs do not resize <svg> page when zooming

The root <svg> element has attributes height and width that have values appropriate to 100% scaling. This means when zoomed out (<100%) the browser displays a bigger page than necessary and when zoomed in (>100%) elements outside the page are not displayed.

The function scaleGraphic() needs to adjust those attribute values on the <svg> element. Probably the easiest way to do this is to pass them in to scaleGraphic() as arguments and supply them specifically when writing the <g id="scaleGroup"> group of elements.

cpip-0.9.8rc0 setup (install) appears to be incomplete

I was trying to install the latest version using 'python setup.py install' but the package appears to be incomplete (i.e. cpip.core is missing).

cpipmain --help

Traceback (most recent call last):
File "/usr/local/bin/cpipmain", line 11, in
load_entry_point('cpip==0.9.8rc0', 'console_scripts', 'cpipmain')()
File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 490, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 2854, in load_entry_point
return ep.load()
File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 2445, in load
return self.resolve()
File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 2451, in resolve
module = import(self.module_name, fromlist=['name'], level=0)
File "/usr/local/lib/python3.8/dist-packages/cpip-0.9.8rc0-py3.8.egg/cpip/CPIPMain.py", line 135, in
from cpip import CppCondGraphToHtml
File "/usr/local/lib/python3.8/dist-packages/cpip-0.9.8rc0-py3.8.egg/cpip/CppCondGraphToHtml.py", line 30, in
from cpip.core import CppCond
ModuleNotFoundError: No module named 'cpip.core'

Make same referenced files common

This issue is only significant when processing directories of C code which produces and links to large amounts of near duplicate data.

When processing included file the contents is linked to the macro page. These links, and the macro page are prefixed with the ITU filename. This makes every version of, say Python.h different even if it is processed with the same macro environment. This makes it impossible to replace common files with a single one that all link to which would reduce duplication hugely.

Change the name of the macro file to just macros.html and all hrefs to that.

PpLexer crashes when using annotateLineFile=True

PpLexer has an option annotateLineFile which, when set True, provides GCC style annotations. PpLexer crashes with this option as it makes a call to self._fis.currentFileIsSystemFile and the currentFileIsSystemFile attribute does not exist.

There is no test in tests.unit.test_core.test_PpLexer that uses annotateLineFile=True.

Some ITU files are not colourised with conditional True/False

Some ITU HTML files are not colourised according to their conditional compilation state, instead they are marked as ambiguous.

Some investigation shows that if a file has no conditional compilation directives then that file does not appear in CppCondGraphVisitorConditionalLines and the call to isCompiled() raises so ItuToHtml _incAndWriteLine() treats this as ambiguous.

The solution is that if the path is not in CppCondGraphVisitorConditionalLines then isCompiled() should return 1.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.