yarp 0.9.0 → 0.10.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (54) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +15 -1
  3. data/Makefile +5 -1
  4. data/config.yml +156 -125
  5. data/docs/encoding.md +5 -5
  6. data/docs/serialization.md +2 -2
  7. data/ext/yarp/api_node.c +142 -98
  8. data/ext/yarp/extension.c +21 -7
  9. data/ext/yarp/extension.h +1 -1
  10. data/include/yarp/ast.h +327 -18
  11. data/include/yarp/defines.h +2 -1
  12. data/include/yarp/diagnostic.h +3 -3
  13. data/include/yarp/enc/yp_encoding.h +10 -10
  14. data/include/yarp/parser.h +19 -19
  15. data/include/yarp/regexp.h +1 -1
  16. data/include/yarp/unescape.h +4 -4
  17. data/include/yarp/util/yp_buffer.h +3 -0
  18. data/include/yarp/util/yp_char.h +16 -16
  19. data/include/yarp/util/yp_constant_pool.h +2 -2
  20. data/include/yarp/util/yp_newline_list.h +5 -5
  21. data/include/yarp/util/yp_string.h +4 -4
  22. data/include/yarp/util/yp_string_list.h +0 -3
  23. data/include/yarp/util/yp_strpbrk.h +1 -1
  24. data/include/yarp/version.h +2 -2
  25. data/include/yarp.h +5 -4
  26. data/lib/yarp/desugar_visitor.rb +59 -122
  27. data/lib/yarp/node.rb +230 -240
  28. data/lib/yarp/serialize.rb +16 -16
  29. data/lib/yarp.rb +5 -5
  30. data/src/diagnostic.c +1 -1
  31. data/src/enc/yp_big5.c +15 -42
  32. data/src/enc/yp_euc_jp.c +16 -43
  33. data/src/enc/yp_gbk.c +19 -46
  34. data/src/enc/yp_shift_jis.c +16 -43
  35. data/src/enc/yp_tables.c +36 -38
  36. data/src/enc/yp_unicode.c +20 -25
  37. data/src/enc/yp_windows_31j.c +16 -43
  38. data/src/node.c +1271 -899
  39. data/src/prettyprint.c +87 -48
  40. data/src/regexp.c +21 -21
  41. data/src/serialize.c +28 -15
  42. data/src/unescape.c +151 -121
  43. data/src/util/yp_buffer.c +7 -2
  44. data/src/util/yp_char.c +34 -34
  45. data/src/util/yp_constant_pool.c +4 -4
  46. data/src/util/yp_memchr.c +1 -1
  47. data/src/util/yp_newline_list.c +5 -4
  48. data/src/util/yp_string.c +22 -20
  49. data/src/util/yp_string_list.c +0 -6
  50. data/src/util/yp_strncasecmp.c +3 -6
  51. data/src/util/yp_strpbrk.c +8 -8
  52. data/src/yarp.c +355 -216
  53. data/yarp.gemspec +1 -1
  54. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '028bafce371c205e4f9a845aa0328a8911519b064ec92be9a970c0077088ca5c'
4
- data.tar.gz: ed653e7a3734884de2f42d1df304be7eb1532b29d7acf63214c747ee84426ec0
3
+ metadata.gz: 7d7fbd6801f30b7ad185ea9884ad6ab4a0b0fd07494dbf96d90a560d7c5223a3
4
+ data.tar.gz: a28e10e86eee28950106cea5be18020349ea5181111f4d45d540322677b5eed4
5
5
  SHA512:
