jhass / crystal-gobject

gobject-introspection for Crystal
BSD 3-Clause "New" or "Revised" License
127 stars 13 forks source link

Errors on Graphene #33

Closed valpackett closed 4 years ago

valpackett commented 4 years ago

(Hi, first of all, thanks for working on this — I've been looking on GI bindings that work as compile-time macros / type providers, and for something to use Crystal for… :D)

I can't get examples working, first there's this:

Code in macro 'require_gobject'                                                                                       

 7 | require_gobject("Graphene")                                                                                      
     ^                                                                                                                
Called macro defined in lib/gobject/gobject.cr:7:1                                                                    

 7 | macro require_gobject(namespace)                                                                                 

Which expanded to:                                                                                                    

 > 513 | VEC3_LEN = 3 # : Int32                                                                                       
 > 514 | VEC4_LEN = 4 # : Int32                                                                                       
 > 515 | false = 0 # : Int32                                                                                          
         ^                                                                                                            
Error: unexpected token: false

I'm not sure why these constants are even there (reported: https://github.com/ebassi/graphene/issues/180), but I added them to skip_info?. Then, new error:

syntax error in /usr/local/lib/girepository-1.0/Graphene-1.0.typelib/Matrix:164                                      
Error: expecting any of these tokens: IDENT, CONST, `, <<, <, <=, ==, ===, !=, =~, !~, >>, >, >=, +, -, *, /, //, !, ~
, %, &, |, ^, **, [], []?, []=, <=>, &+, &-, &*, &** (not 'NUMBER')

That one I'm not sure what's happening… why isn't there a snippet of the generated source?

(Also not sure why it's even trying to use Graphite, according to my package manager it's only a dependency of gstreamer1-plugins-gl, while I'm not touching anything GStreamer related, just running Gtk examples…)

jhass commented 4 years ago

Yeah no idea why that gets pulled in for you, some of the pulled in typelib's must have it as a dependency.

Anyway, I made it parse with the above two commits, let's hope it'll run for you now :)