rdl 2.0.1 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +13 -0
- data/CHANGES.md +35 -0
- data/README.md +153 -116
- data/bin/rdl_query +1 -1
- data/extras/type_tests/typetests.rb +905 -0
- data/lib/rdl.rb +0 -1
- data/lib/rdl/boot.rb +108 -77
- data/lib/rdl/boot_rails.rb +2 -8
- data/lib/rdl/config.rb +44 -17
- data/lib/rdl/contracts/flat.rb +1 -1
- data/lib/rdl/info.rb +3 -3
- data/lib/rdl/query.rb +11 -11
- data/lib/rdl/typecheck.rb +399 -136
- data/lib/rdl/types/finite_hash.rb +3 -2
- data/lib/rdl/types/generic.rb +7 -6
- data/lib/rdl/types/intersection.rb +3 -2
- data/lib/rdl/types/lexer.rex +2 -3
- data/lib/rdl/types/lexer.rex.rb +1 -4
- data/lib/rdl/types/method.rb +7 -6
- data/lib/rdl/types/nominal.rb +10 -1
- data/lib/rdl/types/parser.racc +7 -8
- data/lib/rdl/types/parser.tab.rb +108 -109
- data/lib/rdl/types/structural.rb +1 -0
- data/lib/rdl/types/tuple.rb +2 -2
- data/lib/rdl/types/type.rb +8 -8
- data/lib/rdl/types/type_inferencer.rb +1 -1
- data/lib/rdl/types/union.rb +2 -1
- data/lib/rdl/util.rb +28 -3
- data/lib/rdl/wrap.rb +216 -165
- data/lib/rdl_disable.rb +22 -15
- data/lib/types/core.rb +2 -4
- data/lib/types/core/_aliases.rb +14 -0
- data/lib/types/core/abbrev.rb +3 -0
- data/lib/types/core/array.rb +139 -0
- data/lib/types/core/base64.rb +8 -0
- data/lib/types/core/basic_object.rb +12 -0
- data/lib/types/core/benchmark.rb +9 -0
- data/lib/types/core/bigdecimal.rb +223 -0
- data/lib/types/core/bigmath.rb +10 -0
- data/lib/types/core/bignum.rb +214 -0
- data/lib/types/core/class.rb +15 -0
- data/lib/types/core/complex.rb +123 -0
- data/lib/types/core/coverage.rb +4 -0
- data/lib/types/core/csv.rb +3 -0
- data/lib/types/core/date.rb +4 -0
- data/lib/types/core/dir.rb +37 -0
- data/lib/types/core/encoding.rb +21 -0
- data/lib/types/core/enumerable.rb +96 -0
- data/lib/types/core/enumerator.rb +24 -0
- data/lib/types/core/exception.rb +15 -0
- data/lib/types/core/file.rb +125 -0
- data/lib/types/core/fileutils.rb +4 -0
- data/lib/types/core/fixnum.rb +213 -0
- data/lib/types/core/float.rb +199 -0
- data/lib/types/core/gem.rb +19 -0
- data/lib/types/core/hash.rb +72 -0
- data/lib/types/core/integer.rb +194 -0
- data/lib/types/core/io.rb +101 -0
- data/lib/types/core/kernel.rb +89 -0
- data/lib/types/core/marshal.rb +3 -0
- data/lib/types/core/matchdata.rb +24 -0
- data/lib/types/core/math.rb +50 -0
- data/lib/types/core/module.rb +81 -0
- data/lib/types/core/nil.rb +11 -0
- data/lib/types/core/numeric.rb +56 -0
- data/lib/types/core/object.rb +73 -0
- data/lib/types/core/pathname.rb +104 -0
- data/lib/types/core/proc.rb +12 -0
- data/lib/types/core/process.rb +110 -0
- data/lib/types/core/random.rb +13 -0
- data/lib/types/core/range.rb +37 -0
- data/lib/types/core/rational.rb +207 -0
- data/lib/types/core/regexp.rb +28 -0
- data/lib/types/core/set.rb +56 -0
- data/lib/types/core/string.rb +140 -0
- data/lib/types/core/strscan.rb +6 -0
- data/lib/types/core/symbol.rb +27 -0
- data/lib/types/core/time.rb +66 -0
- data/lib/types/core/uri.rb +18 -0
- data/lib/types/core/yaml.rb +3 -0
- data/lib/types/devise.rb +1 -0
- data/lib/types/devise/controller_helpers.rb +3 -0
- data/lib/types/devise/parameter_sanitizer.rb +2 -0
- data/lib/types/pundit.rb +2 -0
- data/lib/types/rails/_helpers.rb +50 -0
- data/lib/types/rails/abstract_controller/translation.rb +2 -0
- data/lib/types/rails/action_controller/base.rb +3 -0
- data/lib/types/rails/action_controller/instrumentation.rb +6 -0
- data/lib/types/rails/action_controller/metal.rb +3 -0
- data/lib/types/rails/action_controller/mime_responds.rb +13 -0
- data/lib/types/rails/action_controller/parameters.rb +3 -0
- data/lib/types/{rails-5.x → rails}/action_controller/strong_parameters.rb +4 -8
- data/lib/types/rails/action_dispatch/flashhash.rb +8 -0
- data/lib/types/rails/action_dispatch/routing.rb +10 -0
- data/lib/types/rails/action_mailer/base.rb +2 -0
- data/lib/types/rails/action_mailer/message_delivery.rb +2 -0
- data/lib/types/rails/action_view/helpers_sanitizehelper.rb +2 -0
- data/lib/types/rails/action_view/helpers_urlhelper.rb +5 -0
- data/lib/types/rails/active_model/errors.rb +14 -0
- data/lib/types/rails/active_model/validations.rb +2 -0
- data/lib/types/rails/active_record/associations.rb +208 -0
- data/lib/types/rails/active_record/base.rb +2 -0
- data/lib/types/rails/active_record/core.rb +2 -0
- data/lib/types/rails/active_record/finder_methods.rb +2 -0
- data/lib/types/rails/active_record/model_schema.rb +37 -0
- data/lib/types/rails/active_record/relation.rb +11 -0
- data/lib/types/rails/active_record/schema_types.rb +51 -0
- data/lib/types/rails/active_record/validations.rb +2 -0
- data/lib/types/rails/active_support/base.rb +2 -0
- data/lib/types/rails/active_support/logger.rb +3 -0
- data/lib/types/rails/active_support/tagged_logging.rb +2 -0
- data/lib/types/rails/active_support/time_with_zone.rb +13 -0
- data/lib/types/rails/active_support/time_zone.rb +2 -0
- data/lib/types/rails/fixnum.rb +2 -0
- data/lib/types/rails/integer.rb +2 -0
- data/lib/types/rails/rack/request.rb +2 -0
- data/lib/types/rails/string.rb +3 -0
- data/lib/types/rails/time.rb +1 -0
- data/rdl.gemspec +2 -2
- data/test/disabled_test_rdoc.rb +8 -8
- data/test/test_alias.rb +1 -0
- data/test/test_dsl.rb +4 -4
- data/test/test_generic.rb +45 -38
- data/test/test_intersection.rb +10 -10
- data/test/test_le.rb +103 -102
- data/test/test_member.rb +33 -33
- data/test/test_parser.rb +101 -96
- data/test/test_query.rb +84 -84
- data/test/test_rdl.rb +87 -52
- data/test/test_rdl_type.rb +26 -9
- data/test/test_type_contract.rb +32 -31
- data/test/test_typecheck.rb +802 -436
- data/test/test_types.rb +39 -39
- data/test/test_wrap.rb +3 -2
- metadata +91 -120
- data/extras/type_tests/%.rb +0 -171
- data/extras/type_tests/&.rb +0 -159
- data/extras/type_tests/**.rb +0 -222
- data/extras/type_tests/*.rb +0 -177
- data/extras/type_tests/+.rb +0 -170
- data/extras/type_tests/-.rb +0 -171
- data/extras/type_tests/1scomp.rb +0 -157
- data/extras/type_tests/<.rb +0 -170
- data/extras/type_tests/<<.rb +0 -159
- data/extras/type_tests/>>.rb +0 -159
- data/extras/type_tests/[].rb +0 -163
- data/extras/type_tests/^.rb +0 -159
- data/extras/type_tests/abs.rb +0 -155
- data/extras/type_tests/abs2.rb +0 -164
- data/extras/type_tests/angle.rb +0 -157
- data/extras/type_tests/arg.rb +0 -157
- data/extras/type_tests/bit_length.rb +0 -157
- data/extras/type_tests/ceil.rb +0 -157
- data/extras/type_tests/ceilRational.rb +0 -160
- data/extras/type_tests/conj.rb +0 -158
- data/extras/type_tests/defwhere.rb +0 -86
- data/extras/type_tests/denominator.rb +0 -157
- data/extras/type_tests/div.rb +0 -172
- data/extras/type_tests/divslash.rb +0 -179
- data/extras/type_tests/even?.rb +0 -157
- data/extras/type_tests/fdiv.rb +0 -244
- data/extras/type_tests/finite?.rb +0 -157
- data/extras/type_tests/floor.rb +0 -157
- data/extras/type_tests/floorRational.rb +0 -161
- data/extras/type_tests/hash.rb +0 -157
- data/extras/type_tests/imag.rb +0 -158
- data/extras/type_tests/infinite?.rb +0 -157
- data/extras/type_tests/modulo.rb +0 -171
- data/extras/type_tests/nan?.rb +0 -157
- data/extras/type_tests/neg.rb +0 -155
- data/extras/type_tests/next.rb +0 -157
- data/extras/type_tests/next_float.rb +0 -157
- data/extras/type_tests/numerator.rb +0 -157
- data/extras/type_tests/phase.rb +0 -157
- data/extras/type_tests/prev_float.rb +0 -157
- data/extras/type_tests/quo.rb +0 -179
- data/extras/type_tests/rationalize.rb +0 -157
- data/extras/type_tests/rationalizeArg.rb +0 -198
- data/extras/type_tests/real.rb +0 -157
- data/extras/type_tests/real?.rb +0 -157
- data/extras/type_tests/round.rb +0 -157
- data/extras/type_tests/roundArg.rb +0 -169
- data/extras/type_tests/size.rb +0 -157
- data/extras/type_tests/to_c.rb +0 -157
- data/extras/type_tests/to_f.rb +0 -155
- data/extras/type_tests/to_i.rb +0 -157
- data/extras/type_tests/to_r.rb +0 -157
- data/extras/type_tests/to_s.rb +0 -157
- data/extras/type_tests/truncate.rb +0 -157
- data/extras/type_tests/truncateArg.rb +0 -166
- data/extras/type_tests/type tests +0 -1
- data/extras/type_tests/zero?.rb +0 -155
- data/extras/type_tests/|.rb +0 -159
- data/lib/types/core-ruby-2.x/_aliases.rb +0 -15
- data/lib/types/core-ruby-2.x/abbrev.rb +0 -5
- data/lib/types/core-ruby-2.x/array.rb +0 -137
- data/lib/types/core-ruby-2.x/base64.rb +0 -10
- data/lib/types/core-ruby-2.x/basic_object.rb +0 -14
- data/lib/types/core-ruby-2.x/benchmark.rb +0 -11
- data/lib/types/core-ruby-2.x/bigdecimal.rb +0 -224
- data/lib/types/core-ruby-2.x/bigmath.rb +0 -12
- data/lib/types/core-ruby-2.x/bignum.rb +0 -214
- data/lib/types/core-ruby-2.x/class.rb +0 -17
- data/lib/types/core-ruby-2.x/complex.rb +0 -124
- data/lib/types/core-ruby-2.x/coverage.rb +0 -6
- data/lib/types/core-ruby-2.x/csv.rb +0 -5
- data/lib/types/core-ruby-2.x/date.rb +0 -6
- data/lib/types/core-ruby-2.x/dir.rb +0 -38
- data/lib/types/core-ruby-2.x/encoding.rb +0 -23
- data/lib/types/core-ruby-2.x/enumerable.rb +0 -98
- data/lib/types/core-ruby-2.x/enumerator.rb +0 -26
- data/lib/types/core-ruby-2.x/exception.rb +0 -17
- data/lib/types/core-ruby-2.x/file.rb +0 -126
- data/lib/types/core-ruby-2.x/fileutils.rb +0 -6
- data/lib/types/core-ruby-2.x/fixnum.rb +0 -213
- data/lib/types/core-ruby-2.x/float.rb +0 -199
- data/lib/types/core-ruby-2.x/gem.rb +0 -247
- data/lib/types/core-ruby-2.x/hash.rb +0 -72
- data/lib/types/core-ruby-2.x/integer.rb +0 -197
- data/lib/types/core-ruby-2.x/io.rb +0 -103
- data/lib/types/core-ruby-2.x/kernel.rb +0 -90
- data/lib/types/core-ruby-2.x/marshal.rb +0 -5
- data/lib/types/core-ruby-2.x/matchdata.rb +0 -26
- data/lib/types/core-ruby-2.x/math.rb +0 -53
- data/lib/types/core-ruby-2.x/module.rb +0 -83
- data/lib/types/core-ruby-2.x/nil.rb +0 -12
- data/lib/types/core-ruby-2.x/numeric.rb +0 -56
- data/lib/types/core-ruby-2.x/object.rb +0 -75
- data/lib/types/core-ruby-2.x/pathname.rb +0 -106
- data/lib/types/core-ruby-2.x/proc.rb +0 -16
- data/lib/types/core-ruby-2.x/process.rb +0 -127
- data/lib/types/core-ruby-2.x/random.rb +0 -17
- data/lib/types/core-ruby-2.x/range.rb +0 -39
- data/lib/types/core-ruby-2.x/rational.rb +0 -209
- data/lib/types/core-ruby-2.x/regexp.rb +0 -30
- data/lib/types/core-ruby-2.x/set.rb +0 -58
- data/lib/types/core-ruby-2.x/string.rb +0 -143
- data/lib/types/core-ruby-2.x/strscan.rb +0 -7
- data/lib/types/core-ruby-2.x/symbol.rb +0 -29
- data/lib/types/core-ruby-2.x/time.rb +0 -68
- data/lib/types/core-ruby-2.x/uri.rb +0 -20
- data/lib/types/core-ruby-2.x/yaml.rb +0 -5
- data/lib/types/rails-5.x/_helpers.rb +0 -52
- data/lib/types/rails-5.x/action_controller/mime_responds.rb +0 -11
- data/lib/types/rails-5.x/action_dispatch/routing.rb +0 -10
- data/lib/types/rails-5.x/active_model/errors.rb +0 -15
- data/lib/types/rails-5.x/active_model/validations.rb +0 -5
- data/lib/types/rails-5.x/active_record/associations.rb +0 -190
- data/lib/types/rails-5.x/active_record/core.rb +0 -3
- data/lib/types/rails-5.x/active_record/model_schema.rb +0 -39
- data/lib/types/rails-5.x/fixnum.rb +0 -3
@@ -0,0 +1,19 @@
|
|
1
|
+
RDL.nowrap :Gem
|
2
|
+
|
3
|
+
RDL.type :Gem, 'self.bin_path', '(String name, ?String exec_name, *Gem::Requirement requirements) -> String'
|
4
|
+
RDL.type :Gem, 'self.binary_mode', '() -> String'
|
5
|
+
RDL.type :Gem, 'self.bindir', '(?String install_dir) -> String'
|
6
|
+
RDL.type :Gem, 'self.clear_default_specs', '() -> Hash'
|
7
|
+
RDL.type :Gem, 'self.clear_paths', '() -> nil'
|
8
|
+
RDL.type :Gem, 'self.config_file', '() -> String'
|
9
|
+
RDL.type :Gem, 'self.configuration', '() -> Gem::ConfigFile'
|
10
|
+
RDL.type :Gem, 'self.configuration=', '(%any) -> %any' #returns param
|
11
|
+
RDL.type :Gem, 'self.datadir', '(String gem_name) -> String or nil'
|
12
|
+
RDL.type :Gem, 'self.default_bindir', '() -> String or nil'
|
13
|
+
RDL.type :Gem, 'self.default_cert_path', '() -> String or nil'
|
14
|
+
RDL.type :Gem, 'self.default_dir', '() -> String or nil'
|
15
|
+
RDL.type :Gem, 'self.default_exec_format', '() -> String or nil'
|
16
|
+
RDL.type :Gem, 'self.default_key_path', '() -> String or nil'
|
17
|
+
RDL.type :Gem, 'self.default_path', '() -> String or nil'
|
18
|
+
RDL.type :Gem, 'self.default_rubygems_dirs', '() -> Array<String> or nil'
|
19
|
+
RDL.type :Gem, 'self.default_sources', '() -> Array<String> or nil'
|
@@ -0,0 +1,72 @@
|
|
1
|
+
RDL.nowrap :Hash
|
2
|
+
|
3
|
+
RDL.type_params :Hash, [:k, :v], :all?
|
4
|
+
|
5
|
+
RDL.type :Hash, 'self.[]', '(*u) -> Hash<u, u>' # example: Hash[1,2,3,4]
|
6
|
+
RDL.type :Hash, 'self.[]', '(Array<[a,b]>) -> Hash<a, b>'
|
7
|
+
RDL.type :Hash, 'self.[]', '([to_hash: () -> Hash<a, b>]) -> Hash<a, b>'
|
8
|
+
|
9
|
+
RDL.type :Hash, :[], '(k) -> v'
|
10
|
+
RDL.type :Hash, :[]=, '(k, v) -> v'
|
11
|
+
RDL.type :Hash, :store, '(k,v) -> v'
|
12
|
+
|
13
|
+
# RDL.type :Hash, :assoc, '(k) -> [k, v]' # TODO
|
14
|
+
RDL.type :Hash, :assoc, '(k) -> Array<k or v>'
|
15
|
+
RDL.type :Hash, :clear, '() -> Hash<k,v>'
|
16
|
+
RDL.type :Hash, :compare_by_identity, '() -> Hash<k,v>'
|
17
|
+
RDL.type :Hash, :compare_by_identity?, '() -> %bool'
|
18
|
+
RDL.type :Hash, :default, '(?k) -> v'
|
19
|
+
RDL.type :Hash, :default, '(k) {(k) -> v} -> v'
|
20
|
+
RDL.type :Hash, :default=, '(v) -> v'
|
21
|
+
|
22
|
+
# TODO: check on default_proc
|
23
|
+
# RDL.type :Hash, :default_proc, '() -> (Hash<k,v>,k) -> v'
|
24
|
+
# RDL.type :Hash, :default_proc=, '((Hash<k,v>,k) -> v) -> (Hash<k,v>,k) -> v'
|
25
|
+
|
26
|
+
RDL.type :Hash, :delete, '(k) -> v'
|
27
|
+
RDL.type :Hash, :delete, '(k) { (k) -> u } -> u or v'
|
28
|
+
RDL.type :Hash, :delete_if, '() { (k,v) -> %bool } -> Hash<k,v>'
|
29
|
+
RDL.type :Hash, :delete_if, '() -> Enumerator<[k, v]>'
|
30
|
+
RDL.type :Hash, :each, '() { (k,v) -> %any } -> Hash<k,v>'
|
31
|
+
RDL.type :Hash, :each, '() -> Enumerator<[k, v]>'
|
32
|
+
RDL.type :Hash, :each_pair, '() { (k,v) -> %any } -> Hash<k,v>'
|
33
|
+
RDL.type :Hash, :each_pair, '() -> Enumerator<[k, v]>'
|
34
|
+
RDL.type :Hash, :each_key, '() { (k) -> %any } -> Hash<k,v>'
|
35
|
+
RDL.type :Hash, :each_key, '() -> Enumerator<[k, v]>'
|
36
|
+
RDL.type :Hash, :each_value, '() { (v) -> %any } -> Hash<k,v>'
|
37
|
+
RDL.type :Hash, :each_value, '() -> Enumerator<[k, v]>'
|
38
|
+
RDL.type :Hash, :empty?, '() -> %bool'
|
39
|
+
RDL.type :Hash, :fetch, '(k) -> v'
|
40
|
+
RDL.type :Hash, :fetch, '(k,u) -> u or v'
|
41
|
+
RDL.type :Hash, :fetch, '(k) { (k) -> u } -> u or v'
|
42
|
+
RDL.type :Hash, :member?, '(t) -> %bool'
|
43
|
+
RDL.type :Hash, :has_key?, '(t) -> %bool'
|
44
|
+
RDL.type :Hash, :key?, '(t) -> %bool'
|
45
|
+
RDL.type :Hash, :has_value?, '(t) -> %bool'
|
46
|
+
RDL.type :Hash, :value?, '(t) -> %bool'
|
47
|
+
RDL.type :Hash, :to_s, '() -> String'
|
48
|
+
RDL.type :Hash, :inspect, '() -> String'
|
49
|
+
RDL.type :Hash, :invert, '() -> Hash<v,k>'
|
50
|
+
RDL.type :Hash, :keep_if, '() { (k,v) -> %bool } -> Hash<k,v>'
|
51
|
+
RDL.type :Hash, :keep_if, '() -> Enumerator<[k, v]>'
|
52
|
+
RDL.type :Hash, :key, '(t) -> k'
|
53
|
+
RDL.type :Hash, :keys, '() -> Array<k>'
|
54
|
+
RDL.type :Hash, :length, '() -> Integer'
|
55
|
+
RDL.type :Hash, :size, '() -> Integer'
|
56
|
+
RDL.type :Hash, :merge, '(Hash<a,b>) -> Hash<a or k, b or v>'
|
57
|
+
RDL.type :Hash, :merge, '(Hash<a,b>) { (k,v,b) -> v or b } -> Hash<a or k, b or v>'
|
58
|
+
# RDL.type :Hash, :rassoc, '(k) -> Tuple<k,v>'
|
59
|
+
RDL.type :Hash, :rassoc, '(k) -> Array<k or v>'
|
60
|
+
RDL.type :Hash, :rehash, '() -> Hash<k,v>'
|
61
|
+
RDL.type :Hash, :reject, '() -> Enumerator<[k, v]>'
|
62
|
+
RDL.type :Hash, :reject, '() {(k,v) -> %bool} -> Hash<k,v>'
|
63
|
+
RDL.type :Hash, :reject!, '() {(k,v) -> %bool} -> Hash<k,v>'
|
64
|
+
RDL.type :Hash, :select, '() {(k,v) -> %bool} -> Hash<k,v>'
|
65
|
+
RDL.type :Hash, :select!, '() {(k,v) -> %bool} -> Hash<k,v>'
|
66
|
+
# RDL.type :Hash, :shift, '() -> Tuple<k,v>'
|
67
|
+
RDL.type :Hash, :shift, '() -> Array<k or v>'
|
68
|
+
# RDL.type :Hash, :to_a, '() -> Array<Tuple<k,v>>'
|
69
|
+
RDL.type :Hash, :to_a, '() -> Array<Array<k or v>>'
|
70
|
+
RDL.type :Hash, :to_hash, '() -> Hash<k,v>'
|
71
|
+
RDL.type :Hash, :values, '() -> Array<v>'
|
72
|
+
RDL.type :Hash, :values_at, '(*k) -> Array<v>'
|
@@ -0,0 +1,194 @@
|
|
1
|
+
RDL.nowrap :Integer
|
2
|
+
|
3
|
+
RDL.type :Integer, :%, '(Integer x {{ x!=0 }}) -> Integer'
|
4
|
+
RDL.type :Integer, :%, '(Float x {{ x!=0 }}) -> Float'
|
5
|
+
RDL.type :Integer, :%, '(Rational x {{ x!=0 }}) -> Rational'
|
6
|
+
RDL.type :Integer, :%, '(BigDecimal x {{ x!=0 }}) -> BigDecimal'
|
7
|
+
|
8
|
+
RDL.type :Integer, :&, '(Integer) -> Integer'
|
9
|
+
|
10
|
+
RDL.type :Integer, :*, '(Integer) -> Integer'
|
11
|
+
RDL.type :Integer, :*, '(Float) -> Float'
|
12
|
+
RDL.type :Integer, :*, '(Rational) -> Rational'
|
13
|
+
RDL.type :Integer, :*, '(BigDecimal) -> BigDecimal'
|
14
|
+
RDL.type :Integer, :*, '(Complex) -> Complex'
|
15
|
+
RDL.pre(:Integer, :*) { |x| if (x.real.is_a?(BigDecimal)||x.imaginary.is_a?(BigDecimal)) then (if x.real.is_a?(Float) then (x.real!=Float::INFINITY && !(x.real.nan?)) elsif(x.imaginary.is_a?(Float)) then x.imaginary!=Float::INFINITY && !(x.imaginary.nan?) else true end) else true end} #can't have a complex with part BigDecimal, other part infinity/NAN
|
16
|
+
|
17
|
+
RDL.type :Integer, :**, '(Integer) -> %numeric'
|
18
|
+
RDL.type :Integer, :**, '(Float) -> %numeric'
|
19
|
+
RDL.type :Integer, :**, '(Rational) -> %numeric'
|
20
|
+
RDL.type :Integer, :**, '(BigDecimal) -> BigDecimal'
|
21
|
+
RDL.pre(:Integer, :**) { |x| x!=BigDecimal::INFINITY && if self<0 then x<=-1||x>=0 else true end}
|
22
|
+
RDL.post(:Integer, :**) { |r,x| r.real?}
|
23
|
+
RDL.type :Integer, :**, '(Complex) -> Complex'
|
24
|
+
RDL.pre(:Integer, :**) { |x| x!=0 && if (x.real.is_a?(BigDecimal)||x.imaginary.is_a?(BigDecimal)) then (if x.real.is_a?(Float) then (x.real!=Float::INFINITY && !(x.real.nan?)) elsif(x.imaginary.is_a?(Float)) then x.imaginary!=Float::INFINITY && !(x.imaginary.nan?) else true end) else true end}
|
25
|
+
|
26
|
+
RDL.type :Integer, :+, '(Integer) -> Integer'
|
27
|
+
RDL.type :Integer, :+, '(Float) -> Float'
|
28
|
+
RDL.type :Integer, :+, '(Rational) -> Rational'
|
29
|
+
RDL.type :Integer, :+, '(BigDecimal) -> BigDecimal'
|
30
|
+
RDL.type :Integer, :+, '(Complex) -> Complex'
|
31
|
+
|
32
|
+
RDL.type :Integer, :-, '(Integer) -> Integer'
|
33
|
+
RDL.type :Integer, :-, '(Float) -> Float'
|
34
|
+
RDL.type :Integer, :-, '(Rational) -> Rational'
|
35
|
+
RDL.type :Integer, :-, '(BigDecimal) -> BigDecimal'
|
36
|
+
RDL.type :Integer, :-, '(Complex) -> Complex'
|
37
|
+
|
38
|
+
RDL.type :Integer, :-@, '() -> Integer'
|
39
|
+
|
40
|
+
RDL.type :Integer, :+@, '() -> Integer'
|
41
|
+
|
42
|
+
RDL.type :Integer, :/, '(Integer x {{ x!=0 }}) -> Integer'
|
43
|
+
RDL.type :Integer, :/, '(Float x {{ x!=0 }}) -> Float'
|
44
|
+
RDL.type :Integer, :/, '(Rational x {{ x!=0 }}) -> Rational'
|
45
|
+
RDL.type :Integer, :/, '(BigDecimal x {{ x!=0 }}) -> BigDecimal'
|
46
|
+
RDL.type :Integer, :/, '(Complex x {{ x!=0 }}) -> Complex'
|
47
|
+
RDL.pre(:Integer, :/) { |x| x!=0 && if (x.real.is_a?(BigDecimal)||x.imaginary.is_a?(BigDecimal)) then (if x.real.is_a?(Float) then (x.real!=Float::INFINITY && !(x.real.nan?)) elsif(x.imaginary.is_a?(Float)) then x.imaginary!=Float::INFINITY && !(x.imaginary.nan?) else true end) else true end && if (x.real.is_a?(Rational) && x.imaginary.is_a?(Float)) then !x.imaginary.nan? else true end}
|
48
|
+
|
49
|
+
RDL.type :Integer, :<, '(Integer) -> %bool'
|
50
|
+
RDL.type :Integer, :<, '(Float) -> %bool'
|
51
|
+
RDL.type :Integer, :<, '(Rational) -> %bool'
|
52
|
+
RDL.type :Integer, :<, '(BigDecimal) -> %bool'
|
53
|
+
|
54
|
+
RDL.type :Integer, :<<, '(Integer) -> Integer'
|
55
|
+
|
56
|
+
RDL.type :Integer, :<=, '(Integer) -> %bool'
|
57
|
+
RDL.type :Integer, :<=, '(Float) -> %bool'
|
58
|
+
RDL.type :Integer, :<=, '(Rational) -> %bool'
|
59
|
+
RDL.type :Integer, :<=, '(BigDecimal) -> %bool'
|
60
|
+
|
61
|
+
RDL.type :Integer, :<=>, '(Integer) -> Object'
|
62
|
+
RDL.post(:Integer, :<=>) { |r,x| r == -1 || r == 0 || r == 1 }
|
63
|
+
RDL.type :Integer, :<=>, '(Float) -> Object'
|
64
|
+
RDL.post(:Integer, :<=>) { |r,x| r == -1 || r == 0 || r == 1 }
|
65
|
+
RDL.type :Integer, :<=>, '(Rational) -> Object'
|
66
|
+
RDL.post(:Integer, :<=>) { |r,x| r == -1 || r == 0 || r == 1 }
|
67
|
+
RDL.type :Integer, :<=>, '(BigDecimal) -> Object'
|
68
|
+
RDL.post(:Integer, :<=>) { |r,x| r == -1 || r == 0 || r == 1 }
|
69
|
+
|
70
|
+
RDL.type :Integer, :==, '(Object) -> %bool'
|
71
|
+
|
72
|
+
RDL.type :Integer, :===, '(Object) -> %bool'
|
73
|
+
|
74
|
+
RDL.type :Integer, :>, '(Integer) -> %bool'
|
75
|
+
RDL.type :Integer, :>, '(Float) -> %bool'
|
76
|
+
RDL.type :Integer, :>, '(Rational) -> %bool'
|
77
|
+
RDL.type :Integer, :>, '(BigDecimal) -> %bool'
|
78
|
+
|
79
|
+
RDL.type :Integer, :>=, '(Integer) -> %bool'
|
80
|
+
RDL.type :Integer, :>=, '(Float) -> %bool'
|
81
|
+
RDL.type :Integer, :>=, '(Rational) -> %bool'
|
82
|
+
RDL.type :Integer, :>=, '(BigDecimal) -> %bool'
|
83
|
+
|
84
|
+
RDL.type :Integer, :>>, '(Integer) -> Integer r {{ r >= 0 }}'
|
85
|
+
|
86
|
+
RDL.type :Integer, :[], '(Integer) -> Integer'
|
87
|
+
RDL.post(:Integer, :[]) { |r,x| r == 0 || r==1}
|
88
|
+
RDL.type :Integer, :[], '(Rational) -> Integer'
|
89
|
+
RDL.post(:Integer, :[]) { |r,x| r == 0 || r==1}
|
90
|
+
RDL.type :Integer, :[], '(Float) -> Integer'
|
91
|
+
RDL.pre(:Integer, :[]) { |x| x != Float::INFINITY && !x.nan? }
|
92
|
+
RDL.post(:Integer, :[]) { |r,x| r == 0 || r==1}
|
93
|
+
RDL.type :Integer, :[], '(BigDecimal) -> Integer'
|
94
|
+
RDL.pre(:Integer, :[]) { |x| x != BigDecimal::INFINITY && !x.nan? }
|
95
|
+
RDL.post(:Integer, :[]) { |r,x| r == 0 || r == 1 }
|
96
|
+
|
97
|
+
RDL.type :Integer, :^, '(Integer) -> Integer'
|
98
|
+
|
99
|
+
RDL.type :Integer, :|, '(Integer) -> Integer'
|
100
|
+
|
101
|
+
RDL.type :Integer, :~, '() -> Integer'
|
102
|
+
|
103
|
+
RDL.type :Integer, :abs, '() -> Integer r {{ r>=0 }}'
|
104
|
+
|
105
|
+
RDL.type :Integer, :bit_length, '() -> Integer r {{ r>=0 }}'
|
106
|
+
|
107
|
+
RDL.type :Integer, :div, '(Integer x {{ x!=0 }}) -> Integer'
|
108
|
+
RDL.type :Integer, :div, '(Float x {{ x!=0 && !x.nan? }}) -> Integer'
|
109
|
+
RDL.type :Integer, :div, '(Rational x {{ x!=0 }}) -> Integer'
|
110
|
+
RDL.type :Integer, :div, '(BigDecimal x {{ x!=0 && !x.nan? }}) -> Integer'
|
111
|
+
|
112
|
+
RDL.type :Integer, :divmod, '(%real x {{ x!=0 }}) -> [%real, %real]'
|
113
|
+
RDL.pre(:Integer, :divmod) { |x| if x.is_a?(Float) then !x.nan? else true end}
|
114
|
+
|
115
|
+
RDL.type :Integer, :fdiv, '(Integer) -> Float'
|
116
|
+
RDL.type :Integer, :fdiv, '(Float) -> Float'
|
117
|
+
RDL.type :Integer, :fdiv, '(Rational) -> Float'
|
118
|
+
RDL.type :Integer, :fdiv, '(BigDecimal) -> BigDecimal'
|
119
|
+
RDL.type :Integer, :fdiv, '(Complex) -> Complex'
|
120
|
+
RDL.pre(:Integer, :fdiv) { |x| if (x.real.is_a?(BigDecimal)||x.imaginary.is_a?(BigDecimal)) then (if x.real.is_a?(Float) then (x.real!=Float::INFINITY && !(x.real.nan?)) elsif(x.imaginary.is_a?(Float)) then x.imaginary!=Float::INFINITY && !(x.imaginary.nan?) else true end) else true end && if (x.real.is_a?(Rational) && x.imaginary.is_a?(Float)) then !x.imaginary.nan? else true end}
|
121
|
+
|
122
|
+
RDL.type :Integer, :to_s, '() -> String'
|
123
|
+
RDL.type :Integer, :inspect, '() -> String'
|
124
|
+
|
125
|
+
RDL.type :Integer, :magnitude, '() -> Integer r {{ r>=0 }}'
|
126
|
+
|
127
|
+
RDL.type :Integer, :modulo, '(Integer x {{ x!=0 }}) -> Integer'
|
128
|
+
RDL.type :Integer, :modulo, '(Float x {{ x!=0 }}) -> Float'
|
129
|
+
RDL.type :Integer, :modulo, '(Rational x {{ x!=0 }}) -> Rational'
|
130
|
+
RDL.type :Integer, :modulo, '(BigDecimal x {{ x!=0 }}) -> BigDecimal'
|
131
|
+
|
132
|
+
RDL.type :Integer, :quo, '(Integer x {{ x!=0 }}) -> Rational'
|
133
|
+
RDL.type :Integer, :quo, '(Float x {{ x!=0 }}) -> Float'
|
134
|
+
RDL.type :Integer, :quo, '(Rational x {{ x!=0 }}) -> Rational'
|
135
|
+
RDL.type :Integer, :quo, '(BigDecimal x {{ x!=0 }}) -> BigDecimal'
|
136
|
+
RDL.type :Integer, :quo, '(Complex x {{ x!=0 }}) -> Complex'
|
137
|
+
RDL.pre(:Integer, :quo) { |x| if (x.real.is_a?(BigDecimal)||x.imaginary.is_a?(BigDecimal)) then (if x.real.is_a?(Float) then (x.real!=Float::INFINITY && !(x.real.nan?)) elsif(x.imaginary.is_a?(Float)) then x.imaginary!=Float::INFINITY && !(x.imaginary.nan?) else true end) else true end && if (x.real.is_a?(Rational) && x.imaginary.is_a?(Float)) then !x.imaginary.nan? else true end}
|
138
|
+
|
139
|
+
RDL.type :Integer, :abs2, '() -> Integer r {{ r>=0 }}'
|
140
|
+
RDL.type :Integer, :angle, '() -> %numeric'
|
141
|
+
RDL.post(:Integer, :angle) { |r,x| r == 0 || r == Math::PI}
|
142
|
+
RDL.type :Integer, :arg, '() -> %numeric'
|
143
|
+
RDL.post(:Integer, :arg) { |r,x| r == 0 || r == Math::PI}
|
144
|
+
RDL.type :Integer, :equal?, '(Object) -> %bool'
|
145
|
+
RDL.type :Integer, :eql?, '(Object) -> %bool'
|
146
|
+
RDL.type :Integer, :hash, '() -> Integer'
|
147
|
+
RDL.type :Integer, :ceil, '() -> Integer'
|
148
|
+
RDL.type :Integer, :chr, '(Encoding) -> String'
|
149
|
+
RDL.type :Integer, :coerce, '(%numeric) -> [%real, %real]'
|
150
|
+
RDL.pre(:Integer, :coerce) { |x| if x.is_a?(Complex) then x.imaginary==0 else true end}
|
151
|
+
RDL.type :Integer, :conj, '() -> Integer'
|
152
|
+
RDL.type :Integer, :conjugate, '() -> Integer'
|
153
|
+
RDL.type :Integer, :denominator, '() -> Integer'
|
154
|
+
RDL.post(:Integer, :denominator) { |r,x| r == 1 }
|
155
|
+
RDL.type :Integer, :downto, '(Integer) { (Integer) -> %any } -> Integer'
|
156
|
+
RDL.type :Integer, :downto, '(Integer limit) -> Enumerator<Integer>'
|
157
|
+
RDL.type :Integer, :even?, '() -> %bool'
|
158
|
+
RDL.type :Integer, :gcd, '(Integer) -> Integer'
|
159
|
+
RDL.type :Integer, :gcdlcm, '(Integer) -> [Integer, Integer]'
|
160
|
+
RDL.type :Integer, :floor, '() -> Integer'
|
161
|
+
RDL.type :Integer, :imag, '() -> Integer r {{ r==0 }}'
|
162
|
+
RDL.type :Integer, :imaginary, '() -> Integer r {{ r==0 }}'
|
163
|
+
RDL.type :Integer, :integer?, '() -> true'
|
164
|
+
RDL.type :Integer, :lcm, '(Integer) -> Integer'
|
165
|
+
RDL.type :Integer, :next, '() -> Integer'
|
166
|
+
RDL.type :Integer, :numerator, '() -> Integer'
|
167
|
+
RDL.type :Integer, :odd?, '() -> %bool'
|
168
|
+
RDL.type :Integer, :ord, '() -> Integer'
|
169
|
+
RDL.type :Integer, :phase, '() -> %numeric'
|
170
|
+
RDL.type :Integer, :pred, '() -> Integer'
|
171
|
+
RDL.type :Integer, :rationalize, '() -> Rational'
|
172
|
+
RDL.type :Integer, :rationalize, '(%numeric) -> Rational'
|
173
|
+
RDL.type :Integer, :real, '() -> Integer'
|
174
|
+
RDL.type :Integer, :real?, '() -> true'
|
175
|
+
RDL.type :Integer, :remainder, '(Integer x {{ x!=0 }}) -> Integer r {{ r>=0 }}'
|
176
|
+
RDL.type :Integer, :remainder, '(Float x {{ x!=0 }}) -> Float'
|
177
|
+
RDL.type :Integer, :remainder, '(Rational x {{ x!=0 }}) -> Rational r {{ r>=0 }}'
|
178
|
+
RDL.type :Integer, :remainder, '(BigDecimal x {{ x!=0 }}) -> BigDecimal'
|
179
|
+
RDL.type :Integer, :round, '() -> Integer'
|
180
|
+
RDL.type :Integer, :round, '(%numeric) -> %numeric'
|
181
|
+
RDL.pre(:Integer, :round) { |x| x!=0 && if x.is_a?(Complex) then x.imaginary==0 && (if x.real.is_a?(Float)||x.real.is_a?(BigDecimal) then !x.real.infinite? && !x.real.nan? else true end) elsif x.is_a?(Float) then x!=Float::INFINITY && !x.nan? elsif x.is_a?(BigDecimal) then x!=BigDecimal::INFINITY && !x.nan? else true end} #Also, x must be in range [-2**31, 2**31].
|
182
|
+
RDL.type :Integer, :size, '() -> Integer'
|
183
|
+
RDL.type :Integer, :succ, '() -> Integer'
|
184
|
+
RDL.type :Integer, :times, '() { (Integer) -> %any } -> Integer'
|
185
|
+
RDL.type :Integer, :times, '() -> Enumerator<Integer>'
|
186
|
+
RDL.type :Integer, :to_c, '() -> Complex r {{ r.imaginary==0 }}'
|
187
|
+
RDL.type :Integer, :to_f, '() -> Float'
|
188
|
+
RDL.type :Integer, :to_i, '() -> Integer'
|
189
|
+
RDL.type :Integer, :to_int, '() -> Integer'
|
190
|
+
RDL.type :Integer, :to_r, '() -> Rational'
|
191
|
+
RDL.type :Integer, :truncate, '() -> Integer'
|
192
|
+
RDL.type :Integer, :upto, '(Integer) { (Integer) -> %any } -> Integer'
|
193
|
+
RDL.type :Integer, :upto, '(Integer) -> Enumerator<Integer>'
|
194
|
+
RDL.type :Integer, :zero?, '() -> %bool'
|
@@ -0,0 +1,101 @@
|
|
1
|
+
RDL.nowrap :IO # Do not wrap this class. Leads to mysterious errors.
|
2
|
+
|
3
|
+
RDL.type :IO, :initialize, '(Integer fd, ?Integer mode, ?Integer opt) -> self'
|
4
|
+
RDL.type :IO, 'self.binread', '(String name, ?Integer length, ?Integer offset) -> String'
|
5
|
+
RDL.type :IO, 'self.binwrite', '(String name, String, ?Integer offset, %open_args) -> Integer'
|
6
|
+
RDL.type :IO, 'self.copy_stream', '(String or IO src, String or IO dst, ?Integer copy_length, ?Integer src_offset) -> Integer'
|
7
|
+
RDL.rdl_alias :IO, 'self.for_fd', 'initialize'
|
8
|
+
RDL.type :IO, 'self.foreach', '(String name, ?String sep, ?Integer limit, %open_args) { (String) -> %any } -> nil'
|
9
|
+
RDL.type :IO, 'self.foreach', '(String name, ?String sep, ?Integer limit, %open_args) -> Enumerator<String>'
|
10
|
+
RDL.type :IO, 'self.open', '(Integer fd, ?String mode, %open_args) -> IO'
|
11
|
+
RDL.type :IO, 'self.open', '(Integer fd, ?String mode, %open_args) { (IO) -> t } -> t'
|
12
|
+
RDL.type :IO, 'self.pipe', '(?String ext_or_ext_int_enc, %open_args) -> [IO, IO]'
|
13
|
+
RDL.type :IO, 'self.pipe', '(?String ext_enc, ?String int_enc, %open_args) -> [IO, IO]'
|
14
|
+
RDL.type :IO, 'self.pipe', '(?String ext_or_ext_int_enc, %open_args) { ([IO, IO]) -> t } -> t'
|
15
|
+
RDL.type :IO, 'self.pipe', '(?String ext_enc, ?String int_enc, %open_args) { ([IO, IO]) -> t } -> t'
|
16
|
+
RDL.type :IO, 'self.popen', '(?Hash<String, String> env, String cmd, ?String mode, %open_args) -> IO'
|
17
|
+
RDL.type :IO, 'self.popen', '(?Hash<String, String> env, String cmd, ?String mode, %open_args) { (IO) -> t } -> t'
|
18
|
+
RDL.type :IO, 'self.read', '(String name, ?Integer length, ?Integer offset, %open_args) -> String'
|
19
|
+
RDL.type :IO, 'self.readlines', '(String name, ?String sep, ?Integer limit, %open_args) -> Array<String>'
|
20
|
+
RDL.type :IO, 'self.select', '(Array<IO> read_array, ?Array<IO> write_array, ?Array<IO> error_array, ?Integer timeout) -> Array<IO> or nil'
|
21
|
+
RDL.type :IO, 'self.sysopen', '(String path, ?String mode, ?String perm) -> Integer' # TODO unsure of RDL.type of perm
|
22
|
+
RDL.type :IO, 'self.try_convert', '([to_io: () -> IO]) -> IO or nil'
|
23
|
+
RDL.type :IO, 'self.write', '(String name, String, ?Integer offset, %open_args) -> Integer'
|
24
|
+
RDL.type :IO, :<<, '([to_s: () -> String]) -> self'
|
25
|
+
RDL.type :IO, :advise, '(:normal or :sequence or :random or :willneed or :dontneed or :noreuse, ?Integer offset, ?Integer len) -> nil'
|
26
|
+
RDL.type :IO, :autoclose=, '(%bool) -> %bool'
|
27
|
+
RDL.type :IO, :autoclose?, '() -> %bool'
|
28
|
+
RDL.type :IO, :binmode, '() -> self'
|
29
|
+
RDL.type :IO, :binmode?, '() -> %bool'
|
30
|
+
RDL.rdl_alias :IO, :bytes, :each_byte # deprecated
|
31
|
+
RDL.rdl_alias :IO, :chars, :each_char # deprecated
|
32
|
+
RDL.type :IO, :close, '() -> nil'
|
33
|
+
RDL.type :IO, :close_on_exec=, '(%bool) -> %bool'
|
34
|
+
RDL.type :IO, :close_on_exec?, '() -> %bool'
|
35
|
+
RDL.type :IO, :close_read, '() -> nil'
|
36
|
+
RDL.type :IO, :close_write, '() -> nil'
|
37
|
+
RDL.type :IO, :closed?, '() -> %bool'
|
38
|
+
RDL.rdl_alias :IO, :codepoints, :each_codepoint # deprecated
|
39
|
+
RDL.type :IO, :each, '(?String sep, ?Integer limit) { (String) -> %any } -> self'
|
40
|
+
RDL.type :IO, :each, '(?String sep, ?Integer limit) -> Enumerator<String>'
|
41
|
+
RDL.rdl_alias :IO, :each_line, :each
|
42
|
+
RDL.type :IO, :each_byte, '() { (Integer) -> %any } -> self'
|
43
|
+
RDL.type :IO, :each_byte, '() -> Enumerator<Integer>'
|
44
|
+
RDL.type :IO, :each_char, '() { (String) -> %any } -> self'
|
45
|
+
RDL.type :IO, :each_char, '() -> Enumerator<String>'
|
46
|
+
RDL.type :IO, :each_codepoint, '() { (Integer) -> %any } -> self'
|
47
|
+
RDL.type :IO, :each_codepoint, '() -> Enumerator<Integer>'
|
48
|
+
RDL.type :IO, :eof, '() -> %bool'
|
49
|
+
RDL.rdl_alias :IO, :eof?, :eof
|
50
|
+
RDL.type :IO, :external_enconding, '() -> Enconding'
|
51
|
+
RDL.type :IO, :fcntl, '(Integer integer_cmd, String or Integer arg) -> Integer'
|
52
|
+
RDL.type :IO, :fdatasync, '() -> 0 or nil'
|
53
|
+
RDL.type :IO, :fileno, '() -> Integer'
|
54
|
+
RDL.type :IO, :flush, '() -> self'
|
55
|
+
RDL.type :IO, :fsync, '() -> 0 or nil'
|
56
|
+
RDL.type :IO, :getbyte, '() -> Integer or nil'
|
57
|
+
RDL.type :IO, :getc, '() -> String or nil'
|
58
|
+
RDL.type :IO, :gets, '(?String sep, ?Integer limit) -> String or nil'
|
59
|
+
RDL.type :IO, :inspect, '() -> String'
|
60
|
+
RDL.type :IO, :internal_encoding, '() -> Encoding'
|
61
|
+
RDL.type :IO, :ioctl, '(Integer integer_cmd, String or Integer arg) -> Integer'
|
62
|
+
RDL.type :IO, :isatty, '() -> %bool'
|
63
|
+
RDL.type :IO, :lineno, '() -> Integer'
|
64
|
+
RDL.type :IO, :lineno=, '(Integer) -> Integer'
|
65
|
+
RDL.rdl_alias :IO, :lines, :each_line # deprecated
|
66
|
+
RDL.type :IO, :pid, '() -> Integer'
|
67
|
+
RDL.type :IO, :pos, '() -> Integer'
|
68
|
+
RDL.type :IO, :pos=, '(Integer) -> Integer'
|
69
|
+
RDL.type :IO, :print, '(*[to_s: () -> String]) -> nil'
|
70
|
+
RDL.type :IO, :printf, '(String format_string, *%any) -> nil'
|
71
|
+
RDL.type :IO, :putc, '(Numeric or String) -> %any'
|
72
|
+
RDL.type :IO, :puts, '(*[to_s: () -> String]) -> nil'
|
73
|
+
RDL.type :IO, :read, '(?Integer length, ?String outbuf) -> String or nil'
|
74
|
+
RDL.type :IO, :read_nonblock, '(Integer maxlen) -> String'
|
75
|
+
RDL.type :IO, :read_nonblock, '(Integer maxlen, String outbuf) -> String outbuf'
|
76
|
+
RDL.type :IO, :readbyte, '() -> Integer'
|
77
|
+
RDL.type :IO, :readchar, '() -> String'
|
78
|
+
RDL.type :IO, :readline, '(?String sep, ?Integer limit) -> String'
|
79
|
+
RDL.type :IO, :readlines, '(?String sep, ?Integer limit) -> Array<String>'
|
80
|
+
RDL.type :IO, :readpartial, '(Integer maxlen) -> String'
|
81
|
+
RDL.type :IO, :readpartial, '(Integer maxlen, String outbuf) -> String outbuf'
|
82
|
+
RDL.type :IO, :reopen, '(IO other_IO) -> IO'
|
83
|
+
RDL.type :IO, :reopen, '(String path, String mode_str) -> IO'
|
84
|
+
RDL.type :IO, :rewrind, '() -> 0'
|
85
|
+
RDL.type :IO, :seek, '(Integer amount, ?Integer whence) -> 0'
|
86
|
+
RDL.type :IO, :set_encoding, '(?String or Encoding ext_or_ext_int_enc) -> self'
|
87
|
+
RDL.type :IO, :set_encoding, '(?String or Encoding ext_enc, ?String or Encoding int_enc) -> self'
|
88
|
+
RDL.type :IO, :stat, '() -> File::Stat'
|
89
|
+
RDL.type :IO, :sync, '() -> %bool'
|
90
|
+
RDL.type :IO, :sync=, '(%bool) -> %bool'
|
91
|
+
RDL.type :IO, :sysread, '(Integer maxlen, String outbuf) -> String'
|
92
|
+
RDL.type :IO, :sysseek, '(Integer amount, ?Integer whence) -> Integer'
|
93
|
+
RDL.type :IO, :syswrite, '(String) -> Integer'
|
94
|
+
RDL.type :IO, :tell, '() -> Integer'
|
95
|
+
RDL.rdl_alias :IO, :to_i, :fileno
|
96
|
+
RDL.type :IO, :to_io, '() -> self'
|
97
|
+
RDL.type :IO, :tty?, '() -> %bool'
|
98
|
+
RDL.type :IO, :ungetbyte, '(String or Integer) -> nil'
|
99
|
+
RDL.type :IO, :ungetc, '(String) -> nil'
|
100
|
+
RDL.type :IO, :write, '(String) -> Integer'
|
101
|
+
RDL.type :IO, :write_nonbloc, '(String, ?Integer options) -> Integer'
|
@@ -0,0 +1,89 @@
|
|
1
|
+
RDL.nowrap :Kernel
|
2
|
+
|
3
|
+
# RDL.type :Kernel, 'self.Array', '([to_ary: () -> Array<t>]) -> Array<t>'
|
4
|
+
# RDL.type :Kernel, 'self.Array', '([to_a: () -> Array<t>]) -> Array<t>'
|
5
|
+
RDL.type :Kernel, 'self.Complex', '(Numeric x, Numeric y) -> Complex'
|
6
|
+
RDL.type :Kernel, 'self.Complex', '(String x) -> Complex'
|
7
|
+
RDL.type :Kernel, 'self.Float', '(Numeric x) -> Float'
|
8
|
+
# RDL.type :Kernel, 'self.Float', '(x : [to_f : () -> Float]) -> Float'
|
9
|
+
# RDL.type :Kernel, 'self.Hash', '(x : [to_hash : () -> Hash<k,v>]) -> Hash<k,v>'
|
10
|
+
RDL.type :Kernel, 'self.Hash', '(nil x) -> Hash<k,v>'
|
11
|
+
# RDL.type :Kernel, 'self.Hash, '(x : []) -> Hash<k,v>'
|
12
|
+
RDL.type :Kernel, 'self.Integer', '(Numeric or String arg, ?Integer base) -> Integer'
|
13
|
+
# RDL.type :Kernel, 'self.Integer', '(arg : [to_int : () -> Integer], base : ?Integer) -> Integer'
|
14
|
+
# RDL.type :Kernel, 'self.Integer', '(arg : [to_i : () -> Integer], base : ?Integer) -> Integer'
|
15
|
+
RDL.type :Kernel, 'self.Rational', '(Numeric x, Numeric y) -> Rational'
|
16
|
+
RDL.type :Kernel, 'self.Rational', '(String x) -> Rational'
|
17
|
+
# RDL.type :Kernel, 'self.String', '(arg : [to_s : () -> String]) -> String'
|
18
|
+
RDL.type :Kernel, 'self.__callee__', '() -> Symbol or nil'
|
19
|
+
RDL.type :Kernel, 'self.__dir__', '() -> String or nil'
|
20
|
+
RDL.type :Kernel, 'self.__method__', '() -> Symbol or nil'
|
21
|
+
RDL.type :Kernel, 'self.`', '(String) -> String'
|
22
|
+
RDL.type :Kernel, 'self.abort', '(?String msg) -> %bot'
|
23
|
+
RDL.type :Kernel, 'self.at_exit', '() { () -> %any} -> Proc' # TODO: Fix proc
|
24
|
+
RDL.type :Kernel, 'self.autoload', '(String or Symbol module, String filename) -> nil'
|
25
|
+
RDL.type :Kernel, 'self.autoload?', '(Symbol or String name) -> String or nil'
|
26
|
+
RDL.type :Kernel, 'self.binding', '() -> Binding'
|
27
|
+
RDL.type :Kernel, 'self.block_given?', '() -> %bool'
|
28
|
+
RDL.type :Kernel, 'self.caller', '(?Integer start, ?Integer length) -> Array<String> or nil'
|
29
|
+
RDL.type :Kernel, 'self.caller', '(Range) -> Array<String> or nil'
|
30
|
+
RDL.type :Kernel, 'self.caller_locations', '(?Integer start, ?Integer length) -> Array<String> or nil'
|
31
|
+
RDL.type :Kernel, 'self.caller_locations', '(Range) -> Array<String> or nil'
|
32
|
+
# RDL.type :Kernel, 'self.catch' # TODO
|
33
|
+
RDL.type :Kernel, 'self.eval', '(String, ?Binding, ?String filename, ?Integer lineno) -> %any'
|
34
|
+
# RDL.type :Kernel, 'self.exec' #TODO
|
35
|
+
RDL.type :Kernel, 'self.exit', '() -> %bot'
|
36
|
+
RDL.type :Kernel, 'self.exit', '(Integer or %bool status) -> %bot'
|
37
|
+
RDL.type :Kernel, 'self.exit!', '(Integer or %bool status) -> %bot'
|
38
|
+
RDL.type :Kernel, 'self.fail', '() -> %bot'
|
39
|
+
RDL.type :Kernel, 'self.fail', '(String) -> %bot'
|
40
|
+
RDL.type :Kernel, 'self.fail', '(Class, Array<String>) -> %bot'
|
41
|
+
RDL.type :Kernel, 'self.fail', '(Class, String, Array<String>) -> %bot'
|
42
|
+
# RDL.type :Kernel, 'self.fail', '(String or [exception : () -> String], ?String, ?Array<String>) -> %any'
|
43
|
+
# RDL.type :Kernel, 'self.fork' #TODO
|
44
|
+
RDL.type :Kernel, 'self.format', '(String format, *%any args) -> String'
|
45
|
+
RDL.type :Kernel, 'self.gets', '(?String, ?Integer) -> String'
|
46
|
+
RDL.type :Kernel, 'self.global_variables', '() -> Array<Symbol>'
|
47
|
+
RDL.type :Kernel, 'self.iterator?', '() -> %bool'
|
48
|
+
# RDL.type :Kernel, 'self.lambda' # TODO
|
49
|
+
RDL.type :Kernel, 'self.load', '(String filename, ?%bool) -> %bool'
|
50
|
+
RDL.type :Kernel, 'self.local_variables', '() -> Array<Symbol>'
|
51
|
+
# RDL.type :Kernel, 'self.loop' #TODO
|
52
|
+
RDL.type :Kernel, 'self.open', '(String path, ?(String or Integer) mode, ?String perm) -> IO or nil'
|
53
|
+
# RDL.type :Kernel, 'self.open', '(String path, mode : ?String, perm: ?String) {(IO) -> %any)} -> %any' # TODO: returns block value
|
54
|
+
# RDL.type :Kernel, 'self.open', '(String path, mode : ?Integer, perm: ?String) {(IO) -> %any)} -> %any' # TODO: returns block value
|
55
|
+
# RDL.type :Kernel, 'self.p', '(*[inspect : () -> String]) -> nil'
|
56
|
+
# RDL.type :Kernel, 'self.print', '(*[to_s : () -> String] -> nil'
|
57
|
+
RDL.type :Kernel, 'self.printf', '(?IO, ?String, *%any) -> nil'
|
58
|
+
RDL.type :Kernel, :proc, '() {(*%any) -> %any} -> Proc' # TODO more precise
|
59
|
+
RDL.type :Kernel, 'self.putc', '(Integer) -> Integer'
|
60
|
+
RDL.type :Kernel, 'self.puts', '(*[to_s : () -> String]) -> nil'
|
61
|
+
RDL.type :Kernel, 'self.raise', '() -> %bot'
|
62
|
+
# RDL.type :Kernel, 'self.raise', '(String or [exception : () -> String], ?String, ?Array<String>) -> %any'
|
63
|
+
# TODO: above same as fail?
|
64
|
+
RDL.type :Kernel, 'self.rand', '(Integer or Range max) -> Numeric'
|
65
|
+
RDL.type :Kernel, 'self.readline', '(?String, ?Integer) -> String'
|
66
|
+
RDL.type :Kernel, 'self.readlines', '(?String, ?Integer) -> Array<String>'
|
67
|
+
RDL.type :Kernel, 'self.require', '(String name) -> %bool'
|
68
|
+
RDL.type :Kernel, 'self.require_relative', '(String name) -> %bool'
|
69
|
+
RDL.type :Kernel, 'self.select',
|
70
|
+
'(Array<IO> read, ?Array<IO> write, ?Array<IO> error, ?Integer timeout) -> Array<String>' # TODO: return RDL.type?
|
71
|
+
# RDL.type :Kernel, 'self.set_trace_func' #TODO
|
72
|
+
RDL.type :Kernel, 'self.sleep', '(Numeric duration) -> Integer'
|
73
|
+
# RDL.type :Kernel, 'self.spawn' #TODO
|
74
|
+
RDL.rdl_alias :Kernel, :sprintf, :format # TODO: are they aliases?
|
75
|
+
RDL.type :Kernel, 'self.srand', '(Numeric number) -> Numeric'
|
76
|
+
RDL.type :Kernel, 'self.syscall', '(Integer num, *%any args) -> %any' # TODO : ?
|
77
|
+
# RDL.type :Kernel, 'self.system' # TODO
|
78
|
+
RDL.type :Kernel, 'self.test', '(String cmd, String file1, ?String file2) -> %bool or Time' # TODO: better, dependent RDL.type?
|
79
|
+
# RDL.type :Kernel, 'self.throw' # TODO
|
80
|
+
# RDL.type :Kernel, 'self.trace_var' # TODO
|
81
|
+
# RDL.type :Kernel, 'self.trap' # TODO
|
82
|
+
# RDL.type :Kernel, 'self.untrace_var' # TODO
|
83
|
+
RDL.type :Kernel, 'self.warn', '(*String msg) -> nil'
|
84
|
+
RDL.type :Kernel, :clone, '() -> self'
|
85
|
+
RDL.type :Kernel, :raise, '() -> %bot'
|
86
|
+
RDL.type :Kernel, :raise, '(String) -> %bot'
|
87
|
+
RDL.type :Kernel, :raise, '(Class, String, Array<String>) -> %bot'
|
88
|
+
RDL.type :Kernel, :send, '(String or Symbol, *%any) -> %any'
|
89
|
+
RDL.type :Kernel, :send, '(String or Symbol, *%any) { (*%any) -> %any } -> %any'
|