BOAST 0.992 → 0.994
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/BOAST.gemspec +1 -1
- data/lib/BOAST/Algorithm.rb +15 -0
- data/lib/BOAST/Parens.rb +16 -1
- metadata +1 -1
data/BOAST.gemspec
CHANGED
data/lib/BOAST/Algorithm.rb
CHANGED
@@ -16,6 +16,12 @@ module BOAST
|
|
16
16
|
return BOAST::FORTRAN
|
17
17
|
end
|
18
18
|
|
19
|
+
def BOAST::get_default_debug
|
20
|
+
debug = false
|
21
|
+
debug = ENV["DEBUG"] if ENV["DEBUG"]
|
22
|
+
return debug
|
23
|
+
end
|
24
|
+
|
19
25
|
@@output = STDOUT
|
20
26
|
@@lang = BOAST::get_default_lang
|
21
27
|
@@replace_constants = true
|
@@ -27,6 +33,7 @@ module BOAST
|
|
27
33
|
@@array_start = 1
|
28
34
|
@@chain_code = false
|
29
35
|
@@architecture = X86
|
36
|
+
@@debug = BOAST::get_default_debug
|
30
37
|
|
31
38
|
@@env = Hash.new{|h, k| h[k] = []}
|
32
39
|
|
@@ -66,6 +73,14 @@ module BOAST
|
|
66
73
|
a.close
|
67
74
|
end
|
68
75
|
|
76
|
+
def BOAST::debug=(debug)
|
77
|
+
@@debug = debug
|
78
|
+
end
|
79
|
+
|
80
|
+
def BOAST::debug
|
81
|
+
return @@debug
|
82
|
+
end
|
83
|
+
|
69
84
|
def BOAST::architecture=(arch)
|
70
85
|
@@architecture = arch
|
71
86
|
end
|
data/lib/BOAST/Parens.rb
CHANGED
@@ -12,9 +12,24 @@ class Object
|
|
12
12
|
|
13
13
|
return klass.send(:parens, *a, &b) if klass.respond_to? :parens
|
14
14
|
|
15
|
-
|
15
|
+
if s == BOAST then
|
16
|
+
STDERR.puts "Warning unkwown function #{m} generated as BOAST::FuncCall!" if BOAST::debug
|
17
|
+
return BOAST::FuncCall::new(m,*a,&b)
|
18
|
+
end
|
16
19
|
|
17
20
|
orig_method_missing m, *a, &b
|
18
21
|
end
|
19
22
|
end
|
20
23
|
|
24
|
+
module BOAST
|
25
|
+
|
26
|
+
def BOAST.register_funccall(name)
|
27
|
+
s =<<EOF
|
28
|
+
def BOAST.#{name}(*args)
|
29
|
+
return BOAST::FuncCall("#{name}", *args)
|
30
|
+
end
|
31
|
+
EOF
|
32
|
+
eval s
|
33
|
+
end
|
34
|
+
|
35
|
+
end
|