script_core 0.1.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -0
- data/.rubocop.yml +8 -6
- data/.ruby-version +1 -1
- data/Gemfile +2 -1
- data/bin/sandbox +1 -1
- data/ext/enterprise_script_service/Rakefile +1 -1
- data/ext/enterprise_script_service/flags.rb +5 -0
- data/ext/enterprise_script_service/libseccomp/CHANGELOG +15 -0
- data/ext/enterprise_script_service/libseccomp/CREDITS +3 -0
- data/ext/enterprise_script_service/libseccomp/Makefile.am +1 -1
- data/ext/enterprise_script_service/libseccomp/README.md +1 -1
- data/ext/enterprise_script_service/libseccomp/SECURITY.md +45 -0
- data/ext/enterprise_script_service/libseccomp/configure.ac +3 -3
- data/ext/enterprise_script_service/libseccomp/doc/admin/MAINTAINER_PROCESS.md +95 -0
- data/ext/enterprise_script_service/libseccomp/{RELEASE_PROCESS.md → doc/admin/RELEASE_PROCESS.md} +9 -1
- data/ext/enterprise_script_service/libseccomp/include/Makefile.am +1 -1
- data/ext/enterprise_script_service/libseccomp/include/seccomp-syscalls.h +2292 -0
- data/ext/enterprise_script_service/libseccomp/include/seccomp.h.in +3 -1065
- data/ext/enterprise_script_service/libseccomp/src/arch-aarch64-syscalls.c +35 -3
- data/ext/enterprise_script_service/libseccomp/src/arch-arm-syscalls.c +35 -3
- data/ext/enterprise_script_service/libseccomp/src/arch-mips-syscalls.c +43 -11
- data/ext/enterprise_script_service/libseccomp/src/arch-mips64-syscalls.c +33 -1
- data/ext/enterprise_script_service/libseccomp/src/arch-mips64n32-syscalls.c +33 -1
- data/ext/enterprise_script_service/libseccomp/src/arch-parisc-syscalls.c +34 -2
- data/ext/enterprise_script_service/libseccomp/src/arch-ppc-syscalls.c +43 -11
- data/ext/enterprise_script_service/libseccomp/src/arch-ppc64-syscalls.c +44 -12
- data/ext/enterprise_script_service/libseccomp/src/arch-s390-syscalls.c +46 -14
- data/ext/enterprise_script_service/libseccomp/src/arch-s390.c +142 -18
- data/ext/enterprise_script_service/libseccomp/src/arch-s390x-syscalls.c +47 -15
- data/ext/enterprise_script_service/libseccomp/src/arch-s390x.c +143 -17
- data/ext/enterprise_script_service/libseccomp/src/arch-x32-syscalls.c +33 -1
- data/ext/enterprise_script_service/libseccomp/src/arch-x86-syscalls.c +94 -12
- data/ext/enterprise_script_service/libseccomp/src/arch-x86.c +142 -19
- data/ext/enterprise_script_service/libseccomp/src/arch-x86_64-syscalls.c +33 -1
- data/ext/enterprise_script_service/libseccomp/src/db.c +1 -0
- data/ext/enterprise_script_service/libseccomp/src/gen_bpf.c +10 -3
- data/ext/enterprise_script_service/libseccomp/src/python/Makefile.am +4 -4
- data/ext/enterprise_script_service/libseccomp/src/python/seccomp.pyx +2 -0
- data/ext/enterprise_script_service/libseccomp/tests/.gitignore +1 -0
- data/ext/enterprise_script_service/libseccomp/tests/50-sim-hash_collision.c +98 -0
- data/ext/enterprise_script_service/libseccomp/tests/50-sim-hash_collision.py +61 -0
- data/ext/enterprise_script_service/libseccomp/tests/50-sim-hash_collision.tests +18 -0
- data/ext/enterprise_script_service/libseccomp/tests/Makefile.am +6 -3
- data/ext/enterprise_script_service/libseccomp/tools/Makefile.am +0 -2
- data/ext/enterprise_script_service/libseccomp/tools/check-syntax +1 -0
- data/ext/enterprise_script_service/libseccomp/tools/scmp_bpf_sim.c +2 -0
- data/ext/enterprise_script_service/mruby-mpdecimal/src/ext.c +1 -1
- data/ext/enterprise_script_service/mruby/.gitignore +2 -2
- data/ext/enterprise_script_service/mruby/CONTRIBUTING.md +10 -3
- data/ext/enterprise_script_service/mruby/Doxyfile +2408 -0
- data/ext/enterprise_script_service/mruby/README.md +21 -8
- data/ext/enterprise_script_service/mruby/Rakefile +4 -13
- data/ext/enterprise_script_service/mruby/appveyor_config.rb +1 -1
- data/ext/enterprise_script_service/mruby/build_config.rb +3 -3
- data/ext/enterprise_script_service/mruby/doc/guides/compile.md +42 -42
- data/ext/enterprise_script_service/mruby/doc/guides/debugger.md +1 -1
- data/ext/enterprise_script_service/mruby/doc/guides/mrbconf.md +45 -6
- data/ext/enterprise_script_service/mruby/doc/guides/mrbgems.md +5 -0
- data/ext/enterprise_script_service/mruby/doc/limitations.md +88 -38
- data/ext/enterprise_script_service/mruby/doc/mruby_logo_red_icon.png +0 -0
- data/ext/enterprise_script_service/mruby/doc/opcode.md +94 -94
- data/ext/enterprise_script_service/mruby/include/mrbconf.h +74 -11
- data/ext/enterprise_script_service/mruby/include/mruby.h +242 -146
- data/ext/enterprise_script_service/mruby/include/mruby/array.h +7 -7
- data/ext/enterprise_script_service/mruby/include/mruby/boxing_nan.h +2 -9
- data/ext/enterprise_script_service/mruby/include/mruby/boxing_no.h +11 -10
- data/ext/enterprise_script_service/mruby/include/mruby/boxing_word.h +104 -69
- data/ext/enterprise_script_service/mruby/include/mruby/class.h +7 -5
- data/ext/enterprise_script_service/mruby/include/mruby/common.h +9 -7
- data/ext/enterprise_script_service/mruby/include/mruby/compile.h +6 -6
- data/ext/enterprise_script_service/mruby/include/mruby/data.h +5 -5
- data/ext/enterprise_script_service/mruby/include/mruby/debug.h +2 -2
- data/ext/enterprise_script_service/mruby/include/mruby/dump.h +3 -7
- data/ext/enterprise_script_service/mruby/include/mruby/error.h +34 -6
- data/ext/enterprise_script_service/mruby/include/mruby/gc.h +2 -2
- data/ext/enterprise_script_service/mruby/include/mruby/hash.h +4 -11
- data/ext/enterprise_script_service/mruby/include/mruby/irep.h +16 -4
- data/ext/enterprise_script_service/mruby/include/mruby/istruct.h +4 -4
- data/ext/enterprise_script_service/mruby/include/mruby/khash.h +2 -2
- data/ext/enterprise_script_service/mruby/include/mruby/numeric.h +41 -7
- data/ext/enterprise_script_service/mruby/include/mruby/object.h +8 -9
- data/ext/enterprise_script_service/mruby/include/mruby/opcode.h +2 -2
- data/ext/enterprise_script_service/mruby/include/mruby/ops.h +6 -6
- data/ext/enterprise_script_service/mruby/include/mruby/proc.h +19 -13
- data/ext/enterprise_script_service/mruby/include/mruby/range.h +10 -4
- data/ext/enterprise_script_service/mruby/include/mruby/re.h +2 -2
- data/ext/enterprise_script_service/mruby/include/mruby/string.h +130 -107
- data/ext/enterprise_script_service/mruby/include/mruby/throw.h +2 -2
- data/ext/enterprise_script_service/mruby/include/mruby/value.h +137 -49
- data/ext/enterprise_script_service/mruby/include/mruby/variable.h +3 -5
- data/ext/enterprise_script_service/mruby/include/mruby/version.h +24 -10
- data/ext/enterprise_script_service/mruby/lib/mruby-core-ext.rb +2 -39
- data/ext/enterprise_script_service/mruby/lib/mruby/build.rb +32 -15
- data/ext/enterprise_script_service/mruby/lib/mruby/build/command.rb +63 -17
- data/ext/enterprise_script_service/mruby/lib/mruby/build/load_gems.rb +24 -10
- data/ext/enterprise_script_service/mruby/lib/mruby/gem.rb +11 -7
- data/ext/enterprise_script_service/mruby/lib/mruby/lockfile.rb +81 -0
- data/ext/enterprise_script_service/mruby/minirake +27 -11
- data/ext/enterprise_script_service/mruby/mrbgems/default.gembox +3 -0
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-array-ext/mrbgem.rake +0 -1
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-array-ext/mrblib/array.rb +47 -9
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-array-ext/src/array.c +3 -3
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-array-ext/test/array.rb +50 -29
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-debugger/tools/mrdb/apibreak.c +3 -3
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-debugger/tools/mrdb/apiprint.c +2 -2
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-debugger/tools/mrdb/cmdprint.c +3 -3
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-debugger/tools/mrdb/mrdb.c +2 -2
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-debugger/tools/mrdb/mrdb.h +1 -1
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-debugger/tools/mrdb/mrdbconf.h +4 -0
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-mirb/tools/mirb/mirb.c +28 -1
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-mrbc/tools/mrbc/mrbc.c +1 -2
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-mruby/bintest/mruby.rb +75 -8
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-bin-mruby/tools/mruby/mruby.c +134 -90
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-class-ext/src/class.c +7 -8
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-compiler/core/codegen.c +69 -46
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-compiler/core/keywords +0 -3
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-compiler/core/lex.def +51 -59
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-compiler/core/parse.y +430 -241
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-complex/mrbgem.rake +10 -0
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-complex/mrblib/complex.rb +122 -0
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-complex/src/complex.c +249 -0
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-complex/test/complex.rb +153 -0
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-enum-chain/mrblib/chain.rb +19 -17
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-enum-chain/test/enum_chain.rb +41 -9
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-enum-ext/mrblib/enum.rb +30 -4
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-enum-ext/test/enum.rb +8 -3
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-enumerator/mrbgem.rake +0 -1
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-enumerator/mrblib/enumerator.rb +46 -14
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-enumerator/test/enumerator.rb +51 -2
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-error/src/exception.c +10 -0
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-eval/src/eval.c +47 -44
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-eval/test/eval.rb +2 -2
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-exit/src/mruby-exit.c +9 -4
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-fiber/src/fiber.c +16 -12
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-fiber/test/fiber.rb +1 -1
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-hash-ext/mrbgem.rake +0 -2
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-hash-ext/mrblib/hash.rb +3 -0
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-hash-ext/test/hash.rb +3 -7
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/README.md +1 -3
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/mrbgem.rake +1 -1
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/mrblib/file.rb +0 -5
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/mrblib/io.rb +24 -38
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/mrblib/kernel.rb +16 -0
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/src/file.c +19 -18
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/src/file_test.c +5 -16
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/src/io.c +54 -42
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/test/file.rb +24 -20
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/test/file_test.rb +4 -9
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/test/io.rb +41 -35
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/test/mruby_io_test.c +9 -36
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-kernel-ext/mrbgem.rake +1 -1
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-kernel-ext/src/kernel.c +9 -27
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-kernel-ext/test/kernel.rb +2 -0
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-math/src/math.c +5 -2
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-metaprog/src/metaprog.c +39 -24
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-metaprog/test/metaprog.rb +48 -17
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-method/mrblib/method.rb +0 -12
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-method/src/method.c +134 -101
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-method/test/method.rb +9 -1
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-numeric-ext/mrblib/numeric_ext.rb +1 -5
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-numeric-ext/src/numeric_ext.c +17 -37
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-numeric-ext/test/numeric.rb +0 -8
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-object-ext/mrbgem.rake +1 -1
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-object-ext/mrblib/object.rb +15 -1
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-object-ext/src/object.c +35 -6
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-object-ext/test/nil.rb +4 -0
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-objectspace/src/mruby_objectspace.c +1 -5
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-objectspace/test/objectspace.rb +1 -1
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-pack/src/pack.c +28 -23
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-pack/test/pack.rb +43 -49
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-print/mrblib/print.rb +3 -9
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-proc-ext/src/proc.c +6 -9
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-proc-ext/test/proc.rb +21 -5
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-random/src/random.c +157 -124
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-random/test/random.rb +72 -26
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-range-ext/mrblib/range.rb +38 -0
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-range-ext/src/range.c +26 -11
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-range-ext/test/range.rb +111 -1
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-rational/mrbgem.rake +5 -0
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-rational/mrblib/rational.rb +117 -0
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-rational/src/rational.c +209 -0
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-rational/test/rational.rb +308 -0
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-socket/README.md +1 -1
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-socket/src/socket.c +10 -9
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-sprintf/src/kernel.c +2 -2
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-sprintf/src/sprintf.c +22 -24
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-string-ext/mrbgem.rake +0 -1
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-string-ext/mrblib/string.rb +8 -4
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-string-ext/src/string.c +116 -117
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-string-ext/test/numeric.rb +29 -0
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-string-ext/test/range.rb +26 -0
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-string-ext/test/string.rb +32 -50
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-struct/mrblib/struct.rb +5 -7
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-struct/src/struct.c +43 -57
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-struct/test/struct.rb +16 -11
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-symbol-ext/src/symbol.c +2 -2
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-symbol-ext/test/symbol.rb +1 -1
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-test/driver.c +152 -1
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-test/mrbgem.rake +4 -3
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-test/vformat.c +200 -0
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-time/include/mruby/time.h +2 -1
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-time/src/time.c +199 -68
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-time/test/time.rb +81 -46
- data/ext/enterprise_script_service/mruby/mrblib/array.rb +14 -16
- data/ext/enterprise_script_service/mruby/mrblib/enum.rb +13 -9
- data/ext/enterprise_script_service/mruby/mrblib/hash.rb +5 -7
- data/ext/enterprise_script_service/mruby/mrblib/kernel.rb +1 -1
- data/ext/enterprise_script_service/mruby/mrblib/numeric.rb +4 -4
- data/ext/enterprise_script_service/mruby/mrblib/range.rb +1 -1
- data/ext/enterprise_script_service/mruby/mrblib/string.rb +55 -112
- data/ext/enterprise_script_service/mruby/mruby-source.gemspec +1 -1
- data/ext/enterprise_script_service/mruby/oss-fuzz/config/mruby.dict +105 -0
- data/ext/enterprise_script_service/mruby/oss-fuzz/config/mruby_fuzzer.options +5 -0
- data/ext/enterprise_script_service/mruby/oss-fuzz/config/mruby_proto_fuzzer.options +4 -0
- data/ext/enterprise_script_service/mruby/oss-fuzz/mruby_fuzzer.c +18 -0
- data/ext/enterprise_script_service/mruby/oss-fuzz/mruby_proto_fuzzer.cpp +44 -0
- data/ext/enterprise_script_service/mruby/oss-fuzz/proto_to_ruby.cpp +455 -0
- data/ext/enterprise_script_service/mruby/oss-fuzz/proto_to_ruby.h +55 -0
- data/ext/enterprise_script_service/mruby/oss-fuzz/ruby.proto +201 -0
- data/ext/enterprise_script_service/mruby/src/array.c +95 -46
- data/ext/enterprise_script_service/mruby/src/backtrace.c +6 -8
- data/ext/enterprise_script_service/mruby/src/class.c +370 -278
- data/ext/enterprise_script_service/mruby/src/codedump.c +34 -34
- data/ext/enterprise_script_service/mruby/src/debug.c +2 -2
- data/ext/enterprise_script_service/mruby/src/dump.c +8 -6
- data/ext/enterprise_script_service/mruby/src/enum.c +1 -1
- data/ext/enterprise_script_service/mruby/src/error.c +157 -55
- data/ext/enterprise_script_service/mruby/src/etc.c +13 -46
- data/ext/enterprise_script_service/mruby/src/fmt_fp.c +2 -2
- data/ext/enterprise_script_service/mruby/src/gc.c +30 -11
- data/ext/enterprise_script_service/mruby/src/hash.c +23 -14
- data/ext/enterprise_script_service/mruby/src/kernel.c +16 -54
- data/ext/enterprise_script_service/mruby/src/load.c +40 -76
- data/ext/enterprise_script_service/mruby/src/numeric.c +164 -94
- data/ext/enterprise_script_service/mruby/src/object.c +16 -39
- data/ext/enterprise_script_service/mruby/src/pool.c +0 -2
- data/ext/enterprise_script_service/mruby/src/proc.c +47 -48
- data/ext/enterprise_script_service/mruby/src/range.c +22 -35
- data/ext/enterprise_script_service/mruby/src/state.c +5 -94
- data/ext/enterprise_script_service/mruby/src/string.c +874 -710
- data/ext/enterprise_script_service/mruby/src/symbol.c +73 -48
- data/ext/enterprise_script_service/mruby/src/variable.c +58 -38
- data/ext/enterprise_script_service/mruby/src/vm.c +133 -304
- data/ext/enterprise_script_service/mruby/tasks/doc.rake +48 -0
- data/ext/enterprise_script_service/mruby/tasks/toolchains/clang.rake +3 -4
- data/ext/enterprise_script_service/mruby/tasks/toolchains/gcc.rake +20 -19
- data/ext/enterprise_script_service/mruby/tasks/toolchains/visualcpp.rake +0 -12
- data/ext/enterprise_script_service/mruby/test/assert.rb +186 -25
- data/ext/enterprise_script_service/mruby/test/t/array.rb +34 -6
- data/ext/enterprise_script_service/mruby/test/t/class.rb +26 -0
- data/ext/enterprise_script_service/mruby/test/t/enumerable.rb +2 -2
- data/ext/enterprise_script_service/mruby/test/t/float.rb +17 -17
- data/ext/enterprise_script_service/mruby/test/t/hash.rb +2 -0
- data/ext/enterprise_script_service/mruby/test/t/integer.rb +14 -6
- data/ext/enterprise_script_service/mruby/test/t/kernel.rb +38 -19
- data/ext/enterprise_script_service/mruby/test/t/module.rb +87 -14
- data/ext/enterprise_script_service/mruby/test/t/numeric.rb +65 -23
- data/ext/enterprise_script_service/mruby/test/t/range.rb +4 -4
- data/ext/enterprise_script_service/mruby/test/t/string.rb +211 -49
- data/ext/enterprise_script_service/mruby/test/t/syntax.rb +19 -2
- data/ext/enterprise_script_service/mruby/test/t/vformat.rb +92 -0
- data/ext/enterprise_script_service/mruby/travis_config.rb +2 -2
- data/ext/enterprise_script_service/mruby_config.rb +10 -0
- data/ext/enterprise_script_service/mruby_engine.cpp +2 -2
- data/ext/enterprise_script_service/mruby_engine.gembox +1 -0
- data/ext/enterprise_script_service/msgpack/CHANGELOG.md +14 -0
- data/ext/enterprise_script_service/msgpack/Files.cmake +4 -0
- data/ext/enterprise_script_service/msgpack/README.md +1 -1
- data/ext/enterprise_script_service/msgpack/appveyor.yml +1 -1
- data/ext/enterprise_script_service/msgpack/erb/v1/cpp03_msgpack_tuple.hpp.erb +1 -1
- data/ext/enterprise_script_service/msgpack/erb/v1/cpp03_msgpack_tuple_decl.hpp.erb +1 -1
- data/ext/enterprise_script_service/msgpack/erb/v1/cpp03_zone.hpp.erb +3 -3
- data/ext/enterprise_script_service/msgpack/example/boost/asio_send_recv.cpp +1 -1
- data/ext/enterprise_script_service/msgpack/include/msgpack/adaptor/cpp11/timespec.hpp +16 -0
- data/ext/enterprise_script_service/msgpack/include/msgpack/adaptor/wstring.hpp +15 -0
- data/ext/enterprise_script_service/msgpack/include/msgpack/object.h +2 -0
- data/ext/enterprise_script_service/msgpack/include/msgpack/pack_template.h +17 -9
- data/ext/enterprise_script_service/msgpack/include/msgpack/sysdep.h +27 -16
- data/ext/enterprise_script_service/msgpack/include/msgpack/type.hpp +2 -0
- data/ext/enterprise_script_service/msgpack/include/msgpack/unpack_template.h +5 -0
- data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/array_ref.hpp +0 -1
- data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/check_container_size.hpp +1 -1
- data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/cpp11/chrono.hpp +5 -5
- data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/cpp11/timespec.hpp +140 -0
- data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/detail/cpp03_msgpack_tuple.hpp +32 -32
- data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/detail/cpp03_msgpack_tuple_decl.hpp +32 -32
- data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/detail/cpp11_msgpack_tuple.hpp +6 -6
- data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/detail/cpp11_msgpack_tuple_decl.hpp +10 -10
- data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/ext.hpp +1 -1
- data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/fixint.hpp +5 -4
- data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/int.hpp +40 -13
- data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/int_decl.hpp +3 -2
- data/ext/enterprise_script_service/msgpack/include/msgpack/v1/adaptor/wstring.hpp +121 -0
- data/ext/enterprise_script_service/msgpack/include/msgpack/v1/detail/cpp03_zone.hpp +3 -3
- data/ext/enterprise_script_service/msgpack/include/msgpack/v1/detail/cpp11_zone.hpp +3 -3
- data/ext/enterprise_script_service/msgpack/include/msgpack/v1/object.hpp +6 -6
- data/ext/enterprise_script_service/msgpack/include/msgpack/v1/object_fwd.hpp +1 -1
- data/ext/enterprise_script_service/msgpack/include/msgpack/v1/pack.hpp +40 -5
- data/ext/enterprise_script_service/msgpack/include/msgpack/v1/unpack.hpp +11 -11
- data/ext/enterprise_script_service/msgpack/include/msgpack/v1/vrefbuffer.hpp +7 -7
- data/ext/enterprise_script_service/msgpack/include/msgpack/v1/zbuffer.hpp +5 -5
- data/ext/enterprise_script_service/msgpack/include/msgpack/v2/adaptor/int_decl.hpp +1 -1
- data/ext/enterprise_script_service/msgpack/include/msgpack/v2/create_object_visitor.hpp +1 -1
- data/ext/enterprise_script_service/msgpack/include/msgpack/v2/parse.hpp +13 -13
- data/ext/enterprise_script_service/msgpack/include/msgpack/v2/x3_parse.hpp +28 -26
- data/ext/enterprise_script_service/msgpack/include/msgpack/v3/adaptor/int_decl.hpp +1 -1
- data/ext/enterprise_script_service/msgpack/include/msgpack/v3/parse.hpp +13 -13
- data/ext/enterprise_script_service/msgpack/include/msgpack/version_master.h +2 -2
- data/ext/enterprise_script_service/msgpack/include/msgpack/zbuffer.h +6 -6
- data/ext/enterprise_script_service/msgpack/include/msgpack/zone.h +1 -1
- data/ext/enterprise_script_service/msgpack/src/objectc.c +83 -148
- data/ext/enterprise_script_service/msgpack/src/unpack.c +73 -47
- data/ext/enterprise_script_service/msgpack/test/CMakeLists.txt +1 -1
- data/ext/enterprise_script_service/msgpack/test/array_ref.cpp +5 -0
- data/ext/enterprise_script_service/msgpack/test/boost_fusion.cpp +5 -0
- data/ext/enterprise_script_service/msgpack/test/boost_optional.cpp +7 -0
- data/ext/enterprise_script_service/msgpack/test/boost_string_ref.cpp +7 -0
- data/ext/enterprise_script_service/msgpack/test/boost_string_view.cpp +6 -0
- data/ext/enterprise_script_service/msgpack/test/boost_variant.cpp +15 -9
- data/ext/enterprise_script_service/msgpack/test/buffer.cpp +7 -0
- data/ext/enterprise_script_service/msgpack/test/carray.cpp +7 -0
- data/ext/enterprise_script_service/msgpack/test/cases.cpp +7 -1
- data/ext/enterprise_script_service/msgpack/test/convert.cpp +6 -0
- data/ext/enterprise_script_service/msgpack/test/fixint.cpp +7 -1
- data/ext/enterprise_script_service/msgpack/test/fixint_c.cpp +6 -1
- data/ext/enterprise_script_service/msgpack/test/fuzz_unpack_pack_fuzzer_cpp11.cpp +5 -0
- data/ext/enterprise_script_service/msgpack/test/iterator_cpp11.cpp +8 -2
- data/ext/enterprise_script_service/msgpack/test/json.cpp +6 -0
- data/ext/enterprise_script_service/msgpack/test/limit.cpp +7 -0
- data/ext/enterprise_script_service/msgpack/test/msgpack_basic.cpp +128 -6
- data/ext/enterprise_script_service/msgpack/test/msgpack_c.cpp +7 -2
- data/ext/enterprise_script_service/msgpack/test/msgpack_container.cpp +20 -3
- data/ext/enterprise_script_service/msgpack/test/msgpack_cpp11.cpp +159 -0
- data/ext/enterprise_script_service/msgpack/test/msgpack_cpp17.cpp +5 -0
- data/ext/enterprise_script_service/msgpack/test/msgpack_stream.cpp +8 -3
- data/ext/enterprise_script_service/msgpack/test/msgpack_tuple.cpp +6 -0
- data/ext/enterprise_script_service/msgpack/test/msgpack_vref.cpp +5 -0
- data/ext/enterprise_script_service/msgpack/test/msgpack_x3_parse.cpp +23 -18
- data/ext/enterprise_script_service/msgpack/test/object.cpp +77 -45
- data/ext/enterprise_script_service/msgpack/test/object_with_zone.cpp +28 -10
- data/ext/enterprise_script_service/msgpack/test/pack_unpack.cpp +25 -18
- data/ext/enterprise_script_service/msgpack/test/pack_unpack_c.cpp +7 -0
- data/ext/enterprise_script_service/msgpack/test/raw.cpp +17 -12
- data/ext/enterprise_script_service/msgpack/test/reference.cpp +6 -0
- data/ext/enterprise_script_service/msgpack/test/reference_cpp11.cpp +6 -0
- data/ext/enterprise_script_service/msgpack/test/reference_wrapper_cpp11.cpp +6 -0
- data/ext/enterprise_script_service/msgpack/test/shared_ptr_cpp11.cpp +6 -0
- data/ext/enterprise_script_service/msgpack/test/size_equal_only.cpp +6 -2
- data/ext/enterprise_script_service/msgpack/test/streaming.cpp +10 -3
- data/ext/enterprise_script_service/msgpack/test/streaming_c.cpp +7 -0
- data/ext/enterprise_script_service/msgpack/test/unique_ptr_cpp11.cpp +6 -0
- data/ext/enterprise_script_service/msgpack/test/user_class.cpp +5 -0
- data/ext/enterprise_script_service/msgpack/test/version.cpp +6 -0
- data/ext/enterprise_script_service/msgpack/test/visitor.cpp +7 -0
- data/ext/enterprise_script_service/msgpack/test/zone.cpp +6 -0
- data/lib/script_core/version.rb +1 -1
- data/lib/tasks/mruby/engine.gembox.example +1 -0
- data/lib/tasks/script_core.rake +21 -3
- data/spec/dummy/app/helpers/fields_helper.rb +2 -2
- data/spec/dummy/mruby/engine.gembox +1 -0
- data/spec/script_core_spec.rb +1 -1
- metadata +38 -22
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/.gitignore +0 -1
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/.travis.yml +0 -2
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-io/run_test.rb +0 -26
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-kernel-ext/mrblib/kernel.rb +0 -15
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-method/mrblib/unbound_method.rb +0 -9
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-pack/.gitignore +0 -5
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-pack/.travis.yml +0 -2
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-pack/packtest.rb +0 -157
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-pack/run_test.rb +0 -26
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-random/src/mt19937ar.c +0 -224
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-random/src/mt19937ar.h +0 -80
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-random/src/random.h +0 -12
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-sleep/.gitignore +0 -4
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-sleep/.travis.yml +0 -29
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-sleep/.travis_build_config.rb +0 -6
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-sleep/Rakefile +0 -29
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-socket/.travis.yml +0 -4
- data/ext/enterprise_script_service/mruby/mrbgems/mruby-socket/run_test.rb +0 -28
@@ -1,5 +1,5 @@
|
|
1
|
-
|
2
|
-
** mruby/array.h - Array class
|
1
|
+
/**
|
2
|
+
** @file mruby/array.h - Array class
|
3
3
|
**
|
4
4
|
** See Copyright Notice in mruby.h
|
5
5
|
*/
|
@@ -17,7 +17,7 @@ MRB_BEGIN_DECL
|
|
17
17
|
|
18
18
|
typedef struct mrb_shared_array {
|
19
19
|
int refcnt;
|
20
|
-
|
20
|
+
mrb_ssize len;
|
21
21
|
mrb_value *ptr;
|
22
22
|
} mrb_shared_array;
|
23
23
|
|
@@ -26,14 +26,14 @@ struct RArray {
|
|
26
26
|
MRB_OBJECT_HEADER;
|
27
27
|
union {
|
28
28
|
struct {
|
29
|
-
|
29
|
+
mrb_ssize len;
|
30
30
|
union {
|
31
|
-
|
31
|
+
mrb_ssize capa;
|
32
32
|
mrb_shared_array *shared;
|
33
33
|
} aux;
|
34
34
|
mrb_value *ptr;
|
35
35
|
} heap;
|
36
|
-
|
36
|
+
void *ary[3];
|
37
37
|
} as;
|
38
38
|
};
|
39
39
|
|
@@ -46,7 +46,7 @@ struct RArray {
|
|
46
46
|
#define ARY_UNSET_EMBED_FLAG(a) ((a)->flags &= ~(MRB_ARY_EMBED_MASK))
|
47
47
|
#define ARY_EMBED_LEN(a) ((mrb_int)(((a)->flags & MRB_ARY_EMBED_MASK) - 1))
|
48
48
|
#define ARY_SET_EMBED_LEN(a,len) ((a)->flags = ((a)->flags&~MRB_ARY_EMBED_MASK) | ((uint32_t)(len) + 1))
|
49
|
-
#define ARY_EMBED_PTR(a) (&(
|
49
|
+
#define ARY_EMBED_PTR(a) ((mrb_value*)(&(a)->as.ary))
|
50
50
|
|
51
51
|
#define ARY_LEN(a) (ARY_EMBED_P(a)?ARY_EMBED_LEN(a):(a)->as.heap.len)
|
52
52
|
#define ARY_PTR(a) (ARY_EMBED_P(a)?ARY_EMBED_PTR(a):(a)->as.heap.ptr)
|
@@ -1,5 +1,5 @@
|
|
1
|
-
|
2
|
-
** mruby/boxing_nan.h - nan boxing mrb_value definition
|
1
|
+
/**
|
2
|
+
** @file mruby/boxing_nan.h - nan boxing mrb_value definition
|
3
3
|
**
|
4
4
|
** See Copyright Notice in mruby.h
|
5
5
|
*/
|
@@ -20,13 +20,6 @@
|
|
20
20
|
#endif
|
21
21
|
|
22
22
|
#define MRB_FIXNUM_SHIFT 0
|
23
|
-
#define MRB_TT_HAS_BASIC MRB_TT_OBJECT
|
24
|
-
|
25
|
-
#ifdef MRB_ENDIAN_BIG
|
26
|
-
#define MRB_ENDIAN_LOHI(a,b) a b
|
27
|
-
#else
|
28
|
-
#define MRB_ENDIAN_LOHI(a,b) b a
|
29
|
-
#endif
|
30
23
|
|
31
24
|
/* value representation by nan-boxing:
|
32
25
|
* float : FFFFFFFFFFFFFFFF FFFFFFFFFFFFFFFF FFFFFFFFFFFFFFFF FFFFFFFFFFFFFFFF
|
@@ -1,5 +1,5 @@
|
|
1
|
-
|
2
|
-
** mruby/boxing_no.h - unboxed mrb_value definition
|
1
|
+
/**
|
2
|
+
** @file mruby/boxing_no.h - unboxed mrb_value definition
|
3
3
|
**
|
4
4
|
** See Copyright Notice in mruby.h
|
5
5
|
*/
|
@@ -8,17 +8,18 @@
|
|
8
8
|
#define MRUBY_BOXING_NO_H
|
9
9
|
|
10
10
|
#define MRB_FIXNUM_SHIFT 0
|
11
|
-
#define MRB_TT_HAS_BASIC MRB_TT_OBJECT
|
12
11
|
|
13
|
-
|
14
|
-
union {
|
12
|
+
union mrb_value_union {
|
15
13
|
#ifndef MRB_WITHOUT_FLOAT
|
16
|
-
|
14
|
+
mrb_float f;
|
17
15
|
#endif
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
16
|
+
void *p;
|
17
|
+
mrb_int i;
|
18
|
+
mrb_sym sym;
|
19
|
+
};
|
20
|
+
|
21
|
+
typedef struct mrb_value {
|
22
|
+
union mrb_value_union value;
|
22
23
|
enum mrb_vtype tt;
|
23
24
|
} mrb_value;
|
24
25
|
|
@@ -1,5 +1,5 @@
|
|
1
|
-
|
2
|
-
** mruby/boxing_word.h - word boxing mrb_value definition
|
1
|
+
/**
|
2
|
+
** @file mruby/boxing_word.h - word boxing mrb_value definition
|
3
3
|
**
|
4
4
|
** See Copyright Notice in mruby.h
|
5
5
|
*/
|
@@ -27,43 +27,61 @@ struct RCptr {
|
|
27
27
|
void *p;
|
28
28
|
};
|
29
29
|
|
30
|
-
#define MRB_FIXNUM_SHIFT 1
|
31
|
-
#ifdef MRB_WITHOUT_FLOAT
|
32
|
-
#define MRB_TT_HAS_BASIC MRB_TT_CPTR
|
33
|
-
#else
|
34
|
-
#define MRB_TT_HAS_BASIC MRB_TT_FLOAT
|
35
|
-
#endif
|
36
|
-
|
37
30
|
enum mrb_special_consts {
|
38
|
-
MRB_Qnil =
|
39
|
-
MRB_Qfalse =
|
40
|
-
MRB_Qtrue =
|
41
|
-
MRB_Qundef =
|
31
|
+
MRB_Qnil = 0,
|
32
|
+
MRB_Qfalse = 4,
|
33
|
+
MRB_Qtrue = 12,
|
34
|
+
MRB_Qundef = 20,
|
42
35
|
};
|
43
36
|
|
44
|
-
#define
|
45
|
-
#define
|
46
|
-
#define
|
37
|
+
#define MRB_FIXNUM_SHIFT 1
|
38
|
+
#define MRB_SYMBOL_SHIFT 2
|
39
|
+
#define MRB_FIXNUM_FLAG (1 << (MRB_FIXNUM_SHIFT - 1))
|
40
|
+
#define MRB_SYMBOL_FLAG (1 << (MRB_SYMBOL_SHIFT - 1))
|
41
|
+
#define MRB_FIXNUM_MASK ((1 << MRB_FIXNUM_SHIFT) - 1)
|
42
|
+
#define MRB_SYMBOL_MASK ((1 << MRB_SYMBOL_SHIFT) - 1)
|
43
|
+
#define MRB_IMMEDIATE_MASK 0x07
|
47
44
|
|
48
|
-
#
|
49
|
-
#define
|
45
|
+
#ifdef MRB_64BIT
|
46
|
+
#define MRB_SYMBOL_BIT (sizeof(mrb_sym) * CHAR_BIT)
|
50
47
|
#define MRB_SYMBOL_MAX UINT32_MAX
|
51
48
|
#else
|
52
|
-
#define
|
53
|
-
#define MRB_SYMBOL_MAX (UINT32_MAX >>
|
49
|
+
#define MRB_SYMBOL_BIT (sizeof(mrb_sym) * CHAR_BIT - MRB_SYMBOL_SHIFT)
|
50
|
+
#define MRB_SYMBOL_MAX (UINT32_MAX >> MRB_SYMBOL_SHIFT)
|
54
51
|
#endif
|
55
52
|
|
53
|
+
#define BOXWORD_SHIFT_VALUE(o,n,t) \
|
54
|
+
((((t)(o).w)) >> MRB_##n##_SHIFT)
|
55
|
+
#define BOXWORD_SET_SHIFT_VALUE(o,n,v) \
|
56
|
+
((o).w = (((unsigned long)(v)) << MRB_##n##_SHIFT) | MRB_##n##_FLAG)
|
57
|
+
#define BOXWORD_SHIFT_VALUE_P(o,n) \
|
58
|
+
(((o).w & MRB_##n##_MASK) == MRB_##n##_FLAG)
|
59
|
+
#define BOXWORD_OBJ_TYPE_P(o,n) \
|
60
|
+
(!mrb_immediate_p(o) && (o).value.bp->tt == MRB_TT_##n)
|
61
|
+
|
62
|
+
/*
|
63
|
+
* mrb_value representation:
|
64
|
+
*
|
65
|
+
* nil : ...0000 0000 (all bits are zero)
|
66
|
+
* false : ...0000 0100
|
67
|
+
* true : ...0000 1100
|
68
|
+
* undef : ...0001 0100
|
69
|
+
* fixnum: ...IIII III1
|
70
|
+
* symbol: ...SSSS SS10 (high-order 32-bit are symbol value in 64-bit mode)
|
71
|
+
* object: ...PPPP P000
|
72
|
+
*/
|
56
73
|
typedef union mrb_value {
|
57
74
|
union {
|
58
75
|
void *p;
|
76
|
+
#ifdef MRB_64BIT
|
77
|
+
/* use struct to avoid bit shift. */
|
59
78
|
struct {
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
unsigned int sym_flag : MRB_SPECIAL_SHIFT;
|
65
|
-
mrb_sym sym : MRB_SYMBOL_BITSIZE;
|
79
|
+
MRB_ENDIAN_LOHI(
|
80
|
+
mrb_sym sym;
|
81
|
+
,uint32_t sym_flag;
|
82
|
+
)
|
66
83
|
};
|
84
|
+
#endif
|
67
85
|
struct RBasic *bp;
|
68
86
|
#ifndef MRB_WITHOUT_FLOAT
|
69
87
|
struct RFloat *fp;
|
@@ -88,57 +106,74 @@ MRB_API mrb_value mrb_word_boxing_float_pool(struct mrb_state*, mrb_float);
|
|
88
106
|
#ifndef MRB_WITHOUT_FLOAT
|
89
107
|
#define mrb_float(o) (o).value.fp->f
|
90
108
|
#endif
|
91
|
-
#define mrb_fixnum(o) (
|
109
|
+
#define mrb_fixnum(o) BOXWORD_SHIFT_VALUE(o, FIXNUM, mrb_int)
|
110
|
+
#ifdef MRB_64BIT
|
92
111
|
#define mrb_symbol(o) (o).value.sym
|
112
|
+
#else
|
113
|
+
#define mrb_symbol(o) BOXWORD_SHIFT_VALUE(o, SYMBOL, mrb_sym)
|
114
|
+
#endif
|
115
|
+
#define mrb_bool(o) (((o).w & ~(unsigned long)MRB_Qfalse) != 0)
|
93
116
|
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
case MRB_Qtrue:
|
102
|
-
return MRB_TT_TRUE;
|
103
|
-
case MRB_Qundef:
|
104
|
-
return MRB_TT_UNDEF;
|
105
|
-
}
|
106
|
-
if (o.value.i_flag == MRB_FIXNUM_FLAG) {
|
107
|
-
return MRB_TT_FIXNUM;
|
108
|
-
}
|
109
|
-
if (o.value.sym_flag == MRB_SYMBOL_FLAG) {
|
110
|
-
return MRB_TT_SYMBOL;
|
111
|
-
}
|
112
|
-
return o.value.bp->tt;
|
113
|
-
}
|
114
|
-
|
115
|
-
#define mrb_bool(o) ((o).w != MRB_Qnil && (o).w != MRB_Qfalse)
|
116
|
-
#define mrb_fixnum_p(o) ((o).value.i_flag == MRB_FIXNUM_FLAG)
|
117
|
+
#define mrb_immediate_p(o) ((o).w & MRB_IMMEDIATE_MASK || (o).w == MRB_Qnil)
|
118
|
+
#define mrb_fixnum_p(o) BOXWORD_SHIFT_VALUE_P(o, FIXNUM)
|
119
|
+
#ifdef MRB_64BIT
|
120
|
+
#define mrb_symbol_p(o) ((o).value.sym_flag == MRB_SYMBOL_FLAG)
|
121
|
+
#else
|
122
|
+
#define mrb_symbol_p(o) BOXWORD_SHIFT_VALUE_P(o, SYMBOL)
|
123
|
+
#endif
|
117
124
|
#define mrb_undef_p(o) ((o).w == MRB_Qundef)
|
118
125
|
#define mrb_nil_p(o) ((o).w == MRB_Qnil)
|
119
|
-
|
120
|
-
#define
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
126
|
+
#define mrb_false_p(o) ((o).w == MRB_Qfalse)
|
127
|
+
#define mrb_true_p(o) ((o).w == MRB_Qtrue)
|
128
|
+
#ifndef MRB_WITHOUT_FLOAT
|
129
|
+
#define mrb_float_p(o) BOXWORD_OBJ_TYPE_P(o, FLOAT)
|
130
|
+
#endif
|
131
|
+
#define mrb_array_p(o) BOXWORD_OBJ_TYPE_P(o, ARRAY)
|
132
|
+
#define mrb_string_p(o) BOXWORD_OBJ_TYPE_P(o, STRING)
|
133
|
+
#define mrb_hash_p(o) BOXWORD_OBJ_TYPE_P(o, HASH)
|
134
|
+
#define mrb_cptr_p(o) BOXWORD_OBJ_TYPE_P(o, CPTR)
|
135
|
+
#define mrb_exception_p(o) BOXWORD_OBJ_TYPE_P(o, EXCEPTION)
|
136
|
+
#define mrb_free_p(o) BOXWORD_OBJ_TYPE_P(o, FREE)
|
137
|
+
#define mrb_object_p(o) BOXWORD_OBJ_TYPE_P(o, OBJECT)
|
138
|
+
#define mrb_class_p(o) BOXWORD_OBJ_TYPE_P(o, CLASS)
|
139
|
+
#define mrb_module_p(o) BOXWORD_OBJ_TYPE_P(o, MODULE)
|
140
|
+
#define mrb_iclass_p(o) BOXWORD_OBJ_TYPE_P(o, ICLASS)
|
141
|
+
#define mrb_sclass_p(o) BOXWORD_OBJ_TYPE_P(o, SCLASS)
|
142
|
+
#define mrb_proc_p(o) BOXWORD_OBJ_TYPE_P(o, PROC)
|
143
|
+
#define mrb_range_p(o) BOXWORD_OBJ_TYPE_P(o, RANGE)
|
144
|
+
#define mrb_file_p(o) BOXWORD_OBJ_TYPE_P(o, FILE)
|
145
|
+
#define mrb_env_p(o) BOXWORD_OBJ_TYPE_P(o, ENV)
|
146
|
+
#define mrb_data_p(o) BOXWORD_OBJ_TYPE_P(o, DATA)
|
147
|
+
#define mrb_fiber_p(o) BOXWORD_OBJ_TYPE_P(o, FIBER)
|
148
|
+
#define mrb_istruct_p(o) BOXWORD_OBJ_TYPE_P(o, ISTRUCT)
|
149
|
+
#define mrb_break_p(o) BOXWORD_OBJ_TYPE_P(o, BREAK)
|
130
150
|
|
131
151
|
#ifndef MRB_WITHOUT_FLOAT
|
132
152
|
#define SET_FLOAT_VALUE(mrb,r,v) ((r) = mrb_word_boxing_float_value(mrb, v))
|
133
153
|
#endif
|
134
154
|
#define SET_CPTR_VALUE(mrb,r,v) ((r) = mrb_word_boxing_cptr_value(mrb, v))
|
135
|
-
#define
|
136
|
-
#define
|
137
|
-
#define
|
138
|
-
#define
|
139
|
-
#define
|
140
|
-
#define
|
141
|
-
#
|
142
|
-
#define
|
155
|
+
#define SET_UNDEF_VALUE(r) ((r).w = MRB_Qundef)
|
156
|
+
#define SET_NIL_VALUE(r) ((r).w = MRB_Qnil)
|
157
|
+
#define SET_FALSE_VALUE(r) ((r).w = MRB_Qfalse)
|
158
|
+
#define SET_TRUE_VALUE(r) ((r).w = MRB_Qtrue)
|
159
|
+
#define SET_BOOL_VALUE(r,b) ((b) ? SET_TRUE_VALUE(r) : SET_FALSE_VALUE(r))
|
160
|
+
#define SET_INT_VALUE(r,n) BOXWORD_SET_SHIFT_VALUE(r, FIXNUM, n)
|
161
|
+
#ifdef MRB_64BIT
|
162
|
+
#define SET_SYM_VALUE(r,v) ((r).value.sym = v, (r).value.sym_flag = MRB_SYMBOL_FLAG)
|
163
|
+
#else
|
164
|
+
#define SET_SYM_VALUE(r,n) BOXWORD_SET_SHIFT_VALUE(r, SYMBOL, n)
|
165
|
+
#endif
|
166
|
+
#define SET_OBJ_VALUE(r,v) ((r).value.p = v)
|
167
|
+
|
168
|
+
MRB_INLINE enum mrb_vtype
|
169
|
+
mrb_type(mrb_value o)
|
170
|
+
{
|
171
|
+
return !mrb_bool(o) ? MRB_TT_FALSE :
|
172
|
+
mrb_true_p(o) ? MRB_TT_TRUE :
|
173
|
+
mrb_fixnum_p(o) ? MRB_TT_FIXNUM :
|
174
|
+
mrb_symbol_p(o) ? MRB_TT_SYMBOL :
|
175
|
+
mrb_undef_p(o) ? MRB_TT_UNDEF :
|
176
|
+
o.value.bp->tt;
|
177
|
+
}
|
143
178
|
|
144
179
|
#endif /* MRUBY_BOXING_WORD_H */
|
@@ -1,5 +1,5 @@
|
|
1
|
-
|
2
|
-
** mruby/class.h - Class class
|
1
|
+
/**
|
2
|
+
** @file mruby/class.h - Class class
|
3
3
|
**
|
4
4
|
** See Copyright Notice in mruby.h
|
5
5
|
*/
|
@@ -23,7 +23,7 @@ struct RClass {
|
|
23
23
|
|
24
24
|
#define mrb_class_ptr(v) ((struct RClass*)(mrb_ptr(v)))
|
25
25
|
|
26
|
-
|
26
|
+
MRB_INLINE struct RClass*
|
27
27
|
mrb_class(mrb_state *mrb, mrb_value v)
|
28
28
|
{
|
29
29
|
switch (mrb_type(v)) {
|
@@ -75,8 +75,8 @@ mrb_class(mrb_state *mrb, mrb_value v)
|
|
75
75
|
|
76
76
|
MRB_API struct RClass* mrb_define_class_id(mrb_state*, mrb_sym, struct RClass*);
|
77
77
|
MRB_API struct RClass* mrb_define_module_id(mrb_state*, mrb_sym);
|
78
|
-
|
79
|
-
|
78
|
+
struct RClass *mrb_vm_define_class(mrb_state*, mrb_value, mrb_value, mrb_sym);
|
79
|
+
struct RClass *mrb_vm_define_module(mrb_state*, mrb_value, mrb_sym);
|
80
80
|
MRB_API void mrb_define_method_raw(mrb_state*, struct RClass*, mrb_sym, mrb_method_t);
|
81
81
|
MRB_API void mrb_define_method_id(mrb_state *mrb, struct RClass *c, mrb_sym mid, mrb_func_t func, mrb_aspec aspec);
|
82
82
|
MRB_API void mrb_alias_method(mrb_state*, struct RClass *c, mrb_sym a, mrb_sym b);
|
@@ -85,8 +85,10 @@ MRB_API mrb_method_t mrb_method_search_vm(mrb_state*, struct RClass**, mrb_sym);
|
|
85
85
|
MRB_API mrb_method_t mrb_method_search(mrb_state*, struct RClass*, mrb_sym);
|
86
86
|
|
87
87
|
MRB_API struct RClass* mrb_class_real(struct RClass* cl);
|
88
|
+
mrb_value mrb_instance_new(mrb_state *mrb, mrb_value cv);
|
88
89
|
|
89
90
|
void mrb_class_name_class(mrb_state*, struct RClass*, struct RClass*, mrb_sym);
|
91
|
+
mrb_bool mrb_const_name_p(mrb_state*, const char*, mrb_int);
|
90
92
|
mrb_value mrb_class_find_path(mrb_state*, struct RClass*);
|
91
93
|
void mrb_gc_mark_mt(mrb_state*, struct RClass*);
|
92
94
|
size_t mrb_gc_mark_mt_size(mrb_state*, struct RClass*);
|
@@ -1,5 +1,5 @@
|
|
1
|
-
|
2
|
-
**
|
1
|
+
/**
|
2
|
+
** @file common.h - mruby common platform definition"
|
3
3
|
**
|
4
4
|
** See Copyright Notice in mruby.h
|
5
5
|
*/
|
@@ -54,14 +54,15 @@ MRB_BEGIN_DECL
|
|
54
54
|
#endif
|
55
55
|
|
56
56
|
/** Declare a function as always inlined. */
|
57
|
-
#if defined
|
58
|
-
#
|
59
|
-
#
|
60
|
-
#
|
57
|
+
#if defined _MSC_VER && _MSC_VER < 1900
|
58
|
+
# ifndef __cplusplus
|
59
|
+
# define inline __inline
|
60
|
+
# endif
|
61
61
|
#endif
|
62
|
-
|
62
|
+
#define MRB_INLINE static inline
|
63
63
|
|
64
64
|
/** Declare a public MRuby API function. */
|
65
|
+
#ifndef MRB_API
|
65
66
|
#if defined(MRB_BUILD_AS_DLL)
|
66
67
|
#if defined(MRB_CORE) || defined(MRB_LIB)
|
67
68
|
# define MRB_API __declspec(dllexport)
|
@@ -71,6 +72,7 @@ MRB_BEGIN_DECL
|
|
71
72
|
#else
|
72
73
|
# define MRB_API extern
|
73
74
|
#endif
|
75
|
+
#endif
|
74
76
|
|
75
77
|
MRB_END_DECL
|
76
78
|
|
@@ -1,5 +1,5 @@
|
|
1
|
-
|
2
|
-
** mruby/compile.h - mruby parser
|
1
|
+
/**
|
2
|
+
** @file mruby/compile.h - mruby parser
|
3
3
|
**
|
4
4
|
** See Copyright Notice in mruby.h
|
5
5
|
*/
|
@@ -24,7 +24,7 @@ typedef struct mrbc_context {
|
|
24
24
|
mrb_sym *syms;
|
25
25
|
int slen;
|
26
26
|
char *filename;
|
27
|
-
|
27
|
+
uint16_t lineno;
|
28
28
|
int (*partial_hook)(struct mrb_parser_state*);
|
29
29
|
void *partial_data;
|
30
30
|
struct RClass *target_class;
|
@@ -67,7 +67,7 @@ enum mrb_lex_state_enum {
|
|
67
67
|
|
68
68
|
/* saved error message */
|
69
69
|
struct mrb_parser_message {
|
70
|
-
|
70
|
+
uint16_t lineno;
|
71
71
|
int column;
|
72
72
|
char* message;
|
73
73
|
};
|
@@ -105,7 +105,7 @@ struct mrb_parser_heredoc_info {
|
|
105
105
|
mrb_ast_node *doc;
|
106
106
|
};
|
107
107
|
|
108
|
-
#define MRB_PARSER_TOKBUF_MAX
|
108
|
+
#define MRB_PARSER_TOKBUF_MAX (UINT16_MAX-1)
|
109
109
|
#define MRB_PARSER_TOKBUF_SIZE 256
|
110
110
|
|
111
111
|
/* parser structure */
|
@@ -119,7 +119,7 @@ struct mrb_parser_state {
|
|
119
119
|
#endif
|
120
120
|
mrbc_context *cxt;
|
121
121
|
mrb_sym filename_sym;
|
122
|
-
|
122
|
+
uint16_t lineno;
|
123
123
|
int column;
|
124
124
|
|
125
125
|
enum mrb_lex_state_enum lstate;
|
@@ -1,5 +1,5 @@
|
|
1
|
-
|
2
|
-
** mruby/data.h - Data class
|
1
|
+
/**
|
2
|
+
** @file mruby/data.h - Data class
|
3
3
|
**
|
4
4
|
** See Copyright Notice in mruby.h
|
5
5
|
*/
|
@@ -41,7 +41,7 @@ MRB_API struct RData *mrb_data_object_alloc(mrb_state *mrb, struct RClass* klass
|
|
41
41
|
|
42
42
|
#define Data_Make_Struct(mrb,klass,strct,type,sval,data_obj) do { \
|
43
43
|
(data_obj) = Data_Wrap_Struct(mrb,klass,type,NULL);\
|
44
|
-
(sval) = mrb_malloc(mrb, sizeof(strct)); \
|
44
|
+
(sval) = (strct *)mrb_malloc(mrb, sizeof(strct)); \
|
45
45
|
{ static const strct zero = { 0 }; *(sval) = zero; };\
|
46
46
|
(data_obj)->data = (sval);\
|
47
47
|
} while (0)
|
@@ -63,10 +63,10 @@ MRB_API void *mrb_data_check_get_ptr(mrb_state *mrb, mrb_value, const mrb_data_t
|
|
63
63
|
*(void**)&sval = mrb_data_get_ptr(mrb, obj, type); \
|
64
64
|
} while (0)
|
65
65
|
|
66
|
-
|
66
|
+
MRB_INLINE void
|
67
67
|
mrb_data_init(mrb_value v, void *ptr, const mrb_data_type *type)
|
68
68
|
{
|
69
|
-
mrb_assert(
|
69
|
+
mrb_assert(mrb_data_p(v));
|
70
70
|
DATA_PTR(v) = ptr;
|
71
71
|
DATA_TYPE(v) = type;
|
72
72
|
}
|