prism 1.1.0 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (53) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +39 -1
  3. data/Makefile +1 -1
  4. data/config.yml +422 -3
  5. data/docs/build_system.md +8 -11
  6. data/docs/relocation.md +34 -0
  7. data/ext/prism/api_node.c +18 -10
  8. data/ext/prism/extconf.rb +13 -36
  9. data/ext/prism/extension.c +68 -0
  10. data/ext/prism/extension.h +1 -1
  11. data/include/prism/ast.h +427 -3
  12. data/include/prism/defines.h +22 -7
  13. data/include/prism/diagnostic.h +1 -0
  14. data/include/prism/parser.h +25 -12
  15. data/include/prism/version.h +2 -2
  16. data/include/prism.h +47 -0
  17. data/lib/prism/dot_visitor.rb +10 -0
  18. data/lib/prism/dsl.rb +4 -4
  19. data/lib/prism/ffi.rb +49 -2
  20. data/lib/prism/inspect_visitor.rb +2 -0
  21. data/lib/prism/node.rb +1839 -96
  22. data/lib/prism/parse_result/errors.rb +1 -1
  23. data/lib/prism/parse_result.rb +140 -3
  24. data/lib/prism/reflection.rb +2 -2
  25. data/lib/prism/relocation.rb +504 -0
  26. data/lib/prism/serialize.rb +17 -5
  27. data/lib/prism/string_query.rb +30 -0
  28. data/lib/prism/translation/parser/compiler.rb +36 -26
  29. data/lib/prism/translation/parser.rb +3 -3
  30. data/lib/prism/translation/ripper.rb +1 -5
  31. data/lib/prism/translation/ruby_parser.rb +14 -5
  32. data/lib/prism.rb +6 -4
  33. data/prism.gemspec +7 -1
  34. data/rbi/prism/dsl.rbi +4 -4
  35. data/rbi/prism/node.rbi +5118 -1030
  36. data/rbi/prism/parse_result.rbi +29 -0
  37. data/rbi/prism/string_query.rbi +12 -0
  38. data/rbi/prism.rbi +34 -34
  39. data/sig/prism/dsl.rbs +2 -2
  40. data/sig/prism/node.rbs +13 -98
  41. data/sig/prism/parse_result.rbs +20 -0
  42. data/sig/prism/relocation.rbs +185 -0
  43. data/sig/prism/string_query.rbs +11 -0
  44. data/src/diagnostic.c +3 -1
  45. data/src/node.c +18 -0
  46. data/src/prettyprint.c +32 -0
  47. data/src/prism.c +586 -195
  48. data/src/regexp.c +7 -3
  49. data/src/serialize.c +12 -0
  50. data/src/static_literals.c +1 -1
  51. data/src/util/pm_char.c +1 -1
  52. data/src/util/pm_string.c +1 -0
  53. metadata +9 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ea89f88aef2ec51d2cfb5868cf873ab256393f5ba632381a3a53631c2506dbc3
4
- data.tar.gz: 4da85d79e85d5cca843eb6e71cea07efc80a6e77608aa3027e1cd75c3c3b735a
3
+ metadata.gz: cc945a81285247ae139110607116e5ad0211e008f8e69d76002238755deca5dc
4
+ data.tar.gz: 81703e9b86fd950af63fbea201f8cd9ddec3a3a330d24c80aba7461782bb347b
5
5
  SHA512:
