summaryrefslogtreecommitdiff
path: root/prism/templates/lib
AgeCommit message (Collapse)Author
2024-04-26[ruby/prism] Bump to v0.27.0Kevin Newton
https://github.com/ruby/prism/commit/c9edeef91a
2024-04-26[ruby/prism] Location#slice_lines, Node#slice_linesKevin Newton
https://github.com/ruby/prism/commit/9b61f6fdb3
2024-04-24[ruby/prism] Change inspect from recursive to a queueKevin Newton
We would previously cause a stack overflow if we parsed a file that was too deeply nested when we were calling inspect. Instead, we now use a queue of commands to do it linearly so we don't. https://github.com/ruby/prism/commit/0f21f5bfe1
2024-04-23[ruby/prism] Implement case equality on nodesPhilip Mueller
https://github.com/ruby/prism/commit/dc121e4fdf
2024-04-22[ruby/prism] Consolidate integer fields into a single reflection classKevin Newton
https://github.com/ruby/prism/commit/0156057580
2024-04-19[ruby/prism] Split parse result based on typeKevin Newton
https://github.com/ruby/prism/commit/17194e096d
2024-04-18[ruby/prism] Bump to v0.26.0Kevin Newton
https://github.com/ruby/prism/commit/eadb09ef36
2024-04-17[ruby/prism] Add a reflection API for determining the fields of a nodeKevin Newton
https://github.com/ruby/prism/commit/f3f9950a74
2024-04-05[ruby/prism] Bump to v0.25.0Kevin Newton
https://github.com/ruby/prism/commit/4da514456f
2024-03-28[ruby/prism] Ensure deserialization works with errors+warnings>256Kevin Newton
https://github.com/ruby/prism/commit/f540e830b5
2024-03-18[ruby/prism] Use `require_relative` in the Prism codebaseKoichi ITO
If there are many searches in the `$LOAD_PATH` in the user environment, require will perform unnecessary searches that are not needed. In contrast, `require_relative` is efficient because it uses a relative path. https://github.com/ruby/prism/commit/438ccc67bd
2024-03-06[ruby/prism] Expose types on diagnosticsKevin Newton
https://github.com/ruby/prism/commit/a735c2262f
2024-03-06[ruby/prism] Move polyfill to separate file to type-check it independently.Ufuk Kayserilioglu
https://github.com/ruby/prism/commit/2a583b041b
2024-03-06[ruby/prism] `Prism::Compiler` should be a subclass of `Prism::Visitor`Ufuk Kayserilioglu
https://github.com/ruby/prism/commit/a01d6a4e32
2024-03-06[ruby/prism] Fix some missing methods/signatures in RBIsUfuk Kayserilioglu
https://github.com/ruby/prism/commit/1d87b8c46c
2024-03-06[ruby/prism] Move template related methods/classes under `Prism::Template` ↵Ufuk Kayserilioglu
namespace https://github.com/ruby/prism/commit/0e4dbcd3e4
2024-03-04[ruby/prism] Use a more efficient StringIO on TruffleRubyBenoit Daloze
* The stdlib StringIO is synchronized and this occurs a high overhead. * This is about twice as fast on TruffleRuby but surprisingly it is slower on JRuby. I am not sure why but probably @ivar access and integer arithmetic is much slower than Java field access/arithmetic on JRuby. * On CRuby interpreter it is slower, which is expected as the GVL already protects StringIO. * So we enable this only on TruffleRuby to not slow down other Rubies. * PRISM_FFI_BACKEND=true ruby -v -Ilib -rprism -rbenchmark -e '300.times { p Benchmark.realtime { Dir.glob("lib/**/*.rb") { |f| Prism.parse_file(f) } } }' ruby 3.3.0: 0.215 => 0.251 (cext: 0.062) ruby 3.3.0 YJIT: 0.118 => 0.113 (cext: 0.053) truffleruby JVM: 0.101 => 0.054 jruby 9.4.6.0: 0.162 => 0.219 jruby 9.4.6.0 indy: 0.078 => 0.086 * For the record here are the numbers for using the String directly, without a StringIO-like object: ruby 3.3.0: 0.215 => 0.234 (cext: 0.062) ruby 3.3.0 YJIT: 0.118 => 0.111 (cext: 0.053) truffleruby native: 0.101 => 0.053 jruby 9.4.6.0: 0.162 => 0.195 jruby 9.4.6.0 indy: 0.078 => 0.082 As we can see, that extra object adds a non-trivial overhead on CRuby interpreter and JRuby. But we need to make it possible to use StringIO and SimpleStringIO interchangeably. https://github.com/ruby/prism/commit/938677cbd2
2024-02-29[ruby/prism] Lazily create Location objects in ↵Benoit Daloze
Prism::Serialize::Loader#load_location * Following the changes in #2428. * PRISM_FFI_BACKEND=true ruby -v -Ilib -rprism -rbenchmark -e '10.times { p Benchmark.realtime { Dir.glob("lib/**/*.rb") { |f| Prism.parse_file(f) } } }' ruby 3.3.0: 0.255 => 0.210 ruby 3.3.0 YJIT: 0.150 => 0.120 https://github.com/ruby/prism/commit/fabf809bbf
2024-02-29[ruby/prism] Resync RBI and test it in CIKevin Newton
https://github.com/ruby/prism/commit/4ef4032774
2024-02-28[ruby/prism] Rewrite logic for CHECK_FIELD_KIND to improve readabilityBenoit Daloze
https://github.com/ruby/prism/commit/f731edcc26
2024-02-28[ruby/prism] Add a simple way to check field kinds are correct by setting ↵Benoit Daloze
$CHECK_FIELD_KIND https://github.com/ruby/prism/commit/33e987ba3c
2024-02-24[ruby/prism] Less code modifications. More steep:ignore for nowGopal Patel
https://github.com/ruby/prism/commit/7905bdbf83
2024-02-24[ruby/prism] Relax Location#source to be optionalGopal Patel
https://github.com/ruby/prism/commit/9f00fe7510
2024-02-24[ruby/prism] Remove Ripper from public RBS, type-assert remaining issuesGopal Patel
https://github.com/ruby/prism/commit/5fda7a0760
2024-02-24[ruby/prism] Split private typesGopal Patel
https://github.com/ruby/prism/commit/0209d093ec
2024-02-24[ruby/prism] Use steep to type check RBS and Ruby filesGopal Patel
https://github.com/ruby/prism/commit/eabed9f4fd
2024-02-22[ruby/prism] Parse float valuesKevin Newton
https://github.com/ruby/prism/commit/9137226a52
2024-02-22[ruby/prism] Add an IntegerField for parsing integer valuesKevin Newton
https://github.com/ruby/prism/commit/120d8c0479
2024-02-18[ruby/prism] Lazy methods for start and end offset on nodeKevin Newton
https://github.com/ruby/prism/commit/4510e2746d
2024-02-15[ruby/prism] Make location methods thread-safeBenoit Daloze
* Before it could result in NoMethodError if multiple threads were calling location methods: https://gist.github.com/eregon/b78b7f266d7ee0a278a389cfd1782232 https://github.com/ruby/prism/commit/ff762dcccd
2024-02-15[PRISM] Sync prism version bumpKevin Newton
2024-02-15[ruby/prism] Speed up creating Ruby ASTKevin Newton
When creating the Ruby AST, we were previously allocating Location objects for every node and every inner location. Instead, this commit changes it to pack both the start offset and length into a single u64 and pass that into the nodes. Then, when the locations are requested via a reader method, we lazily allocate the Location objects. https://github.com/ruby/prism/commit/de203dca83 Co-Authored-By: Aaron Patterson <tenderlove@ruby-lang.org>
2024-02-14Prefer `Array.new(n) {}` to `n.times.map {}`Benoit Daloze
* It is quite a bit faster: ruby -rbenchmark/ips -e 'Benchmark.ips { |x| x.report("times.map") { 1000.times.map {} }; x.report("Array.new") { Array.new(1000) {} }; x.compare! }' ruby 3.3.0 (2023-12-25 revision 5124f9ac75) [x86_64-linux] Warming up -------------------------------------- times.map 976.000 i/100ms Array.new 1.641k i/100ms Calculating ------------------------------------- times.map 9.808k (± 0.3%) i/s - 49.776k in 5.075013s Array.new 16.601k (± 1.0%) i/s - 83.691k in 5.041970s Comparison: Array.new: 16600.8 i/s times.map: 9808.2 i/s - 1.69x slower
2024-02-14[ruby/prism] Remove attr_writer's for ParseResult#start_line and #offsetsBenoit Daloze
* As the user should not set these. * Use #instance_variable_set/rb_iv_set() instead internally. https://github.com/ruby/prism/commit/cace09fb8c
2024-02-14[ruby/prism] Serialize the newline_list to avoid recomputing it again laterBenoit Daloze
* Fixes https://github.com/ruby/prism/issues/2380 https://github.com/ruby/prism/commit/4eaaa90114
2024-02-14[PRISM] Sync to latest prismKevin Newton
2024-02-07Bump prism versionKevin Newton
2024-02-07[ruby/prism] Support for Ruby 2.7Kevin Newton
https://github.com/ruby/prism/commit/1a15b70a8e
2024-02-05[ruby/prism] Add another error type for raising argument errorsKevin Newton
https://github.com/ruby/prism/commit/f3030cb2b2
2024-02-05Sync to latest prismKevin Newton
2024-02-01Sync to latest prismKevin Newton
2024-01-27[ruby/prism] Error follow-upKevin Newton
Split up the diagnostic levels so that error and warning levels aren't mixed. Also fix up deconstruct_keys implementation. https://github.com/ruby/prism/commit/bd3eeb308d Co-authored-by: Benoit Daloze <eregontp@gmail.com>
2024-01-26[ruby/prism] Add level to warnings and errors to categorize themBenoit Daloze
* Fixes https://github.com/ruby/prism/issues/2082 https://github.com/ruby/prism/commit/7a74576357
2024-01-24[ruby/prism] Force encoding during deserialization of constantsMax Prokopiev
otherwise we get failing tests if we have non-ascii characters in fixtures/**/*.txt https://github.com/ruby/prism/commit/9323243569
2024-01-16[ruby/prism] Provide abstract methods in Prism::NodeKevin Newton
To make typechecking easier. https://github.com/ruby/prism/commit/8f96877d7a
2024-01-03[ruby/prism] Include field comments in Java sourceBenoit Daloze
https://github.com/ruby/prism/commit/4a9389f304
2024-01-02[ruby/prism] Introduce field commentsKevin Newton
In an effort to further improve our documentation, this commit introduces the concept of templating comments onto fields. I hope to get more documentation above the nuances of specific fields this way going forward. With this, we template the comments into C and Ruby. I haven't done JS or Java yet, but we can touch those in the future, especially once their documentation is published. https://github.com/ruby/prism/commit/af300d5fb3
2023-12-25Revert "Revert all of commits after Prism 0.19.0 release"Hiroshi SHIBATA
This reverts commit d242e8416e99eaee4465e2681210ae8b7ecd6d34.
2023-12-16Revert all of commits after Prism 0.19.0 releaseHiroshi SHIBATA
We should bundle released version of Prism for Ruby 3.3.0
2023-12-15[ruby/prism] Fix majority of RBS type mismatchesGopal Patel
https://github.com/ruby/prism/commit/62cc50e41b