Comments (6)
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.
Hi @xyproto, see the response here: #4
from c2go.
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.
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.
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.
@qarth please try again with v0.3.0
from c2go.
This has been fixed for a while now - also there is no more Python.
from c2go.
Related Issues (20)
- panic: unknown node type: 'MSAllocatorAttr 0x21a234729f0 <line:420:25>' HOT 1
- How to handle dependencies? HOT 2
- panic: could not match regexp with string HOT 1
- panic: unknown node type: 'CallbackAttr 0x562b0bc30c88 <line:199:12> Implicit 2 3'
- Cannot tranpile (sic)
- panic: unknown node type: ColdAttr HOT 1
- __int128 is translated as int64
- panic: unknown node type: BuiltinAttr HOT 2
- panic: unknown node type: 'BuiltinAttr 0x7fb08f04f838 <<invalid sloc>> Inherited Implicit 720' HOT 2
- panic: could not match regexp with string (translation_unit_decl) HOT 2
- 'const' removed from struct name / cannot determine sizeof union HOT 2
- docker container for c2go HOT 8
- panic: runtime error: invalid memory address or nil pointer dereference
- An alternative to github.com/elliotchance/c2go
- panic: unknown node type: 'BuiltinAttr 0x10db7b0 <<invalid sloc>> Inherited Implicit 749' HOT 1
- FreeBSD implementation
- panic: unknown node type: 'BuiltinAttr 0x1d448112da0 <<invalid sloc>> Implicit 836' HOT 3
- Installation of c2go HOT 3
- Is it possible to convert .cpp aswell? HOT 1
- Compile `pikchr` source code
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from c2go.