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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +31 -1
- data/README.md +3 -1
- data/config.yml +185 -126
- data/docs/serialization.md +3 -0
- data/ext/prism/api_node.c +2843 -2085
- data/ext/prism/extconf.rb +1 -1
- data/ext/prism/extension.c +35 -25
- data/ext/prism/extension.h +2 -2
- data/include/prism/ast.h +1048 -69
- data/include/prism/defines.h +9 -0
- data/include/prism/diagnostic.h +11 -3
- data/include/prism/options.h +55 -1
- data/include/prism/parser.h +27 -3
- data/include/prism/regexp.h +2 -1
- data/include/prism/util/pm_integer.h +6 -6
- data/include/prism/util/pm_newline_list.h +11 -0
- data/include/prism/util/pm_string.h +1 -0
- data/include/prism/version.h +3 -3
- data/lib/prism/desugar_compiler.rb +111 -74
- data/lib/prism/dispatcher.rb +2 -1
- data/lib/prism/dot_visitor.rb +21 -31
- data/lib/prism/dsl.rb +656 -471
- data/lib/prism/ffi.rb +3 -0
- data/lib/prism/inspect_visitor.rb +285 -57
- data/lib/prism/mutation_compiler.rb +5 -5
- data/lib/prism/node.rb +2282 -4754
- data/lib/prism/node_ext.rb +72 -11
- data/lib/prism/parse_result/errors.rb +65 -0
- data/lib/prism/parse_result/newlines.rb +28 -28
- data/lib/prism/parse_result.rb +25 -2
- data/lib/prism/reflection.rb +7 -7
- data/lib/prism/serialize.rb +468 -610
- data/lib/prism/translation/parser/compiler.rb +18 -18
- data/lib/prism/translation/parser/lexer.rb +1 -1
- data/lib/prism/translation/parser.rb +3 -3
- data/lib/prism/translation/ripper.rb +14 -14
- data/lib/prism/translation/ruby_parser.rb +43 -7
- data/prism.gemspec +3 -1
- data/rbi/prism/dsl.rbi +521 -0
- data/rbi/prism/node.rbi +1456 -5616
- data/rbi/prism.rbi +16 -16
- data/sig/prism/dsl.rbs +189 -305
- data/sig/prism/node.rbs +702 -603
- data/sig/prism/parse_result.rbs +2 -0
- data/src/diagnostic.c +22 -6
- data/src/node.c +277 -284
- data/src/options.c +18 -0
- data/src/prettyprint.c +99 -108
- data/src/prism.c +1282 -760
- data/src/regexp.c +72 -4
- data/src/serialize.c +165 -50
- data/src/token_type.c +2 -2
- data/src/util/pm_integer.c +14 -14
- data/src/util/pm_newline_list.c +29 -0
- data/src/util/pm_string.c +9 -5
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ee4794cf8223259f359bdb0f82073a3f2a2a550aa9a1a815701f99e1a23b959a
|
4
|
+
data.tar.gz: a487bdda3f0a92c6082ae815e6ef57bfb3a5ed986f0f601b5c77aa141c9e751f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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/
|
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
|
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)
|