quickjs 0.1.2

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.
Files changed (36) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +4 -0
  3. data/LICENSE +21 -0
  4. data/Rakefile +22 -0
  5. data/ext/quickjsrb/extconf.rb +45 -0
  6. data/ext/quickjsrb/quickjs/LICENSE +22 -0
  7. data/ext/quickjsrb/quickjs/cutils.c +631 -0
  8. data/ext/quickjsrb/quickjs/cutils.h +347 -0
  9. data/ext/quickjsrb/quickjs/libbf.c +8475 -0
  10. data/ext/quickjsrb/quickjs/libbf.h +535 -0
  11. data/ext/quickjsrb/quickjs/libregexp-opcode.h +57 -0
  12. data/ext/quickjsrb/quickjs/libregexp.c +2501 -0
  13. data/ext/quickjsrb/quickjs/libregexp.h +55 -0
  14. data/ext/quickjsrb/quickjs/libunicode-table.h +4557 -0
  15. data/ext/quickjsrb/quickjs/libunicode.c +1910 -0
  16. data/ext/quickjsrb/quickjs/libunicode.h +182 -0
  17. data/ext/quickjsrb/quickjs/list.h +99 -0
  18. data/ext/quickjsrb/quickjs/qjs.c +564 -0
  19. data/ext/quickjsrb/quickjs/qjsc.c +761 -0
  20. data/ext/quickjsrb/quickjs/qjscalc.c +4005 -0
  21. data/ext/quickjsrb/quickjs/quickjs-atom.h +273 -0
  22. data/ext/quickjsrb/quickjs/quickjs-libc.c +4052 -0
  23. data/ext/quickjsrb/quickjs/quickjs-libc.h +60 -0
  24. data/ext/quickjsrb/quickjs/quickjs-opcode.h +372 -0
  25. data/ext/quickjsrb/quickjs/quickjs.c +55978 -0
  26. data/ext/quickjsrb/quickjs/quickjs.h +1087 -0
  27. data/ext/quickjsrb/quickjs/repl.c +2057 -0
  28. data/ext/quickjsrb/quickjs/run-test262.c +2216 -0
  29. data/ext/quickjsrb/quickjs/unicode_gen.c +3225 -0
  30. data/ext/quickjsrb/quickjs/unicode_gen_def.h +291 -0
  31. data/ext/quickjsrb/quickjsrb.c +105 -0
  32. data/ext/quickjsrb/quickjsrb.h +14 -0
  33. data/lib/quickjs/version.rb +5 -0
  34. data/lib/quickjs.rb +28 -0
  35. data/sig/quickjs.rbs +4 -0
  36. metadata +81 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 5ac1abd90f15750c0ed0da7c82804862906def1d584baa5fefb4889682513d35
4
+ data.tar.gz: 59ee4e54ccc5743286f38a4b4e325486108399e432f92f12b430de9c68accd28
5
+ SHA512:
6
+ metadata.gz: 3c5ba0d56904c52f426440429c3243285572591c4803bcd21649cacef8e40168f9b289867531b8f5ad2f15a533cca31714a931ac6f04062dc7a22a53e22fae95
7
+ data.tar.gz: 8fb7571445aedcac86a0cf897fbbf2e6390b40190838a7bbdbd91742ababc893399704afbeeacd599c8ddbd74429c61038889e47e50dc55fc4b35e65630c889a
data/CHANGELOG.md ADDED
@@ -0,0 +1,4 @@
1
+ ## [0.1.1] - 2024-06-14
2
+
3
+ - Initial release
4
+ - See `test/quickjs_test.rb` for supported features
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Kengo Hamasaki
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
data/Rakefile ADDED
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'bundler/gem_tasks'
4
+ require 'rake/testtask'
5
+
6
+ Rake::TestTask.new(:test) do |t|
7
+ t.libs << 'test'
8
+ t.libs << 'lib'
9
+ t.test_files = FileList['test/**/*_test.rb']
10
+ end
11
+
12
+ require 'rake/extensiontask'
13
+
14
+ task build: :compile
15
+
16
+ GEMSPEC = Gem::Specification.load('quickjs.gemspec')
17
+
18
+ Rake::ExtensionTask.new('quickjsrb', GEMSPEC) do |ext|
19
+ ext.lib_dir = 'lib/quickjs'
20
+ end
21
+
22
+ task default: %i[clobber compile test]
@@ -0,0 +1,45 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'mkmf'
4
+
5
+ $VPATH << "$(srcdir)/quickjs"
6
+
7
+ $srcs = [
8
+ 'libunicode.c',
9
+ 'libbf.c',
10
+ 'libregexp.c',
11
+ 'cutils.c',
12
+ 'quickjs.c',
13
+ 'quickjs-libc.c',
14
+ 'quickjsrb.c',
15
+ ]
16
+
17
+ append_cflags('-I$(srcdir)/quickjs')
18
+
19
+ append_cflags('-fwrapv')
20
+ append_cflags('-g')
21
+ append_cflags('-O2')
22
+ append_cflags('-Wall')
23
+ append_cflags('-MMD')
24
+ append_cflags('-MF')
25
+ append_cflags('-Wextra')
26
+ append_cflags('-Wno-sign-compare')
27
+ append_cflags('-Wno-missing-field-initializers')
28
+ append_cflags('-Wundef -Wuninitialized')
29
+ append_cflags('-Wunused -Wno-unused-parameter')
30
+ append_cflags('-Wwrite-strings')
31
+ append_cflags('-Wchar-subscripts -funsigned-char')
32
+ append_cflags('-D_GNU_SOURCE -DCONFIG_VERSION=\"2024-02-14\" -DCONFIG_BIGNUM')
33
+
34
+ abort('could not find quickjs.h') unless find_header('quickjs.h')
35
+ abort('could not find cutils.h') unless find_header('cutils.h')
36
+ abort('could not find quickjs-libc.h') unless find_header('quickjs-libc.h')
37
+ #abort('could not find libbf.h') unless find_header('libbf.h')
38
+
39
+ # Makes all symbols private by default to avoid unintended conflict
40
+ # with other gems. To explicitly export symbols you can use RUBY_FUNC_EXPORTED
41
+ # selectively, or entirely remove this flag.
42
+ append_cflags('-fvisibility=hidden')
43
+ $warnflags = ''
44
+
45
+ create_makefile('quickjs/quickjsrb')
@@ -0,0 +1,22 @@
1
+ QuickJS Javascript Engine
2
+
3
+ Copyright (c) 2017-2021 Fabrice Bellard
4
+ Copyright (c) 2017-2021 Charlie Gordon
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ of this software and associated documentation files (the "Software"), to deal
8
+ in the Software without restriction, including without limitation the rights
9
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ copies of the Software, and to permit persons to whom the Software is
11
+ furnished to do so, subject to the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included in
14
+ all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19
+ THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
+ THE SOFTWARE.