rlang 0.5.1 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +10 -0
- data/Gemfile.lock +3 -5
- data/README +11 -0
- data/bin/rlang +4 -0
- data/docs/RlangCompiler.md +2 -0
- data/docs/RlangManual.md +37 -8
- data/lib/rlang/lib/array/array32.rb +13 -4
- data/lib/rlang/lib/array/array64.rb +11 -3
- data/lib/rlang/lib/base64.rb +223 -0
- data/lib/rlang/lib/io.rb +7 -2
- data/lib/rlang/lib/malloc.rb +5 -3
- data/lib/rlang/lib/object.rb +23 -0
- data/lib/rlang/lib/rlang_core.rb +2 -1
- data/lib/rlang/lib/string.rb +95 -11
- data/lib/rlang/lib/type/i32.rb +30 -12
- data/lib/rlang/lib/type/i64.rb +0 -2
- data/lib/rlang/lib/wasi.rb +57 -6
- data/lib/rlang/parser/data.rb +5 -0
- data/lib/rlang/parser/ext/integer.rb +3 -1
- data/lib/rlang/parser/ext/type.rb +30 -1
- data/lib/rlang/parser/global.rb +7 -0
- data/lib/rlang/parser/wgenerator.rb +221 -83
- data/lib/rlang/parser/wnode.rb +41 -14
- data/lib/rlang/parser/wtype.rb +12 -6
- data/lib/rlang/parser.rb +182 -130
- data/lib/rlang/version.rb +1 -1
- data/lib/ruby/mirror/rstring.rb +16 -0
- data/lib/utils/exceptions.rb +12 -0
- data/rlang.gemspec +4 -4
- metadata +16 -12
data/lib/rlang/parser/wtype.rb
CHANGED
@@ -18,17 +18,18 @@ class WType
|
|
18
18
|
include Log
|
19
19
|
|
20
20
|
WASM_TYPE_MAP = {
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
21
|
+
UI64: Type::UI64,
|
22
|
+
I64: Type::I64,
|
23
|
+
UI32: Type::UI32,
|
24
|
+
I32: Type::I32,
|
25
|
+
F64: Type::F64,
|
26
|
+
F32: Type::F32
|
25
27
|
}
|
26
28
|
|
27
29
|
# Implicit Type cast order in decreasing order of precedence
|
28
30
|
# Class types have precedence over default integer type
|
29
31
|
# because of pointer arithmetics
|
30
|
-
|
31
|
-
CAST_PRECEDENCE = [:F64, :F32, :I64, :Class, :I32]
|
32
|
+
CAST_PRECEDENCE = [:F64, :F32, :UI64, :I64, :Class, :UI32, :I32]
|
32
33
|
|
33
34
|
attr_reader :name
|
34
35
|
|
@@ -79,6 +80,10 @@ class WType
|
|
79
80
|
WASM_TYPE_MAP.has_key? @name
|
80
81
|
end
|
81
82
|
|
83
|
+
def signed?
|
84
|
+
self.native? && WASM_TYPE_MAP[@name].signed?
|
85
|
+
end
|
86
|
+
|
82
87
|
def blank?
|
83
88
|
@name == :none || @name == :nil
|
84
89
|
end
|
@@ -128,6 +133,7 @@ class WType
|
|
128
133
|
end
|
129
134
|
|
130
135
|
DEFAULT = self.new(WASM_TYPE_MAP.key(Type::DEFAULT))
|
136
|
+
UNSIGNED_DEFAULT = self.new(WASM_TYPE_MAP.key(Type::UNSIGNED_DEFAULT))
|
131
137
|
|
132
138
|
end
|
133
139
|
|