summaryrefslogtreecommitdiff
path: root/lib/prism
AgeCommit message (Collapse)Author
2023-12-14Bump prism to version 0.19.0Kevin Newton
2023-12-06[ruby/prism] Move flag position consistently to frontKevin Newton
https://github.com/ruby/prism/commit/6e69a81737
2023-12-04[ruby/prism] Ripper compat docs updateKevin Newton
https://github.com/ruby/prism/commit/5f70b32b02
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] Provide heredoc? queriesKevin Newton
https://github.com/ruby/prism/commit/e148e8fe6a
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-12-01[ruby/prism] Fix comments after HEREDOCs again.Martin Emde
The problem was deeper than just looking back a single token. You can push the heredoc_end token way back into the list. We need to save the last location of a heredoc end to see if it's the last token in the file. Fixes https://github.com/ruby/prism/pull/1954 https://github.com/ruby/prism/commit/91dfd4eecd
2023-11-30[PRISM] Consolidate prism encoding filesKevin Newton
2023-11-30[PRISM] Big5 encodingsKevin Newton
2023-11-30[PRISM] Alias CP51932 to EUC-JPKevin Newton
2023-11-30[PRISM] Consolidate SJIS encodingsKevin Newton
2023-11-30[ruby/prism] Fix lex_compat for `<<HEREDOC # comment` at EOFMartin Emde
Fixes https://github.com/ruby/prism/pull/1874 https://github.com/ruby/prism/commit/304dd78dd2
2023-11-29[ruby/prism] Add MacJapanese encodingMatt Boldt
MacJapanese (also aliased as MacJapan) is a modified Shift_JIS encoding, but is implemented identically in Ruby https://github.com/ruby/prism/commit/9e0a097699
2023-11-29[ruby/prism] added CP950 encodingDhaval
https://github.com/ruby/prism/commit/9c2d1cf4ba
2023-11-28[ruby/prism] Implicit rest nodesKevin Newton
Fundamentally, `foo { |bar,| }` is different from `foo { |bar, *| }` because of arity checks. This PR introduces a new node to handle that, `ImplicitRestNode`, which goes in the `rest` slot of parameter nodes instead of `RestParameterNode` instances. This is also used in a couple of other places, namely: * pattern matching: `foo in [bar,]` * multi target: `for foo, in bar do end` * multi write: `foo, = bar` Now the only splat nodes with a `NULL` value are when you're forwarding, as in: `def foo(*) = bar(*)`. https://github.com/ruby/prism/commit/dba2a3b652
2023-11-28[ruby/prism] Move DATA parsing into its own parse result fieldKevin Newton
https://github.com/ruby/prism/commit/42b60b6e95
2023-11-22[ruby/prism] Add new doc to gemspecKevin Newton
https://github.com/ruby/prism/commit/99dfca6c1d
2023-11-22[ruby/prism] Add `CP949` encodingheyogrady
https://github.com/ruby/prism/commit/9e78dfdf69
2023-11-22[ruby/prism] Move CallNode#name field between receiver and argumentsBenoit Daloze
* The same order as in source code. * CallOrWriteNode, CallOperatorWriteNode, CallAndWriteNode already have the correct order so it was also inconsistent with them. https://github.com/ruby/prism/commit/4434e4bc22
2023-11-21[ruby/prism] Update to v0.18.0Kevin Newton
https://github.com/ruby/prism/commit/1398879d79
2023-11-21[ruby/prism] Fix constant path full name when parent is not aVinicius Stock
constant (https://github.com/ruby/prism/pull/1742) * Raise if constant path parts contains nodes that can't be used to build full name * Fix typo in constant path error documentation Co-authored-by: Tim Morgan <tim@timmorgan.org> --------- https://github.com/ruby/prism/commit/d73a053262 Co-authored-by: Tim Morgan <tim@timmorgan.org>
2023-11-21[ruby/prism] Warning for ENDs in methodsHaldun Bayhantopcu
(https://github.com/ruby/prism/pull/1899) https://github.com/ruby/prism/commit/1b41c2d56c
2023-11-20Rename the big5-hkscs stuff to something more generic and add UAO sharing ↵Ryan Garver
common code. Merge the Big5 extensions into pm_big5.c
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-18[ruby/prism] Big5 HKSCS encodingRyan Garver
https://github.com/ruby/prism/commit/3ca9823eb4
2023-11-16[ruby/prism] Update gemspecMaple Ong
https://github.com/ruby/prism/commit/1a10f6f9c0
2023-11-15[ruby/prism] Track the then keyword for conditionalsKevin Newton
https://github.com/ruby/prism/commit/fef0019a25
2023-11-14[ruby/prism] Rename librubyparser to libprismKevin Newton
librubyparser was an artifact of the prototype that was initially named ruby-parser. Instead, this renames it to libprism to be consistent with the actual name. https://github.com/ruby/prism/commit/8600b06811
2023-11-12[ruby/prism] Add the ability to convert nodes to dotKevin Newton
https://github.com/ruby/prism/commit/3e4b4fb947
2023-11-10[ruby/prism] Remove extra locals added by ...Kevin Newton
https://github.com/ruby/prism/commit/b7850f2d30
2023-11-10[ruby/prism] Add source code and changelog urisMateus Pereira
https://github.com/ruby/prism/commit/33a85f7867
2023-11-08[ruby/prism] Provide Parameters#signature for mirroring Method#parametersKevin Newton
https://github.com/ruby/prism/commit/90b3245528
2023-11-03Update prism to v0.17.1Kevin Newton
2023-11-03[ruby/prism] Bump to version 0.17.0Kevin Newton
https://github.com/ruby/prism/commit/61a306cd5c
2023-11-03[ruby/prism] Rename suppress warnings to verboseKevin Newton
https://github.com/ruby/prism/commit/fbb30216ca
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] 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] Wire up options through the Ruby APIKevin Newton
https://github.com/ruby/prism/commit/8582d372a3
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[prism] Updates for syncKevin Newton
2023-11-01[ruby/prism] Documentation for pm_strncasecmpKevin Newton
https://github.com/ruby/prism/commit/26934263b7
2023-11-01[ruby/prism] Finish Ruby documentationKevin Newton
https://github.com/ruby/prism/commit/dfdcc98a3c
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] Fix up Prism and Debug docsKevin Newton
https://github.com/ruby/prism/commit/c2b7724d91
2023-11-01[ruby/prism] Flip incorrect names of OptionalKeywordParameterNode and ↵Jemma Issroff
RequiredKeywordParameterNode https://github.com/ruby/prism/commit/c31f61e898
2023-11-01[ruby/prism] Split KeywordParameterNode into Optional and RequiredJemma Issroff
Prior to this commit, KeywordParameterNode included both optional and required keywords. With this commit, it is split in two, with `OptionalKeywordParameterNode`s no longer having a value field. https://github.com/ruby/prism/commit/89084d9af4