cstub 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cstub/version.rb +1 -1
- data/lib/cstub.rb +12 -8
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 809848477047017f310cfa958061f70a7c53a80d
|
4
|
+
data.tar.gz: f56bf9ba507e41c77c2bc500a9af03084410e747
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d0aab08aa3d3618755955af13aa5d9f9bed41be9300a79b9dc2d77a9ba2f98f1a5c2a10adee6b3af24ffa8130ef7c8400b9b3eb8f6ea5de5c042be5b88b8c977
|
7
|
+
data.tar.gz: f0f16dcd7ddc28c023116b05f63a1339d9cde58589a44fa8a49b2ff2068cea3706bb77585d982ab39004a931cc4e020fb0b5b0145e679b6a0da1b287067b85ca
|
data/lib/cstub/version.rb
CHANGED
data/lib/cstub.rb
CHANGED
@@ -53,6 +53,7 @@ module Cstub
|
|
53
53
|
typelist = collect_types ast
|
54
54
|
ast.entities.each do |node|
|
55
55
|
node.Declaration? or next
|
56
|
+
next if not node.declarators
|
56
57
|
node.declarators.each do |decl|
|
57
58
|
if decl.type.Function?
|
58
59
|
retval = ""
|
@@ -79,15 +80,17 @@ module Cstub
|
|
79
80
|
sig = "#{node.type.to_s}#{decl.indirect_type.type.to_s} #{decl.name}("
|
80
81
|
paramlist = []
|
81
82
|
parnum = 0
|
82
|
-
decl.indirect_type.params
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
83
|
+
if decl.indirect_type.params
|
84
|
+
decl.indirect_type.params.each do |param|
|
85
|
+
par = "#{param.type.to_s} "
|
86
|
+
if param.name
|
87
|
+
par << "#{param.name.to_s}"
|
88
|
+
else
|
89
|
+
par << "par" + parnum.to_s
|
90
|
+
parnum = parnum + 1
|
91
|
+
end
|
92
|
+
paramlist << par
|
89
93
|
end
|
90
|
-
paramlist << par
|
91
94
|
end
|
92
95
|
sig << paramlist.join(", ") << ")\n{\n"
|
93
96
|
if retval == ""
|
@@ -123,6 +126,7 @@ module Cstub
|
|
123
126
|
C::Preprocessor.command = cpp_command
|
124
127
|
end
|
125
128
|
source = cpp.preprocess(code)
|
129
|
+
source.gsub!(/^#.*/,'')
|
126
130
|
C.parse(source)
|
127
131
|
end
|
128
132
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cstub
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- kunigaku
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-05-
|
11
|
+
date: 2014-05-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cast
|