aboutsummaryrefslogtreecommitdiffstats
path: root/prism/templates/src/serialize.c.erb
Commit message (Collapse)AuthorAgeFilesLines
* [ruby/prism] Add node ids to nodesKevin Newton2024-07-111-0/+1
| | | | https://github.com/ruby/prism/commit/bf16ade7f9
* [ruby/prism] Expose flags on every node typeKevin Newton2024-07-111-2/+1
| | | | https://github.com/ruby/prism/commit/9f12a56fd6
* [ruby/prism] Set `#line" directives to respect the path in ruby/ruby repoYusuke Endoh2024-06-201-1/+1
| | | | | | | | | | | 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
* [ruby/prism] Ensure deserialization works with errors+warnings>256Kevin Newton2024-03-281-1/+1
| | | | https://github.com/ruby/prism/commit/f540e830b5
* [ruby/prism] Provide options for reducing sizeKevin Newton2024-03-201-20/+6
| | | | https://github.com/ruby/prism/commit/592128de4d
* [ruby/prism] Change pm_integer_t structuretompng2024-03-071-4/+8
| | | | https://github.com/ruby/prism/commit/588acf823f
* [ruby/prism] Expose types on diagnosticsKevin Newton2024-03-061-0/+3
| | | | https://github.com/ruby/prism/commit/a735c2262f
* [ruby/prism] Move template related methods/classes under `Prism::Template` ↵Ufuk Kayserilioglu2024-03-061-14/+14
| | | | | | namespace https://github.com/ruby/prism/commit/0e4dbcd3e4
* [ruby/prism] Parse float valuesKevin Newton2024-02-221-0/+2
| | | | https://github.com/ruby/prism/commit/9137226a52
* [ruby/prism] Regenerate snapshots using integer valuesKevin Newton2024-02-221-4/+4
|
* [ruby/prism] Add an IntegerField for parsing integer valuesKevin Newton2024-02-221-1/+13
| | | | https://github.com/ruby/prism/commit/120d8c0479
* [ruby/prism] Use `_POSIX_MAPPED_FILES` and `_WIN32` to know if memory map ↵HASUMI Hitoshi2024-02-201-0/+2
| | | | | | interface is available in the target platform https://github.com/ruby/prism/commit/88e2ff52d4
* [ruby/prism] Serialize the newline_list to avoid recomputing it again laterBenoit Daloze2024-02-141-13/+24
| | | | | | * Fixes https://github.com/ruby/prism/issues/2380 https://github.com/ruby/prism/commit/4eaaa90114
* [ruby/prism] Add level to warnings and errors to categorize themBenoit Daloze2024-01-261-0/+2
| | | | | | * Fixes https://github.com/ruby/prism/issues/2082 https://github.com/ruby/prism/commit/7a74576357
* [ruby/prism] Provide flags for changing encodingsKevin Newton2023-12-061-3/+3
| | | | https://github.com/ruby/prism/commit/e838eaff6f
* [ruby/prism] Refactor pm_diagnostic_t and pm_comment_t to use pm_location_tLily Lyons2023-12-041-4/+2
| | | | https://github.com/ruby/prism/commit/115b6a2fc6
* [ruby/prism] Prism.parse_success?(source)Kevin Newton2023-12-011-0/+21
| | | | | | | | | | | | 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
* [ruby/prism] Change numbered parametersKevin Newton2023-12-011-0/+2
| | | | | | | | | | | | | | | | | | | | 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
* [ruby/prism] Convert start line to signed integersJean Boussier2023-11-291-4/+4
| | | | | | | | | | | | | | | | | | | 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
* [ruby/prism] Rename varint as varuintJean Boussier2023-11-291-31/+31
| | | | | | | 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
* [ruby/prism] Move DATA parsing into its own parse result fieldKevin Newton2023-11-281-1/+13
| | | | https://github.com/ruby/prism/commit/42b60b6e95
* [ruby/prism] Revert "Ensure serialized file is little endian"Kevin Newton2023-11-181-20/+5
| | | | https://github.com/ruby/prism/commit/4cec275fff
* [ruby/prism] Ensure serialized file is little endianKevin Newton2023-11-171-5/+20
| | | | https://github.com/ruby/prism/commit/0c762ee68a
* [ruby/prism] Fix up lintKevin Newton2023-11-031-0/+2
| | | | https://github.com/ruby/prism/commit/4f3a3e3ec1
* [ruby/prism] Rename serialization APIs for consistencyKevin Newton2023-11-031-2/+2
| | | | https://github.com/ruby/prism/commit/5a2252e3ac
* [ruby/prism] Wire up options through the FFI APIKevin Newton2023-11-031-5/+8
| | | | https://github.com/ruby/prism/commit/f0aa8ad93b
* [ruby/prism] Create an options struct for passing all of the possible optionsKevin Newton2023-11-031-1/+5
| | | | https://github.com/ruby/prism/commit/99e81619de
* [ruby/prism] Fix up lintKevin Newton2023-11-011-1/+1
| | | | https://github.com/ruby/prism/commit/77d4056766
* [ruby/prism] Even more C file documentationKevin Newton2023-11-011-3/+17
| | | | https://github.com/ruby/prism/commit/9c648ce615
* [ruby/prism] Prism.parse_inline_commentsKevin Newton2023-10-271-2/+2
| | | | https://github.com/ruby/prism/commit/5b72f84480
* [ruby/prism] Get general prettyprint structure workingKevin Newton2023-10-261-41/+41
| | | | https://github.com/ruby/prism/commit/7c9cf63d4c
* [ruby/prism] Compile with WASIKevin Newton2023-10-261-2/+2
| | | | https://github.com/ruby/prism/commit/73c44b0b9c
* [ruby/prism] Exclude comments when only serializing semantic fieldsBenoit Daloze2023-10-231-0/+2
| | | | https://github.com/ruby/prism/commit/6f4fab362e
* [ruby/prism] Extract out constant pool bucket bits to constantsKevin Newton2023-10-181-1/+1
| | | | https://github.com/ruby/prism/commit/1985a9ba51
* [ruby/prism] Provide "constant" constants, embedded in the codeKevin Newton2023-10-181-6/+6
| | | | https://github.com/ruby/prism/commit/d469a56e7e
* [ruby/prism] Attach magic comments to the parse resultKevin Newton2023-10-161-0/+23
| | | | https://github.com/ruby/prism/commit/c7ef25a79a
* [ruby/prism] Move common flags to top bitseileencodes2023-10-131-1/+1
| | | | | | | | 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
* [ruby/prism] rearrange the constant pool so IDs can be used for indexingNathan Froyd2023-09-271-5/+5
| | | | https://github.com/ruby/prism/commit/6f243de0c7
* Sync to prism rename commitsKevin Newton2023-09-271-121/+121
|
* Rename YARP filepaths to prism filepathsKevin Newton2023-09-271-0/+299