prism 0.30.0 → 1.0.0

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 (57) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +31 -1
  3. data/README.md +3 -1
  4. data/config.yml +185 -126
  5. data/docs/serialization.md +3 -0
  6. data/ext/prism/api_node.c +2843 -2085
  7. data/ext/prism/extconf.rb +1 -1
  8. data/ext/prism/extension.c +35 -25
  9. data/ext/prism/extension.h +2 -2
  10. data/include/prism/ast.h +1048 -69
  11. data/include/prism/defines.h +9 -0
  12. data/include/prism/diagnostic.h +11 -3
  13. data/include/prism/options.h +55 -1
  14. data/include/prism/parser.h +27 -3
  15. data/include/prism/regexp.h +2 -1
  16. data/include/prism/util/pm_integer.h +6 -6
  17. data/include/prism/util/pm_newline_list.h +11 -0
  18. data/include/prism/util/pm_string.h +1 -0
  19. data/include/prism/version.h +3 -3
  20. data/lib/prism/desugar_compiler.rb +111 -74
  21. data/lib/prism/dispatcher.rb +2 -1
  22. data/lib/prism/dot_visitor.rb +21 -31
  23. data/lib/prism/dsl.rb +656 -471
  24. data/lib/prism/ffi.rb +3 -0
  25. data/lib/prism/inspect_visitor.rb +285 -57
  26. data/lib/prism/mutation_compiler.rb +5 -5
  27. data/lib/prism/node.rb +2282 -4754
  28. data/lib/prism/node_ext.rb +72 -11
  29. data/lib/prism/parse_result/errors.rb +65 -0
  30. data/lib/prism/parse_result/newlines.rb +28 -28
  31. data/lib/prism/parse_result.rb +25 -2
  32. data/lib/prism/reflection.rb +7 -7
  33. data/lib/prism/serialize.rb +468 -610
  34. data/lib/prism/translation/parser/compiler.rb +18 -18
  35. data/lib/prism/translation/parser/lexer.rb +1 -1
  36. data/lib/prism/translation/parser.rb +3 -3
  37. data/lib/prism/translation/ripper.rb +14 -14
  38. data/lib/prism/translation/ruby_parser.rb +43 -7
  39. data/prism.gemspec +3 -1
  40. data/rbi/prism/dsl.rbi +521 -0
  41. data/rbi/prism/node.rbi +1456 -5616
  42. data/rbi/prism.rbi +16 -16
  43. data/sig/prism/dsl.rbs +189 -305
  44. data/sig/prism/node.rbs +702 -603
  45. data/sig/prism/parse_result.rbs +2 -0
  46. data/src/diagnostic.c +22 -6
  47. data/src/node.c +277 -284
  48. data/src/options.c +18 -0
  49. data/src/prettyprint.c +99 -108
  50. data/src/prism.c +1282 -760
  51. data/src/regexp.c +72 -4
  52. data/src/serialize.c +165 -50
  53. data/src/token_type.c +2 -2
  54. data/src/util/pm_integer.c +14 -14
  55. data/src/util/pm_newline_list.c +29 -0
  56. data/src/util/pm_string.c +9 -5
  57. metadata +4 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 46cabe6b76e675b905cb9b2941faf00d35c0c5043e480c094952a89404e87587
4
- data.tar.gz: 50a764fb701657e5936b764a7438f49ab074f45d5bee3e435bf70c9b891067be
3
+ metadata.gz: ee4794cf8223259f359bdb0f82073a3f2a2a550aa9a1a815701f99e1a23b959a
4
+ data.tar.gz: a487bdda3f0a92c6082ae815e6ef57bfb3a5ed986f0f601b5c77aa141c9e751f
5
5
  SHA512:
