Giter Site home page Giter Site logo

Comments (6)

elliotchance avatar elliotchance commented on August 18, 2024

Truth be told, I'm not sure how it was even setup on Mac, so I wasn't able to setup the travis branch, yet (#1) which would have probably fixed this issue.

I am working overhauling the clang ast to produce a JSON file that can be consumed by this script rather than using the Python clang bindings (which I believe are now deprecated). I will be able to push something soon.

In the meantime do you think you could provide any more details, such as the out.go it has generated?

from c2go.

elliotchance avatar elliotchance commented on August 18, 2024

Hi @xyproto, see the response here: #4

from c2go.

qarth avatar qarth commented on August 18, 2024

Hey elliot,
When I run run_tests.sh it cannot find the json which it is trying to decode.
see:

synths@ubuntu:~/elliotchance/2/c2go-0.2.0$ ./run-tests.sh 
argv.c
Traceback (most recent call last):
  File "c2go.py", line 517, in <module>
    render(go_out, json.loads(json_in.read())[0])
  File "/usr/lib/python2.7/json/__init__.py", line 339, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python2.7/json/decoder.py", line 364, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python2.7/json/decoder.py", line 382, in raw_decode
    raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded
package main: 
out.go:1:1: expected 'package', found 'EOF'
1,3d0
< Number of command line arguments passed: 3
< 2. Command line argument passed is some
< 3. Command line argument passed is args

There is a pp.json file which contains the following:

Can not understand line '|-RecordDecl 0x2791040 prev 0x2790478 <col:20, col:27> col:27 struct _IO_FILE'

When ran on a single c source file:

synths@ubuntu:~/elliotchance/2/c2go-0.2.0$ python c2go.py pseudo.c
Traceback (most recent call last):
  File "c2go.py", line 517, in <module>
    render(go_out, json.loads(json_in.read())[0])
  File "/usr/lib/python2.7/json/__init__.py", line 339, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python2.7/json/decoder.py", line 364, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python2.7/json/decoder.py", line 382, in raw_decode
    raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded

Any ideas?

from c2go.

elliotchance avatar elliotchance commented on August 18, 2024

Yes, I know what that is. I have been testing it on my mac, but the clang AST (or perhaps its just the different version of clang) on linux outputs slightly differently. I am almost finished fixing those issues in #6 which once green will be tagged as v0.3.0.

v0.3.0 will have support for both mac and linux, however in the future this error will still appear as the test programs get more complicated and expose more node types on the AST. The plan is to have a build matrix testing all minor versions of clang tested against several operating systems.

http://stackoverflow.com/questions/43012819/how-do-i-specify-the-python-version-with-a-cpp-project-in-travis-ci

In a long roundabout way I am saying that there error handling is very poor right now and if you could offer any improvements that would be fantastic 😄

from c2go.

elliotchance avatar elliotchance commented on August 18, 2024

@qarth please try again with v0.3.0

from c2go.

elliotchance avatar elliotchance commented on August 18, 2024

This has been fixed for a while now - also there is no more Python.

from c2go.

Related Issues (20)

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.