summaryrefslogtreecommitdiff
path: root/prism/templates
AgeCommit message (Collapse)Author
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
2023-12-14Bump prism to version 0.19.0Kevin Newton
2023-12-12[ruby/prism] Add methods for setting/unsetting and macros for testing a flagsUfuk Kayserilioglu
https://github.com/ruby/prism/commit/e5f37d1407
2023-12-08[ruby/prism] A couple of small dot enhancementsKevin Newton
https://github.com/ruby/prism/commit/5642a57f39
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-30[prism] Remove escaping C source filesKevin Newton
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-27[ruby/prism] Correct template.rb commentKevin Newton
https://github.com/ruby/prism/commit/4d689fe1df
2023-11-21[ruby/prism] Remove handling OptionalNodeField in set_newline_flagHiroya Fujinami
template (https://github.com/ruby/prism/pull/1905) https://github.com/ruby/prism/commit/6f7cbc1ca9
2023-11-21[ruby/prism] Update to v0.18.0Kevin Newton
https://github.com/ruby/prism/commit/1398879d79
2023-11-20[ruby/prism] Add character APIs for locationsKevin Newton
(https://github.com/ruby/prism/pull/1809) https://github.com/ruby/prism/commit/d493ccd093
2023-11-20[ruby/prism] Remove non-ASCII source charactersKevin Newton
(https://github.com/ruby/prism/pull/1787) https://github.com/ruby/prism/commit/5acc38a2f3
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-12[ruby/prism] Add the ability to convert nodes to dotKevin Newton
https://github.com/ruby/prism/commit/3e4b4fb947
2023-11-11[ruby/prism] Implement JavaScript visitorsMarco Roth
https://github.com/ruby/prism/commit/ea00a1b3c6
2023-11-05Do not use non-ASCII chars in sourcesNobuyoshi Nakada
No encodings are guaranteed in C compilers, and other than UTF-8 encodings may be assumed in some platforms, e.g., CP932 on Windows Japanese edition, and may result in compilation errors.
2023-11-03Update prism to v0.17.1Kevin Newton
2023-11-03[ruby/prism] Always fully qualify types for RBIs and avoid using attributesVinicius Stock
https://github.com/ruby/prism/commit/0d0d039f8e
2023-11-03[ruby/prism] Bump to version 0.17.0Kevin Newton
https://github.com/ruby/prism/commit/61a306cd5c
2023-11-03[ruby/prism] Split commentKevin Newton
We were previously holding a type field on Comment to tell what kind of comment it was. Instead, let's just use actual classes for this. https://github.com/ruby/prism/commit/e76830ca6e
2023-11-03[ruby/prism] Fix up lintKevin Newton
https://github.com/ruby/prism/commit/4f3a3e3ec1
2023-11-03[ruby/prism] Wire up options through the Java parserKevin Newton
https://github.com/ruby/prism/commit/13fa262669
2023-11-03[ruby/prism] Properly support the start line optionKevin Newton
https://github.com/ruby/prism/commit/33cc75a4b7
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-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-11-01[ruby/prism] Fix up lintKevin Newton
https://github.com/ruby/prism/commit/77d4056766
2023-11-01[ruby/prism] Last remaining missing C commentsKevin Newton
https://github.com/ruby/prism/commit/e327449db6
2023-11-01[ruby/prism] More documentation for ast.hKevin Newton
https://github.com/ruby/prism/commit/84e22c5581
2023-11-01[ruby/prism] Even more C file documentationKevin Newton
https://github.com/ruby/prism/commit/9c648ce615
2023-11-01[ruby/prism] Documentation for nodesKevin Newton
https://github.com/ruby/prism/commit/69323d3df4
2023-11-01[ruby/prism] Remove unnecessary PM_EMPTY_NODE_LISTKevin Newton
https://github.com/ruby/prism/commit/857f72e1f4
2023-11-01[ruby/prism] Documentation for defines, version, and prettyprintKevin Newton
https://github.com/ruby/prism/commit/e2e29bef2d
2023-11-01[ruby/prism] Start better documenting C APIKevin Newton
https://github.com/ruby/prism/commit/2b6e661bbc
2023-11-01[ruby/prism] More Ruby docsKevin Newton
https://github.com/ruby/prism/commit/ca9a660f52
2023-11-01[ruby/prism] Docs for node.rb and parse_result.rbKevin Newton
https://github.com/ruby/prism/commit/085da4feb9
2023-11-01[ruby/prism] Add comments on flagsKevin Newton
https://github.com/ruby/prism/commit/3abd09c803
2023-11-01[ruby/prism] Fix up Ruby docsKevin Newton
https://github.com/ruby/prism/commit/8062849d0d
2023-10-31[ruby/prism] Share comment generation logicKevin Newton
https://github.com/ruby/prism/commit/6e5556dbdf
2023-10-30[prism] Update prism to latestKevin Newton
2023-10-30[ruby/prism] Improve comment generation in templatesUfuk Kayserilioglu
The existing comment generation was hard to read and was making a lot of string manipulation. However, ERB files are already designed to do string manipulation, so we can use that instead. So, instead of doing a split and a map, I opted to use the `#each_line` method to iterate over the lines of the file. Also, in order to add an optional space padding at the beginning of the line, I opted to pad it with a space and to then right trim it. This makes sure that no space is left behind if the line is empty, but a space is added if the line is not empty. https://github.com/ruby/prism/commit/5736711e70
2023-10-27[ruby/prism] Prism.parse_inline_commentsKevin Newton
https://github.com/ruby/prism/commit/5b72f84480