6
- metadata.gz: e33c681424d19626c0ee1d5c21265bcdfce4ec56909a5707d4bf7025ea5356b5ac41b080a1e54a8490124065a1595bd5833af8e488558f0ff01c4f14a92d0430
7
- data.tar.gz: d55c0483e944f9a33e76a2baeef11841da8f8bf8755512ff90497d07b0fedf2dc568f6ad8c384831b6b382b1482e34177c6dbd8314d6570542c59faca71ad23e
6
+ metadata.gz: c30fdd9590910182706dc3d6f0747ce8c467156ede3c2ed727d8a2efb2aa7f821abd2e5465e80ddfe122ba80c03af23ab1d60c50f7a39348d797106c9c4567d7
7
+ data.tar.gz: 8c877d31c11834e6e0d22b6acab729258cd87ce4a53e026c8b0ff4b92f98f90a0daa57b21811a29d3c4e2387a65b4a3935d165a4311985d40b3511f95c94f280
data/CHANGELOG.md CHANGED
@@ -6,6 +6,19 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.10.0] - 2023-09-01
10
+
11
+ ### Added
12
+
13
+ - `InstanceVariable*Node` and `ClassVariable*Node` objects now have their `name` returning a Symbol. This is because they are now part of the constant pool.
14
+ - `NumberedReferenceReadNode` now has a `number` field, which returns an Integer.
15
+
16
+ ### Changed
17
+
18
+ - **BREAKING**: Various `operator_id` and `constant_id` fields have been renamed to `operator` and `name`, respectively. See [09d0a144](https://github.com/ruby/yarp/commit/09d0a144dfd519c5b5f96f0b6ee95d256e2cb1a6) for details.
19
+ - `%w`, `%W`, `%i`, `%I`, `%q`, and `%Q` literals can now span around the contents of a heredoc.
20
+ - **BREAKING**: All of the public C APIs that accept the source string now accept `const uint8_t *` as opposed to `const char *`.
21
+
9
22
  ## [0.9.0] - 2023-08-25
10
23
 
11
24
  ### Added
@@ -81,7 +94,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a
81
94
 
82
95
  - 🎉 Initial release! 🎉
83
96
 
84
- [unreleased]: https://github.com/ruby/yarp/compare/v0.9.0...HEAD
97
+ [unreleased]: https://github.com/ruby/yarp/compare/v0.10.0...HEAD
98
+ [0.10.0]: https://github.com/ruby/yarp/compare/v0.9.0...v0.10.0
85
99
  [0.9.0]: https://github.com/ruby/yarp/compare/v0.8.0...v0.9.0
86
100
  [0.8.0]: https://github.com/ruby/yarp/compare/v0.7.0...v0.8.0
87
101
  [0.7.0]: https://github.com/ruby/yarp/compare/v0.6.0...v0.7.0
data/Makefile CHANGED
@@ -44,6 +44,7 @@ build/static/%.o: src/%.c Makefile $(HEADERS)
44
44
 
45
45
  build/fuzz.%: $(SOURCES) fuzz/%.c fuzz/fuzz.c
46
46
  $(ECHO) "building $* fuzzer"
47
+ $(Q) mkdir -p $(@D)
47
48
  $(ECHO) "building main fuzz binary"
48
49
  $(Q) AFL_HARDEN=1 afl-clang-lto $(DEBUG_FLAGS) $(CPPFLAGS) $(CFLAGS) $(FUZZ_FLAGS) -O0 -fsanitize-ignorelist=fuzz/asan.ignore -fsanitize=fuzzer,address -ggdb3 -std=c99 -Iinclude -o $@ $^
49
50
  $(ECHO) "building cmplog binary"
@@ -70,10 +71,13 @@ fuzz-run-%: FORCE fuzz-docker-build
70
71
  $(Q) docker run -it --rm -v $(shell pwd):/yarp -v $(FUZZ_OUTPUT_DIR):/fuzz_output yarp/fuzz /bin/bash -c "./fuzz/$*.sh /fuzz_output/$*"
71
72
  FORCE:
72
73
 
74
+ fuzz-clean:
75
+ $(Q) rm -f -r fuzz/output
76
+
73
77
  clean:
74
78
  $(Q) rm -f -r build
75
79
 
76
- .PHONY: clean
80
+ .PHONY: clean fuzz-clean
77
81
 
78
82
  all-no-debug: DEBUG_FLAGS := -DNDEBUG=1
79
83
  all-no-debug: OPTFLAGS := -O3