summaryrefslogtreecommitdiff
path: root/prism/templates/src/serialize.c.erb
AgeCommit message (Collapse)Author
2025-12-05[ruby/prism] Avoid undefined int overflow behaviourSteven Johnstone
Fixes https://github.com/ruby/prism/pull/3786. https://github.com/ruby/prism/commit/b72b664675
2025-03-22[ruby/prism] Include nodeId in Java Node only if necessaryBenoit Daloze
* See https://github.com/ruby/prism/issues/3502 https://github.com/ruby/prism/commit/b7aedfe696
2025-03-21[ruby/prism] Add node_id to Java serializationKevin Newton
https://github.com/ruby/prism/commit/93e768bd18
2024-07-25[ruby/prism] Do not serialize common flags when ↵Benoit Daloze
PRISM_SERIALIZE_ONLY_SEMANTICS_FIELDS is set * Note that we could shift the flags by 2 on serialize & deserialize but it does not seems worth it as it does not save serialized size in any significant amount, i.e. average was 0.799 before #2924. * $ bundle exec rake serialized_size:topgems Before: Total sizes for top 100 gems: total source size: 90207647 total serialized size: 69477115 total serialized/total source: 0.770 Stats of ratio serialized/source per file: average: 0.844 median: 0.825 1st quartile: 0.597 3rd quartile: 1.064 min - max: 0.078 - 3.792 After: Total sizes for top 100 gems: total source size: 90207647 total serialized size: 66150209 total serialized/total source: 0.733 Stats of ratio serialized/source per file: average: 0.800 median: 0.779 1st quartile: 0.568 3rd quartile: 1.007 min - max: 0.076 - 3.675 https://github.com/ruby/prism/commit/e012072f70
2024-07-25[ruby/prism] Do not serialize node_id when ↵Benoit Daloze
PRISM_SERIALIZE_ONLY_SEMANTICS_FIELDS is set * $ bundle exec rake serialized_size:topgems Before: Total sizes for top 100 gems: total source size: 90207647 total serialized size: 86284647 total serialized/total source: 0.957 Stats of ratio serialized/source per file: average: 0.952 median: 0.937 1st quartile: 0.669 3rd quartile: 1.206 min - max: 0.080 - 4.065 After: Total sizes for top 100 gems: total source size: 90207647 total serialized size: 69477115 total serialized/total source: 0.770 Stats of ratio serialized/source per file: average: 0.844 median: 0.825 1st quartile: 0.597 3rd quartile: 1.064 min - max: 0.078 - 3.792 https://github.com/ruby/prism/commit/cf90fe5759
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-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-03-28[ruby/prism] Ensure deserialization works with errors+warnings>256Kevin Newton
https://github.com/ruby/prism/commit/f540e830b5
2024-03-20[ruby/prism] Provide options for reducing sizeKevin Newton
https://github.com/ruby/prism/commit/592128de4d
2024-03-07[ruby/prism] Change pm_integer_t structuretompng
https://github.com/ruby/prism/commit/588acf823f
2024-03-06[ruby/prism] Expose types on diagnosticsKevin Newton
https://github.com/ruby/prism/commit/a735c2262f
2024-03-06[ruby/prism] Move template related methods/classes under `Prism::Template` ↵Ufuk Kayserilioglu
namespace https://github.com/ruby/prism/commit/0e4dbcd3e4
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-20[ruby/prism] Use `_POSIX_MAPPED_FILES` and `_WIN32` to know if memory map ↵HASUMI Hitoshi
interface is available in the target platform https://github.com/ruby/prism/commit/88e2ff52d4
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-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
2023-12-06[ruby/prism] Provide flags for changing encodingsKevin Newton
https://github.com/ruby/prism/commit/e838eaff6f
2023-12-04[ruby/prism] Refactor pm_diagnostic_t and pm_comment_t to use pm_location_tLily Lyons
https://github.com/ruby/prism/commit/115b6a2fc6
2023-12-01[ruby/prism] Prism.parse_success?(source)Kevin Newton
A lot of tools use Ripper/RubyVM::AbstractSyntaxTree to determine if a source is valid. These tools both create an AST instead of providing an API that will return a boolean only. This new API only creates the C structs, but doesn't bother reifying them into Ruby/the serialization API. Instead it only returns true/false, which is significantly more efficient. https://github.com/ruby/prism/commit/7014740118
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-29[ruby/prism] Rename varint as varuintJean Boussier
Line numbers may be negative, so we need to introduce signed varint, so renaming unsigned ones first avoid confusion. https://github.com/ruby/prism/commit/90d862361e
2023-11-28[ruby/prism] Move DATA parsing into its own parse result fieldKevin Newton
https://github.com/ruby/prism/commit/42b60b6e95
2023-11-18[ruby/prism] Revert "Ensure serialized file is little endian"Kevin Newton
https://github.com/ruby/prism/commit/4cec275fff
2023-11-17[ruby/prism] Ensure serialized file is little endianKevin Newton
https://github.com/ruby/prism/commit/0c762ee68a
2023-11-03[ruby/prism] Fix up lintKevin Newton
https://github.com/ruby/prism/commit/4f3a3e3ec1
2023-11-03[ruby/prism] Rename serialization APIs for consistencyKevin Newton
https://github.com/ruby/prism/commit/5a2252e3ac
2023-11-03[ruby/prism] Wire up options through the FFI APIKevin Newton
https://github.com/ruby/prism/commit/f0aa8ad93b
2023-11-03[ruby/prism] Create an options struct for passing all of the possible optionsKevin Newton
https://github.com/ruby/prism/commit/99e81619de
2023-11-01[ruby/prism] Fix up lintKevin Newton
https://github.com/ruby/prism/commit/77d4056766
2023-11-01[ruby/prism] Even more C file documentationKevin Newton
https://github.com/ruby/prism/commit/9c648ce615
2023-10-27[ruby/prism] Prism.parse_inline_commentsKevin Newton
https://github.com/ruby/prism/commit/5b72f84480
2023-10-26[ruby/prism] Get general prettyprint structure workingKevin Newton
https://github.com/ruby/prism/commit/7c9cf63d4c
2023-10-26[ruby/prism] Compile with WASIKevin Newton
https://github.com/ruby/prism/commit/73c44b0b9c
2023-10-23[ruby/prism] Exclude comments when only serializing semantic fieldsBenoit Daloze
https://github.com/ruby/prism/commit/6f4fab362e
2023-10-18[ruby/prism] Extract out constant pool bucket bits to constantsKevin Newton
https://github.com/ruby/prism/commit/1985a9ba51
2023-10-18[ruby/prism] Provide "constant" constants, embedded in the codeKevin Newton
https://github.com/ruby/prism/commit/d469a56e7e
2023-10-16[ruby/prism] Attach magic comments to the parse resultKevin Newton
https://github.com/ruby/prism/commit/c7ef25a79a
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