summaryrefslogtreecommitdiff
path: root/prism
AgeCommit message (Collapse)Author
2024-08-25[Bug #20680] `ensure` block is always void contextNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/11451
2024-08-23[ruby/prism] Pass Unicode escapes on to onigmoKevin Newton
When we encounter an invalid unicode escape within a regular expression, we now pass that error on to Onigmo as if it didn't exist in the parser (which matches the upstream parser's behavior). We do this because there are tests that specify that you are allowed to have invalid Unicode escapes if they are within the context of a regular expression comment for a regular expression in extended mode. That looks like: /# \u /x Note that this _only_ applies to Unicode escapes (as opposed to applying to hex or meta/control escapes as well). Importantly it also only applies if the regular expression is terminated. An unterminated regular expression will still get error handling done in the parser. That would look like: /# \u that would result in the same error handling we have today. https://github.com/ruby/prism/commit/fb98034806
2024-08-22[ruby/prism] Update templates/include/prism/ast.h.erbKevin Newton
https://github.com/ruby/prism/commit/7f7620b6d5
2024-08-22[ruby/prism] Render node comments into their `ast.h`Alexander Momchilov
https://github.com/ruby/prism/commit/b17c3241d3
2024-08-22[ruby/prism] Turn off extended mode when parsing extended groupKevin Newton
https://github.com/ruby/prism/commit/098b3f08bc
2024-08-15[ruby/prism] Fix up lex result constantsKevin Newton
https://github.com/ruby/prism/commit/084baca463
2024-08-15[ruby/prism] Special error for too short unicode errorsKevin Newton
https://github.com/ruby/prism/commit/9f1f7d08bd
2024-08-14[ruby/prism] Callback on shebang switchesKevin Newton
Add the ability to receive a callback when the parser encounters a shebang that contains additional switches after the Ruby engine. This is necessary because some command-line flags may be present there that will alter the parse. https://github.com/ruby/prism/commit/afc5000331
2024-08-13[ruby/prism] Fix up spacing in generated node.rbKevin Newton
https://github.com/ruby/prism/commit/50d79b734b
2024-08-10[ruby/prism] [Doc] Tweak the docs for lex APIsKoichi ITO
`Prism.lex` and `Prism.lex_file` return `ParseLexResult` instead of `Array`. `Prism::parse_lex` and `Prism::parse_lex_file` return `ParseLexResult` instead of `ParseResult`. This PR updates the documentation to reflect these return values. https://github.com/ruby/prism/commit/ee331941c0
2024-07-26[ruby/prism] Add explicit check for PRISM_HAS_NO_FILESYSTEMYuta Saito
https://github.com/ruby/prism/commit/89c22f0e6c
2024-07-26[ruby/prism] Fallback to pm_string_file_init on platforms without ↵Yuta Saito
memory-mapped files > ..., and on other POSIX systems we'll use `read`. As `pm_string_mapped_init`'s doc comment says, it should fall back to `read(2)`-based implementation on platforms without memory-mapped files like WASI, but it didn't. This commit fixes it by calling `pm_string_file_init` in the fallback case. Also `defined(_POSIX_MAPPED_FILES)` check for `read(2)`-based path is unnecessary, and it prevents the fallback from being executed, so this change removes it. https://github.com/ruby/prism/commit/b3d9064b71
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-24[ruby/prism] Inherit ractor state for child scopesKevin Newton
https://github.com/ruby/prism/commit/4576cb1d96
2024-07-24[Bug #20647] Disallow `return` directly within a singleton classNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/11234
2024-07-23[ruby/prism] Single line method bodies should not be marked as newlineKevin Newton
https://github.com/ruby/prism/commit/18a8597276
2024-07-23[ruby/prism] Recurse upward to detect invalid returnsKevin Newton
https://github.com/ruby/prism/commit/3d39b7961f
2024-07-22[ruby/prism] Ignore shebangs in evalsKevin Newton
https://github.com/ruby/prism/commit/4c55409794
2024-07-22[ruby/prism] Implement mismatched indentation warningKevin Newton
https://github.com/ruby/prism/commit/5d5bf92be8
2024-07-19[ruby/prism] Fix parsing parentheses in hash patternsKevin Newton
https://github.com/ruby/prism/commit/22c3b559cd
2024-07-18[ruby/prism] Mark local variable writes in value positions as being readKevin Newton
https://github.com/ruby/prism/commit/f5149870ab
2024-07-18[PRISM] Ensure not opening directoriesKevin Newton
Notes: Merged: https://github.com/ruby/ruby/pull/11196
2024-07-17[ruby/prism] Have parse_stream handle NUL bytesKevin Newton
https://github.com/ruby/prism/commit/4a41d298c8
2024-07-17[ruby/prism] [Doc] Tweak example of `Prism::Dispatcher`Koichi ITO
This PR tweaked the documentation to correct an error encountered when running the example code of `Prism::Dispatcher`. This aims to make understanding the example smoother. https://github.com/ruby/prism/commit/165a1a0e78
2024-07-17[Bug #20457] [Prism] Remove redundant return flagNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/11163
2024-07-15[ruby/prism] Fix up implicit flagsKevin Newton
https://github.com/ruby/prism/commit/f4152c1f50
2024-07-12[ruby/prism] When parsing an invalid write, still add to the local tableKevin Newton
https://github.com/ruby/prism/commit/a54abc4d1b
2024-07-11[ruby/prism] Bump typecheck dependencies to fix CIKevin Newton
https://github.com/ruby/prism/commit/c7a4a90ee8
2024-07-11[PRISM] Fix up shareable constant castingKevin Newton
2024-07-11[PRISM] Use node ids for error highlightKevin Newton
2024-07-11[ruby/prism] Prevent optional block parameter from accepting certain ↵Stan Lo
prefixed values This commit prevents the following unary operators from being accepted as the value prefix of a block's optional parameter: - `+` - `-` - `~` - `!` For example, `f { |a = +b| }` will now raise a syntax error. https://github.com/ruby/prism/commit/3024bee60c Co-authored-by: Kevin Newton <kddnewton@gmail.com>
2024-07-11[ruby/prism] Various cleanup for initializers and typechecksKevin Newton
https://github.com/ruby/prism/commit/86cf82794a
2024-07-11[ruby/prism] Add node ids to nodesKevin Newton
https://github.com/ruby/prism/commit/bf16ade7f9
2024-07-11[ruby/prism] Move Node#type and Node::type documentationKevin Newton
https://github.com/ruby/prism/commit/08a71f6259
2024-07-11[ruby/prism] Add Node#breadth_first_searchKevin Newton
https://github.com/ruby/prism/commit/1ffb141199
2024-07-11[ruby/prism] Expose common flags in inspect outputKevin Newton
https://github.com/ruby/prism/commit/d0143865c2
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-07-01[ruby/prism] Fix up find and array patterns with multiple restsKevin Newton
https://github.com/ruby/prism/commit/035890a839
2024-07-01[ruby/prism] Properly support parsing regexp in extended modeKevin Newton
https://github.com/ruby/prism/commit/bedc4585ed
2024-06-26[ruby/prism] Handle block exits under modifiersKevin Newton
https://github.com/ruby/prism/commit/6b78f5309b
2024-06-25[ruby/prism] Fix documentation comment in generated with templates filesAndrew Konchin
Fix warning ``` /******************************************************************************/ ^ warning: [dangling-doc-comments] documentation comment is not attached to any declaration ``` in Nodes.java and AbstractNodeVisitor.java files. /** is treated as a starting of a javadoc comment. https://github.com/ruby/prism/commit/c83d7844b8
2024-06-21[ruby/prism] Update `#line` that was missed to updateYusuke Endoh
Follow up https://github.com/ruby/prism/commit/1a2626be275d https://github.com/ruby/prism/commit/8174aac929
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-06-19[ruby/prism] Make sure Init_prism is visible for extensionKevin Newton
https://github.com/ruby/prism/commit/4601d3adfd
2024-06-15[ruby/prism] Document MultiWriteNode fieldsHerwin
https://github.com/ruby/prism/commit/b6a97a43c2
2024-06-15[ruby/prism] Document MultiTargetNodeHerwin
https://github.com/ruby/prism/commit/b817cd25c5
2024-06-14[ruby/prism] Ensure ranges are non-associativeKevin Newton
https://github.com/ruby/prism/commit/f59295938b
2024-06-13[ruby/prism] Handle implicit array precedenceKevin Newton
When an implicit array is used in a write, is causes the whole expression to become a statement. For example: ```ruby a = *b a = 1, 2, 3 ``` Even though these expressions are exactly equivalent to their explicit array counterparts: ```ruby a = [*b] a = [1, 2, 3] ``` As such, these expressions cannot be joined with other expressions by operators or modifiers except if, unless, while, until, or rescue. https://github.com/ruby/prism/commit/7cd2407272