metacraft-labs / py2nim

A Python-to-Nim transpiler
MIT License
136 stars 8 forks source link

Error on compiling mrtparse #16

Open survivorm opened 6 years ago

survivorm commented 6 years ago

Problem trying to convert library: https://github.com/t2mune/mrtparse (MRT network routing data library) Nim version: devel (if it help, i may supply details) Traceback:

./py2nim ../mrtparse-master/mrtparse/__init__.py 
warn: no type for mrtparse.__init__#as_len
warn: no type for mrtparse.__init__#as_repr
warn: no type for mrtparse.__init__#af_num
warn: no type for mrtparse.__init__#is_add_path
warn: PyLambda
warn: mrtparse.__init__#reverse_defaultdict expected type defaultdict got any return
warn: PyLambda
warn: PyLambda
warn: no type for mrtparse.__init__#__init__
warn: no type for mrtparse.__init__#__init__
warn: no type for mrtparse.__init__#chk_buf
warn: no type for mrtparse.__init__#val_num
warn: no type for mrtparse.__init__#val_bytes
warn: no type for mrtparse.__init__#val_str
warn: no type for mrtparse.__init__#val_addr
warn: no type for mrtparse.__init__#val_asn
warn: no type for mrtparse.__init__#val_rd
warn: no type for mrtparse.__init__#val_nlri
warn: no type for mrtparse.__init__#__init__
warn: no type for mrtparse.__init__#close
warn: no type for mrtparse.__init__#__iter__
warn: no type for mrtparse.__init__#__next__
warn: no type for mrtparse.__init__#unpack_hdr
warn: no type for mrtparse.__init__#unpack_data
warn: no type for mrtparse.__init__#unpack_td_v2
warn: no type for mrtparse.__init__#__init__
warn: no type for mrtparse.__init__#unpack
warn: no type for mrtparse.__init__#__init__
warn: no type for mrtparse.__init__#unpack
warn: no type for mrtparse.__init__#__init__
warn: no type for mrtparse.__init__#unpack
warn: no type for mrtparse.__init__#__init__
warn: no type for mrtparse.__init__#unpack
warn: no type for mrtparse.__init__#__init__
warn: no type for mrtparse.__init__#unpack
warn: no type for mrtparse.__init__#__init__
warn: no type for mrtparse.__init__#unpack
warn: no type for mrtparse.__init__#__init__
warn: no type for mrtparse.__init__#unpack
warn: no type for mrtparse.__init__#__init__
warn: no type for mrtparse.__init__#unpack
warn: no type for mrtparse.__init__#__init__
warn: no type for mrtparse.__init__#unpack
warn: no type for mrtparse.__init__#unpack_open
warn: no type for mrtparse.__init__#unpack_update
warn: no type for mrtparse.__init__#unpack_notification
warn: no type for mrtparse.__init__#unpack_route_refresh
warn: no type for mrtparse.__init__#__init__
warn: no type for mrtparse.__init__#unpack
warn: no type for mrtparse.__init__#unpack_capabilities
warn: no type for mrtparse.__init__#unpack_multi_ext
warn: no type for mrtparse.__init__#unpack_orf
warn: no type for mrtparse.__init__#unpack_graceful_restart
warn: no type for mrtparse.__init__#unpack_support_as4
warn: no type for mrtparse.__init__#unpack_add_path
warn: no type for mrtparse.__init__#__init__
warn: no type for mrtparse.__init__#unpack
warn: no type for mrtparse.__init__#unpack_origin
warn: no type for mrtparse.__init__#unpack_as_path
warn: no type for mrtparse.__init__#unpack_next_hop
warn: no type for mrtparse.__init__#unpack_multi_exit_disc
warn: no type for mrtparse.__init__#unpack_local_pref
warn: no type for mrtparse.__init__#unpack_aggregator
warn: no type for mrtparse.__init__#unpack_community
warn: no type for mrtparse.__init__#unpack_originator_id
warn: no type for mrtparse.__init__#unpack_cluster_list
warn: no type for mrtparse.__init__#unpack_mp_reach_nlri
warn: no type for mrtparse.__init__#unpack_mp_unreach_nlri
warn: no type for mrtparse.__init__#unpack_extended_communities
warn: no type for mrtparse.__init__#unpack_as4_path
warn: no type for mrtparse.__init__#unpack_as4_aggregator
warn: no type for mrtparse.__init__#unpack_aigp
warn: no type for mrtparse.__init__#unpack_attr_set
warn: no type for mrtparse.__init__#unpack_large_community
warn: no type for mrtparse.__init__#__init__
warn: no type for mrtparse.__init__#unpack
warn: no type for mrtparse.__init__#unpack_l3vpn
warn: no type for mrtparse.__init__#is_dup
warn: no type for mrtparse.__init__#is_valid
py2nim.nim(109)          py2nim
py2nim.nim(105)          translate
compiler.nim(1708)       compile
generator.nim(679)       generate
renderer.nim(1424)       renderTree
renderer.nim(626)        gstmts
renderer.nim(537)        gsub
renderer.nim(1236)       gsub
renderer.nim(601)        gsection
renderer.nim(312)        gcoms
renderer.nim(309)        gcom
renderer.nim(217)        putComment
system.nim(2843)         sysFatal
Error: unhandled exception: index out of bounds [IndexError]
survivorm commented 6 years ago