6
- metadata.gz: 1b7f92a58fa176b04aab230f49dcdc08f9b810575426402db6fc9eee0921ac5ddddf1f01f18bb9429a914955759e8d4cee5a70674e14eb0b0169018ce615780e
7
- data.tar.gz: e4a5a6ba40bc7692c6c904f452dd8ff18881703c99d51969507619368748eec29936dc3f521e8967b6d728ea331f26f9f670b44daedde2106f649104aefe0c30
6
+ metadata.gz: 39fb25eec8d603cd26f31ce75281e3cf257f8f21451e6687eda11d14e090013651284b1f7b35612004b0603105883d0e1d8de1d82b192ce5238843e03203e9fa
7
+ data.tar.gz: 4544a22d735276ca60cf3dd4e7b91ce64aa60539d555466d73d3eebb91502a0a357232bd1c0722232f3745481e554ba6ab2eb7a23f05a25e5d0c114f9077dc52
data/CHANGELOG.md CHANGED
@@ -6,6 +6,42 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [1.3.0] - 2024-12-21
10
+
11
+ ### Added
12
+
13
+ - Introduce `Prism::StringQuery`.
14
+ - Introduce `Prism::Relocation`.
15
+ - Track `do` keyword for `WhileNode` and `UntilNode`.
16
+ - Change the way the gem is built to rely on `mkmf` instead of `make`.
17
+ - Lots more documentation on node fields.
18
+
19
+ ### Changed
20
+
21
+ - Properly add an error for `def @foo; end`.
22
+ - Properly add an error for `foo(**, *)`.
23
+ - Fix up regression in string parsing in `RubyParser` translation.
24
+ - Reject invalid dot method call after match expression.
25
+ - Reject invalid operator after match expression.
26
+ - Fix up %-literals delimited by newlines.
27
+ - Properly add an error for `-> { _1; -> { _1 } }`.
28
+ - Reject blocks and keywords in index writes.
29
+
30
+ ## [1.2.0] - 2024-10-10
31
+
32
+ ### Added
33
+
34
+ - Introduce `Prism::CodeUnitsCache`.
35
+
36
+ ### Changed
37
+
38
+ - Properly handle lexing global variables that begin with `$-`.
39
+ - Properly reject invalid multi writes within parentheses.
40
+ - Fix unary `*` binding power.
41
+ - Set `contains_keywords` flag for implicit `gets` calls when `-p` is used.
42
+ - Properly reject invalid non-associative operator patterns.
43
+ - Do not warn about unused variables declared on negative lines.
44
+
9
45
  ## [1.1.0] - 2024-10-02
10
46
 
11
47
  ### Added
@@ -591,7 +627,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a
591
627
 
592
628
  - 🎉 Initial release! 🎉
593
629
 
594
- [unreleased]: https://github.com/ruby/prism/compare/v1.1.0...HEAD
630
+ [unreleased]: https://github.com/ruby/prism/compare/v1.3.0...HEAD
631
+ [1.3.0]: https://github.com/ruby/prism/compare/v1.2.0...v1.3.0
632
+ [1.2.0]: https://github.com/ruby/prism/compare/v1.1.0...v1.2.0
595
633
  [1.1.0]: https://github.com/ruby/prism/compare/v1.0.0...v1.1.0
596
634
  [1.0.0]: https://github.com/ruby/prism/compare/v0.30.0...v1.0.0
597
635
  [0.30.0]: https://github.com/ruby/prism/compare/v0.29.0...v0.30.0
data/Makefile CHANGED
@@ -11,7 +11,7 @@ FUZZ_OUTPUT_DIR = $(CURDIR)/fuzz/output
11
11
  SOEXT ?= $(shell ruby -e 'puts RbConfig::CONFIG["SOEXT"]')
12
12
 
13
13
  CPPFLAGS := -Iinclude $(CPPFLAGS)
14
- CFLAGS := -g -O2 -std=c99 -Wall -Werror -Wextra -Wpedantic -Wundef -Wconversion -Wno-missing-braces -fPIC -fvisibility=hidden $(CFLAGS)
14
+ CFLAGS := -g -O2 -std=c99 -Wall -Werror -Wextra -Wpedantic -Wundef -Wconversion -Wno-missing-braces -fPIC -fvisibility=hidden -Wimplicit-fallthrough $(CFLAGS)
15
15
  CC ?= cc
16
16
  AR ?= ar
17
17
  WASI_SDK_PATH := /opt/wasi-sdk