summaryrefslogtreecommitdiff
path: root/prism/templates/ext
AgeCommit message (Collapse)Author
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
2024-07-11[ruby/prism] Add node ids to nodesKevin Newton
https://github.com/ruby/prism/commit/bf16ade7f9
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-20[ruby/prism] Set `#line" directives to respect the path in ruby/ruby repoYusuke Endoh
ruby/ruby measures test coverage of C code, but the `#line` directive generated by prism points to a file that does not exist, so coverage is not taken properly. This changeset specifies the location of the source files as a relative path in terms of ruby/ruby repo. https://github.com/ruby/prism/commit/1a2626be27
2024-05-03[ruby/prism] Create specialized `ASCIISource` with asciionly optimizationsVinicius Stock
https://github.com/ruby/prism/commit/40993166a8
2024-04-23[ruby/prism] Use GC-able symbols for ASTKevin Newton
https://github.com/ruby/prism/commit/801117e45a
2024-03-07[ruby/prism] Shared integer parsing logicKevin Newton
https://github.com/ruby/prism/commit/a2594a23c1
2024-03-07[ruby/prism] Change pm_integer_t structuretompng
https://github.com/ruby/prism/commit/588acf823f
2024-03-07[ruby/prism] Make pm_integer -> Integer fastertompng
https://github.com/ruby/prism/commit/47601e7928
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] Make alloc interface replaceableHASUMI Hitoshi
- Add `x` prefix to malloc, calloc, realloc, and free (eg: malloc -> xmalloc) - By default, they are replaced with stdlib's functions at build - You can use custom functions by defining `PRISM_CUSTOM_ALLOCATOR` macro https://github.com/ruby/prism/commit/7a878af619
2024-02-22[ruby/prism] Parse float valuesKevin Newton
https://github.com/ruby/prism/commit/9137226a52
2024-02-22[ruby/prism] Regenerate snapshots using integer valuesKevin Newton
2024-02-22[ruby/prism] Add an IntegerField for parsing integer valuesKevin Newton
https://github.com/ruby/prism/commit/120d8c0479
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-14Initialize the Prism::Source directly with all 3 fields for the C extensionBenoit Daloze
* Faster that way: $ ruby -Ilib -rprism -rbenchmark/ips -e 'Benchmark.ips { |x| x.report("parse") { Prism.parse("1 + 2") } }' 195.722k (± 0.5%) i/s rb_iv_set(): 179.609k (± 0.5%) i/s rb_funcall(): 190.030k (± 0.3%) i/s before this PR: 183.319k (± 0.4%) i/s
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-01-30[ruby/prism] Better error messages for unexpected tokens in prefixKevin Newton
https://github.com/ruby/prism/commit/a35b8e45ee
2023-12-01[ruby/prism] Change numbered parametersKevin Newton
Previously numbered parameters were a field on blocks and lambdas that indicated the maximum number of numbered parameters in either the block or lambda, respectively. However they also had a parameters field that would always be nil in these cases. This changes it so that we introduce a NumberedParametersNode that goes in place of parameters, which has a single uint8_t maximum field on it. That field contains the maximum numbered parameter in either the block or lambda. As a part of the PR, I'm introducing a new UInt8Field type that can be used on nodes, which is just to make it a little more explicit what the maximum values can be (the maximum is actually 9, since it only goes up to _9). Plus we can do a couple of nice things in serialization like just read a single byte. https://github.com/ruby/prism/commit/2d87303903
2023-11-29[ruby/prism] Convert start line to signed integersJean Boussier
Ruby allows for 0 or negative line start, this is often used with `eval` calls to get a correct offset when prefixing a snippet. e.g. ```ruby caller = caller_locations(1, 1).first class_eval <<~RUBY, caller.path, caller.line - 2 # frozen_string_literal: true def some_method #{caller_provided_code_snippet} end RUBY ``` https://github.com/ruby/prism/commit/0d14ed1452
2023-11-03[ruby/prism] Properly support the start line optionKevin Newton
https://github.com/ruby/prism/commit/33cc75a4b7
2023-11-02[ruby/prism] Handle invalid constants in the constant poolKevin Newton
It's possible for us to parse a constant that is invalid in the current encoding. To fix this, we wrap the intern function in an rb_protect to ensure we always put a valid symbol into the AST. https://github.com/ruby/prism/commit/e78398554d
2023-10-13[ruby/prism] Move common flags to top bitseileencodes
Moves the common flag bits to the top. This lets us eliminate the `COMMON` constant, and also allows us to group encoding flags on a nibble so we can more easily mask them. https://github.com/ruby/prism/commit/895508659e
2023-09-27[ruby/prism] rearrange the constant pool so IDs can be used for indexingNathan Froyd
https://github.com/ruby/prism/commit/6f243de0c7
2023-09-27Sync to prism rename commitsKevin Newton
2023-09-27Rename YARP filepaths to prism filepathsKevin Newton