Same with netaddr library: https://github.com/drkjam/netaddr

./py2nim ../netaddr-rel-0.7.x/netaddr/ip/__init__.py
warn: no type for ip.__init__#iter_unique_ips
warn: no type for ip.__init__#cidr_abbrev_to_verbose
warn: no type for ip.__init__#cidr_merge
warn: no type for ip.__init__#cidr_exclude
warn: no type for ip.__init__#cidr_partition
warn: no type for ip.__init__#spanning_cidr
warn: no type for ip.__init__#iter_iprange
warn: no type for ip.__init__#iprange_to_cidrs
warn: no type for ip.__init__#smallest_matching_cidr
warn: no type for ip.__init__#largest_matching_cidr
warn: no type for ip.__init__#all_matching_cidrs
warn: no type for ip.__init__#__init__
warn: no type for ip.__init__#_set_value
warn: PyLambda
warn: no type for ip.__init__#key
warn: no type for ip.__init__#sort_key
warn: no type for ip.__init__#__hash__
warn: no type for ip.__init__#__eq__
warn: no type for ip.__init__#__ne__
warn: no type for ip.__init__#__lt__
warn: no type for ip.__init__#__le__
warn: no type for ip.__init__#__gt__
warn: no type for ip.__init__#__ge__
warn: no type for ip.__init__#is_unicast
warn: no type for ip.__init__#is_multicast
warn: no type for ip.__init__#is_loopback
warn: no type for ip.__init__#is_private
warn: no type for ip.__init__#is_link_local
warn: no type for ip.__init__#is_reserved
warn: no type for ip.__init__#is_ipv4_mapped
warn: no type for ip.__init__#is_ipv4_compat
warn: no type for ip.__init__#info
warn: no type for ip.__init__#version
warn: no type for ip.__init__#__getstate__
warn: no type for ip.__init__#__setstate__
warn: no type for ip.__init__#netmask_bits
warn: no type for ip.__init__#is_hostmask
warn: no type for ip.__init__#is_netmask
warn: no type for ip.__init__#__iadd__
warn: no type for ip.__init__#__isub__
warn: no type for ip.__init__#__add__
warn: no type for ip.__init__#__sub__
warn: no type for ip.__init__#__rsub__
warn: no type for ip.__init__#key
warn: no type for ip.__init__#sort_key
warn: no type for ip.__init__#__long__
warn: no type for ip.__init__#__oct__
warn: no type for ip.__init__#__hex__
warn: no type for ip.__init__#__index__
warn: no type for ip.__init__#bits
warn: no type for ip.__init__#packed
warn: no type for ip.__init__#words
warn: no type for ip.__init__#bin
warn: no type for ip.__init__#reverse_dns
warn: no type for ip.__init__#ipv4
warn: no type for ip.__init__#ipv6
warn: no type for ip.__init__#format
warn: no type for ip.__init__#__or__
warn: no type for ip.__init__#__and__
warn: no type for ip.__init__#__xor__
warn: no type for ip.__init__#__lshift__
warn: no type for ip.__init__#__rshift__
warn: no type for ip.__init__#__nonzero__
warn: no type for ip.__init__#__str__
warn: no type for ip.__init__#__repr__
warn: IsNot:
 type int type void
warn: missing init type
warn: compile index out of bounds
warn: no type for ip.__init__#__iter__
warn: no type for ip.__init__#size
warn: no type for ip.__init__#__len__
warn: no type for ip.__init__#__getitem__
warn: no type for ip.__init__#__contains__
warn: no type for ip.__init__#__nonzero__
warn: LtE:
 type int any
warn: LtE:
 type int any
