summaryrefslogtreecommitdiff
path: root/prism/templates/lib
AgeCommit message (Collapse)Author
6 days[ruby/prism] Bump to v1.8.0Takashi Kokubun
https://github.com/ruby/prism/commit/9c12be6e6a
2026-01-01[ruby/prism] Fix spacing in the generated #each_child_nodeBenoit Daloze
https://github.com/ruby/prism/commit/91f60cb736
2025-12-29[ruby/prism] Optimize ruby visitorEarlopain
`compact_child_nodes` allocates an array. We can skip that step by simply yielding the nodes. Benchmark for visiting the rails codebase: ```rb require "prism" require "benchmark/ips" files = Dir.glob("../rails/**/*.rb") results = files.map { Prism.parse_file(it) } visitor = Prism::Visitor.new Benchmark.ips do |x| x.config(warmup: 3, time: 10) x.report do results.each do visitor.visit(it.value) end end end RubyVM::YJIT.enable Benchmark.ips do |x| x.config(warmup: 3, time: 10) x.report do results.each do visitor.visit(it.value) end end end ``` Before: ``` ruby 3.4.8 (2025-12-17 revision https://github.com/ruby/prism/commit/995b59f666) +PRISM [x86_64-linux] Warming up -------------------------------------- 1.000 i/100ms Calculating ------------------------------------- 2.691 (± 0.0%) i/s (371.55 ms/i) - 27.000 in 10.089422s ruby 3.4.8 (2025-12-17 revision https://github.com/ruby/prism/commit/995b59f666) +YJIT +PRISM [x86_64-linux] Warming up -------------------------------------- 1.000 i/100ms Calculating ------------------------------------- 7.278 (±13.7%) i/s (137.39 ms/i) - 70.000 in 10.071568s ``` After: ``` ruby 3.4.8 (2025-12-17 revision https://github.com/ruby/prism/commit/995b59f666) +PRISM [x86_64-linux] Warming up -------------------------------------- 1.000 i/100ms Calculating ------------------------------------- 3.429 (± 0.0%) i/s (291.65 ms/i) - 35.000 in 10.208580s ruby 3.4.8 (2025-12-17 revision https://github.com/ruby/prism/commit/995b59f666) +YJIT +PRISM [x86_64-linux] Warming up -------------------------------------- 1.000 i/100ms Calculating ------------------------------------- 16.815 (± 0.0%) i/s (59.47 ms/i) - 169.000 in 10.054668s ``` ~21% faster on the interpreter, ~56% with YJIT https://github.com/ruby/prism/commit/bf631750cf
2025-12-18[ruby/prism] Bump to v1.7.0Kevin Newton
https://github.com/ruby/prism/commit/21c499d6e4
2025-10-16[ruby/prism] Bump to v1.6.0Kevin Newton
https://github.com/ruby/prism/commit/b72fcc6183
2025-10-09[ruby/prism] Bump to vKevin Newton
https://github.com/ruby/prism/commit/7574837b7b
2025-09-13[ruby/prism] Bump to v1.5.1Kevin Newton
https://github.com/ruby/prism/commit/cac5118884
2025-09-12[ruby/prism] Bump to v1.5.0Kevin Newton
https://github.com/ruby/prism/commit/194edab827
2025-06-09[ruby/prism] Fix typo in visitor example codeTim Craft
https://github.com/ruby/prism/commit/5aa963f8e6
2025-05-23[ruby/prism] Monomorphise visitor methodsUfuk Kayserilioglu
The current implementation of the visitor pattern in Prism uses a single method (`visit_child_nodes`) to handle all node types. This can lead to performance issues since the `node` argument will end up being polymorphic, and will prevent effective use of inline caches, which in CRuby are monomorphic. This commit generates an inlined version of the previous code for each node type, thus making the calls inside visitor methods monomorphic. This should improve performance, especially in cases where the visitor is called frequently. https://github.com/ruby/prism/commit/60d324a701
2025-05-13Handle to look up CGI::EscapeExt instead of using LoadError. cgi/escape is ↵Hiroshi SHIBATA
provided snce Ruby 2.3 Notes: Merged: https://github.com/ruby/ruby/pull/13311
2025-05-09Use cgi/escape instead of cgi/utilHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/13275
2025-04-24Use cgi/util if that uses like CGI.escape methodsHiroshi SHIBATA
2025-03-23[ruby/prism] Update Ruby depsKevin Newton
https://github.com/ruby/prism/commit/594e2a69ed
2025-03-20[ruby/prism] Dynamically register events to dispatchSam Bostock
Instead of requiring the consumer to provide a list of all events which they wish to handle, we can give them to option of dynamically detecting them, by scanning the listener's public methods. This approach is similar to that used by Minitest (scanning for `test_` methods) and Rails generators (running all public methods in the order they are defined). While this is slower than specifying a hard coded list, the penalty is only during registration. There is no change the the behaviour of dispatching the events. https://github.com/ruby/prism/commit/781ebed743
2025-03-19[ruby/prism] Mark Prism as ractor-safeKevin Newton
https://github.com/ruby/prism/commit/c02429765b
2025-03-18[ruby/prism] Bump to v1.4.0Kevin Newton
https://github.com/ruby/prism/commit/71d31db496
2025-03-12[ruby/prism] Revert "Mark extension as Ractor-safe"Kevin Newton
https://github.com/ruby/prism/commit/56eaf53732
2025-03-12[ruby/prism] Mark extension as Ractor-safeKevin Newton
https://github.com/ruby/prism/commit/10e5431b38
2025-01-14[ruby/prism] Refactor serializerKevin Newton
https://github.com/ruby/prism/commit/8ab2532f09
2025-01-14[ruby/prism] Freeze AST optionKevin Newton
To make it so that you can pass `freeze: true` to Prism parse methods and get back a deeply-frozen AST that is Ractor- shareable. https://github.com/ruby/prism/commit/8e6a93b2d2
2025-01-12[ruby/prism] Frozen strings in the ASTKevin Newton
https://github.com/ruby/prism/commit/8d9d429155
2025-01-11[ruby/prism] Bump to v1.3.0Kevin Newton
https://github.com/ruby/prism/commit/a679ee0e5c
2024-12-16[ruby/prism] Bump to v1.2.0Kevin Newton
https://github.com/ruby/prism/commit/817a8e39d9 Notes: Merged: https://github.com/ruby/ruby/pull/12358
2024-12-16[ruby/prism] Bump to v1.1.0Kevin Newton
https://github.com/ruby/prism/commit/f80026883d Notes: Merged: https://github.com/ruby/ruby/pull/12358
2024-12-11[ruby/prism] Bump typechecking depsKevin Newton
https://github.com/ruby/prism/commit/230c8b8a48
2024-10-16[ruby/prism] RelocationKevin Newton
https://github.com/ruby/prism/commit/5ea6042408
2024-10-09[ruby/prism] Attempt to assume binary is UTF-8Kevin Newton
https://github.com/ruby/prism/commit/343197e4ff
2024-09-25[ruby/prism] Type every node field and mark on-error-only types explicitlyBenoit Daloze
* For Loader.java, do not deserialize the AST if there are errors, so then Java nodes only have non-error types for fields. https://github.com/ruby/prism/commit/ae78e3c605
2024-09-13[ruby/prism] Refactor and move common node flags count into a constant to ↵Andrew Konchin
reuse in templates https://github.com/ruby/prism/commit/c20bf05ecc
2024-09-13[ruby/prism] Unify code style of flags generation in the nodes templatesAndrew Konchin
https://github.com/ruby/prism/commit/dbb7e0a44e
2024-08-28[PRISM] Sync version updateKevin Newton
2024-08-13[ruby/prism] Fix up spacing in generated node.rbKevin Newton
https://github.com/ruby/prism/commit/50d79b734b
2024-07-17[ruby/prism] [Doc] Tweak example of `Prism::Dispatcher`Koichi ITO
This PR tweaked the documentation to correct an error encountered when running the example code of `Prism::Dispatcher`. This aims to make understanding the example smoother. https://github.com/ruby/prism/commit/165a1a0e78
2024-07-11[ruby/prism] Bump typecheck dependencies to fix CIKevin Newton
https://github.com/ruby/prism/commit/c7a4a90ee8
2024-07-11[ruby/prism] Various cleanup for initializers and typechecksKevin Newton
https://github.com/ruby/prism/commit/86cf82794a
2024-07-11[ruby/prism] Add node ids to nodesKevin Newton
https://github.com/ruby/prism/commit/bf16ade7f9
2024-07-11[ruby/prism] Move Node#type and Node::type documentationKevin Newton
https://github.com/ruby/prism/commit/08a71f6259
2024-07-11[ruby/prism] Add Node#breadth_first_searchKevin Newton
https://github.com/ruby/prism/commit/1ffb141199
2024-07-11[ruby/prism] Expose common flags in inspect outputKevin Newton
https://github.com/ruby/prism/commit/d0143865c2
2024-07-11[ruby/prism] Expose flags on every node typeKevin Newton
https://github.com/ruby/prism/commit/9f12a56fd6
2024-07-11[ruby/prism] Move location to second position for node initializersKevin Newton
https://github.com/ruby/prism/commit/4cc0eda4ca
2024-06-07Sync prism version to latestKevin Newton
2024-05-13[ruby/prism] Autoload newlines and comment visitorsKevin Newton
Having the @newline instance variable in every node adds up, and since it is so rarely used, we only want to add it when necessary. Moving this into an autoloaded file and moving the instance variable out of the default initializers reduces allocated memory because the nodes are now smaller and some fit into the compact list. On my machine, I'm seeing about an 8% drop. https://github.com/ruby/prism/commit/eea92c07d2
2024-05-10[PRISM] Bump to version 0.29.0Kevin Newton
2024-05-08[PRISM] Sync prism version bumpKevin Newton
2024-05-03[ruby/prism] Prism::Location#adjoinKevin Newton
https://github.com/ruby/prism/commit/a298db68e3
2024-05-03[ruby/prism] Prism::Node#tunnelKevin Newton
https://github.com/ruby/prism/commit/0bf5d651da
2024-05-03[ruby/prism] Create specialized `ASCIISource` with asciionly optimizationsVinicius Stock
https://github.com/ruby/prism/commit/40993166a8
2024-05-02[ruby/prism] Node#script_lines and supporting infraKevin Newton
https://github.com/ruby/prism/commit/cb4a8ab772