6
- metadata.gz: 58535a5049cf8d6b8ceb97721135f58ca2fa4e7311cce8c336b6d4d5674de38861a07728651859ffe926bf84db8c14454b543d5d26732174de4c67a2be7cb46b
7
- data.tar.gz: 16ae75556351bd4c96a54dbd930e466c40695419c29ba9cf5b048dc1173fc397094974bea313258e7615a27f67c9b55b00d72dcee33ddacc1613169005b0e184
6
+ metadata.gz: efb1b1522544c2c1391536ac89179d4746a0f84765778ee86fcc8e3ad111bd26f788f6d673b9563cb69ad812f620400756e2a4c5a2e28c7f7b1e44bcd4518f36
7
+ data.tar.gz: 93d7060fdf6b0deff8d20269887125fd24e52ae90bcd6c8b770cec068d3b595446f2552467c2782786198799d6b55b86b447e9f73bafba18b0a5e0df6f580d9d
data/CHANGELOG.md CHANGED
@@ -6,6 +6,35 @@ 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.0.0] - 2024-08-28
10
+
11
+ ### Added
12
+
13
+ - Add `Node#breadth_first_search`.
14
+ - Add `Node#node_id`.
15
+ - Add `ArgumentsNode#contains_splat?`.
16
+ - Passing the special value `false` for the `encoding` option tells Prism to ignore magic encoding comments.
17
+ - Expose flags on every node type (allows checking static literal and newline).
18
+ - Implement mismatched indentation warning.
19
+ - Add C API for receiving a callback when parsing shebangs with additional flags.
20
+
21
+ ### Changed
22
+
23
+ - **BREAKING**: Some fields are renamed that had illogical names. The previous names all now emit deprecation warnings.
24
+ - `CaseMatchNode#consequent` was renamed to `CaseMatchNode#else_clause`
25
+ - `CaseNode#consequent` was renamed to `CaseNode#else_clause`
26
+ - `IfNode#consequent` was renamed to `IfNode#subsequent`
27
+ - `RescueNode#consequent` was renamed to `RescueNode#subsequent`
28
+ - `UnlessNode#consequent` was renamed to `UnlessNode#else_clause`
29
+ - Block exits are now allowed in loop predicates (e.g., `while _ && break do end`).
30
+ - Multi-writes are now disallowed when not at the statement level.
31
+ - Ensure that range operators are non-associative.
32
+ - (JavaScript) Correctly deserialize encoded strings.
33
+ - Properly support parsing regular expressions in extended mode.
34
+ - Use gmake on FreeBSD.
35
+ - Parsing streams now handles NUL bytes in the middle of the stream.
36
+ - Properly detect invalid returns.
37
+
9
38
  ## [0.30.0] - 2024-06-07
10
39
 
11
40
  ### Added
@@ -538,7 +567,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a
538
567
 
539
568
  - 🎉 Initial release! 🎉
540
569
 
541
- [unreleased]: https://github.com/ruby/prism/compare/v0.30.0...HEAD
570
+ [unreleased]: https://github.com/ruby/prism/compare/v1.0.0...HEAD
571
+ [1.0.0]: https://github.com/ruby/prism/compare/v0.30.0...v1.0.0
542
572
  [0.30.0]: https://github.com/ruby/prism/compare/v0.29.0...v0.30.0
543
573
  [0.29.0]: https://github.com/ruby/prism/compare/v0.28.0...v0.29.0
544
574
  [0.28.0]: https://github.com/ruby/prism/compare/v0.27.0...v0.28.0
data/README.md CHANGED
@@ -40,7 +40,8 @@ The repository contains the infrastructure for both a shared library (libprism)
40
40
  ├── rust
41
41
  │   ├── ruby-prism Rustified crate for the shared library
42
42
  │   └── ruby-prism-sys FFI binding for Rust
43
- ├── sample Sample code that uses the Ruby API for documentation
43
+ ├── sample
44
+ │ └── prism Sample code that uses the Ruby API for documentation purposes
44
45
  ├── sig RBS type signatures for the Ruby library
45
46
  ├── src
46
47
  │   ├── util various utility files
@@ -120,6 +121,7 @@ Prism has been integrated into the majority of Ruby runtimes, many libraries, an
120
121
  ### Libraries
121
122
 
122
123
  * [dispersion](https://github.com/joeldrapper/dispersion)
124
+ * [minifyrb](https://github.com/koic/minifyrb)
123
125
  * [packwerk](https://github.com/Shopify/packwerk/pull/388) (via parser translator)
124
126
  * [rbi](https://github.com/Shopify/rbi)
125
127
  * [rails](https://github.com/rails/rails)