warn: expected bool got type int if: flags & NOHOST:
warn: ip.__init__#parse_ip_network expected (type int, type int) got (any, any) return
warn: no type for ip.__init__#__getstate__
warn: no type for ip.__init__#__setstate__
warn: no type for ip.__init__#_set_prefixlen
warn: PyLambda
warn: no type for ip.__init__#ip
warn: no type for ip.__init__#network
warn: no type for ip.__init__#broadcast
warn: no type for ip.__init__#first
warn: no type for ip.__init__#last
warn: no type for ip.__init__#netmask
warn: no type for ip.__init__#_netmask_int
warn: no type for ip.__init__#hostmask
warn: no type for ip.__init__#_hostmask_int
warn: no type for ip.__init__#cidr
warn: no type for ip.__init__#__iadd__
warn: no type for ip.__init__#__isub__
warn: no type for ip.__init__#__contains__
warn: no type for ip.__init__#key
warn: no type for ip.__init__#sort_key
warn: no type for ip.__init__#ipv4
warn: no type for ip.__init__#ipv6
warn: no type for ip.__init__#previous
warn: no type for ip.__init__#next
warn: no type for ip.__init__#supernet
warn: no type for ip.__init__#subnet
warn: no type for ip.__init__#iter_hosts
warn: no type for ip.__init__#__str__
warn: no type for ip.__init__#__repr__
warn: compile index out of bounds
warn: no type for ip.__init__#__getstate__
warn: no type for ip.__init__#__setstate__
warn: no type for ip.__init__#__contains__
warn: no type for ip.__init__#first
warn: no type for ip.__init__#last
warn: no type for ip.__init__#key
warn: no type for ip.__init__#sort_key
warn: no type for ip.__init__#cidrs
warn: no type for ip.__init__#__str__
warn: no type for ip.__init__#__repr__
py2nim.nim(109)          py2nim
py2nim.nim(105)          translate
compiler.nim(1708)       compile
generator.nim(679)       generate
renderer.nim(1424)       renderTree
renderer.nim(626)        gstmts
renderer.nim(537)        gsub
renderer.nim(1236)       gsub
renderer.nim(600)        gsection
renderer.nim(1142)       gsub
renderer.nim(537)        gsub
renderer.nim(1149)       gsub
renderer.nim(537)        gsub
renderer.nim(1157)       gsub
renderer.nim(312)        gcoms
renderer.nim(309)        gcom
renderer.nim(195)        putComment
system.nim(2843)         sysFatal
Error: unhandled exception: index out of bounds [IndexError]
./py2nim ../netaddr-rel-0.7.x/netaddr/ip/sets.py
warn: no type for ip.sets#_subtract
warn: no type for ip.sets#_iter_merged_ranges
warn: no type for ip.sets#__init__
warn: no type for ip.sets#__getstate__
warn: no type for ip.sets#__setstate__
warn: no type for ip.sets#_compact_single_network
warn: no type for ip.sets#compact
warn: no type for ip.sets#__hash__
warn: no type for ip.sets#__contains__
warn: no type for ip.sets#__nonzero__
warn: no type for ip.sets#__iter__
warn: no type for ip.sets#iter_cidrs
warn: no type for ip.sets#add
warn: no type for ip.sets#remove
warn: no type for ip.sets#pop
warn: no type for ip.sets#isdisjoint
warn: no type for ip.sets#copy
warn: no type for ip.sets#update
warn: no type for ip.sets#clear
warn: no type for ip.sets#__eq__
warn: no type for ip.sets#__ne__
warn: no type for ip.sets#__lt__
warn: no type for ip.sets#issubset
warn: no type for ip.sets#__gt__
warn: no type for ip.sets#issuperset
warn: no type for ip.sets#union
warn: no type for ip.sets#intersection
warn: no type for ip.sets#symmetric_difference
warn: no type for ip.sets#difference
warn: no type for ip.sets#__len__
warn: no type for ip.sets#size
warn: no type for ip.sets#__repr__
warn: no type for ip.sets#iscontiguous
warn: no type for ip.sets#iprange
warn: no type for ip.sets#iter_ipranges
py2nim.nim(109)          py2nim
py2nim.nim(105)          translate
compiler.nim(1708)       compile
generator.nim(679)       generate
renderer.nim(1424)       renderTree
renderer.nim(626)        gstmts
renderer.nim(537)        gsub
renderer.nim(1236)       gsub
renderer.nim(600)        gsection
renderer.nim(1142)       gsub
renderer.nim(537)        gsub
renderer.nim(1149)       gsub
renderer.nim(537)        gsub
renderer.nim(1157)       gsub
renderer.nim(312)        gcoms
renderer.nim(309)        gcom
renderer.nim(195)        putComment
system.nim(2843)         sysFatal
Error: unhandled exception: index out of bounds [IndexError]