summaryrefslogtreecommitdiff
path: root/prism
AgeCommit message (Collapse)Author
2024-09-26[ruby/prism] Fix incorrect reference to AlternationPatternNode as non-void ↵Daniel Insley
expressions https://github.com/ruby/prism/commit/68de31919e
2024-09-26[ruby/prism] Add fields documentation for AliasMethodNode and ↵Daniel Insley
AlternationPatternNode https://github.com/ruby/prism/commit/6953daebde
2024-09-26[ruby/prism] Reject non-assoc ranges with subsequent operatorsKevin Newton
https://github.com/ruby/prism/commit/976a3cd0a5
2024-09-25[ruby/prism] Update templates/include/prism/ast.h.erbKevin Newton
https://github.com/ruby/prism/commit/dc7164e21c
2024-09-25[ruby/prism] Fix rendering of type overview docsAlexander Momchilov
https://github.com/ruby/prism/commit/d42bc309cc
2024-09-25[ruby/prism] Fix up more error messages to more closely match parse.yKevin Newton
https://github.com/ruby/prism/commit/988ac82187
2024-09-25[ruby/prism] Fix up void value expression checking for rescueKevin Newton
https://github.com/ruby/prism/commit/509ff88e92
2024-09-25[ruby/prism] Disallow label in parenthesesKevin Newton
https://github.com/ruby/prism/commit/b624e09cc6
2024-09-25[ruby/prism] Remove use of __assume to simplifyKevin Newton
https://github.com/ruby/prism/commit/4daf58f7a0
2024-09-25[ruby/prism] Fix up windows use of __assumeKevin Newton
https://github.com/ruby/prism/commit/9fd0c0901e
2024-09-25[ruby/prism] Support a max depth to protect against malicious payloadsKevin Newton
https://github.com/ruby/prism/commit/a474017bbe
2024-09-25[ruby/prism] Type every node field and mark on-error-only types explicitlyBenoit Daloze
* For Loader.java, do not deserialize the AST if there are errors, so then Java nodes only have non-error types for fields. https://github.com/ruby/prism/commit/ae78e3c605
2024-09-24[ruby/prism] Accept version shorthand like 3.4Kevin Newton
https://github.com/ruby/prism/commit/098f1c4607
2024-09-24[ruby/prism] Accept all 3.3.x and 3.4.x Ruby versions for Prism.parseBenoit Daloze
https://github.com/ruby/prism/commit/a4fcd5339a
2024-09-24[ruby/prism] check_string() should always return a valid C stringBenoit Daloze
* Otherwise it is invalid e.g. to call strlen() to the result, or to assume the argument was a string. * All callers are already checking for nil before. https://github.com/ruby/prism/commit/8197be883e
2024-09-20[ruby/prism] Introduce partial_script optionKevin Newton
https://github.com/ruby/prism/commit/b28877fa4f
2024-09-18Raise a compile error for break/next/redo inside eval in cases where it is ↵Jeremy Evans
optimized away In cases where break/next/redo are not valid syntax, they should raise a SyntaxError even if inside a conditional block that is optimized away. Fixes [Bug #20597] Co-authored-by: Kevin Newton <kddnewton@gmail.com> Notes: Merged: https://github.com/ruby/ruby/pull/11099 Merged-By: jeremyevans <code@jeremyevans.net>
2024-09-18[ruby/prism] Allow returns in default parameter valuesKevin Newton
https://github.com/ruby/prism/commit/e98ea15596 Notes: Merged: https://github.com/ruby/ruby/pull/11643
2024-09-17[ruby/prism] Accept "do" blocks in some parameter default valuesKevin Newton
https://github.com/ruby/prism/commit/6d7b734dbe
2024-09-16[ruby/prism] Handle retry doubly nested under rescueKevin Newton
Fixes [Bug #20747] https://github.com/ruby/prism/commit/d3194715a9
2024-09-16[ruby/prism] Do not leak explicit encodingKevin Newton
Fixes [Bug #20744] https://github.com/ruby/prism/commit/f1b8b1b2a2
2024-09-13[ruby/prism] Stat file first to check directoryKevin Newton
https://github.com/ruby/prism/commit/4ed7de537b
2024-09-13[ruby/prism] Expose main_script in serialization APIKevin Newton
https://github.com/ruby/prism/commit/0b527ca93f
2024-09-13[PRISM] Do not warn ambiguous ampersand when symbol literalKevin Newton
Fixes [Bug #20735] Notes: Merged: https://github.com/ruby/ruby/pull/11622
2024-09-13[PRISM] Only parse shebang on main scriptKevin Newton
Fixes [Bug #20730] Notes: Merged: https://github.com/ruby/ruby/pull/11617
2024-09-13[PRISM] Allow case/when to be indented with no warningKevin Newton
Fixes [Bug #20731] Notes: Merged: https://github.com/ruby/ruby/pull/11620
2024-09-13[PRISM] Turn off mismatched indentation warnings in evalKevin Newton
Fixes [Bug #20732] Notes: Merged: https://github.com/ruby/ruby/pull/11618
2024-09-13[ruby/prism] Refactor and move common node flags count into a constant to ↵Andrew Konchin
reuse in templates https://github.com/ruby/prism/commit/c20bf05ecc
2024-09-13[ruby/prism] Unify code style of flags generation in the nodes templatesAndrew Konchin
https://github.com/ruby/prism/commit/dbb7e0a44e
2024-09-12[ruby/prism] Check errno for parsing directoryKevin Newton
https://github.com/ruby/prism/commit/d68ea29d04 Notes: Merged: https://github.com/ruby/ruby/pull/11497
2024-09-12[ruby/prism] Do not warn \r in shebang on windowsKevin Newton
https://github.com/ruby/prism/commit/e8c862ca1f
2024-09-11[ruby/prism] UTF-8 characters in file nameKevin Newton
https://github.com/ruby/prism/commit/487f0ffe78
2024-09-11[ruby/prism] Add a flag for arguments that contain forwardingKevin Newton
https://github.com/ruby/prism/commit/ebd2889bee
2024-09-11[ruby/prism] Parse tempfileKevin Newton
https://github.com/ruby/prism/commit/31154a389a
2024-09-04[ruby/prism] Update config.ymlKevin Newton
https://github.com/ruby/prism/commit/8a3fa9f46e
2024-09-04[ruby/prism] Update config.ymlKevin Newton
https://github.com/ruby/prism/commit/369b2c1304
2024-09-04[ruby/prism] containt ==> containsydah
https://github.com/ruby/prism/commit/fa65b66237
2024-08-29[PRISM] Handle nth reference ERANGE with warningKevin Newton
Notes: Merged: https://github.com/ruby/ruby/pull/11502
2024-08-28[ruby/prism] Multi-splat flag for argumentsKevin Newton
https://github.com/ruby/prism/commit/21cb9b78ae
2024-08-28[PRISM] Sync version updateKevin Newton
2024-08-28[PRISM] Field renamingKevin Newton
Rename some fields that do not quite make sense. * CaseMatchNode#consequent -> CaseMatchNode#else_clause * CaseNode#consequent -> CaseNode#else_clause * IfNode#consequent -> IfNode#subsequent * RescueNode#consequent -> RescueNode#subsequent * UnlessNode#consequent -> UnlessNode#else_clause Notes: Merged: https://github.com/ruby/ruby/pull/11480
2024-08-28[ruby/prism] Review config.yml: documentation, types and field namesBenoit Daloze
https://github.com/ruby/prism/commit/d43333539e
2024-08-28[ruby/prism] Swap around order of predicates for assoc static literalKevin Newton
https://github.com/ruby/prism/commit/ec181a3b68
2024-08-28[PRISM] Check length of line for shebangKevin Newton
Notes: Merged: https://github.com/ruby/ruby/pull/11475
2024-08-27[ruby/prism] Add `contains_splat` flageileencodes
If we have a splat, add a flag for it named `contains_splat`. https://github.com/ruby/prism/commit/5be97a75c8
2024-08-27[PRISM] Fix allocations for keyword splat paramseileencodes
Fixes the following allocations tests: * `test_keyword_and_keyword_splat_parameter` * `test_keyword_parameter` * `test_keyword_splat_parameter` * `test_no_array_allocation_with_splat_and_nonstatic_keywords` * `test_no_parameters` * `test_positional_splat_and_keyword_splat_parameter` * `test_ruby2_keywords` * Checks for `first_chunk` and if `stack_length == 0` to match the upstream parser. Otherwise, this optimization is skipped. * Subtracts the index, otherwise it will skip the hash allocation for the following: `keyword(*empty_array, a: 2, **empty_hash)`. * Sets `dup_rest` in order to determine when to set the correct flags * Doesn't set `VM_CALL_KW_SPLAT_MUT` flag unless `dup_rest` doesn't match `initial_dup_rest`. Given the following code: ```ruby keyword(*empty_array, a: 2) ``` Instructions before: ``` == disasm: #<ISeq:test@test.rb:4 (4,0)-(8,3)> local table (size: 2, argc: 1 [opts: 0, rest: -1, post: 0, block: -1, kw: -1@-1, kwrest: -1]) [ 2] empty_hash@0<Arg>[ 1] empty_array@1 0000 newarray 0 ( 5)[LiCa] 0002 setlocal_WC_0 empty_array@1 0004 putself ( 7)[Li] 0005 getlocal_WC_0 empty_array@1 0007 splatarray true 0009 putobject :a 0011 putobject 2 0013 newhash 2 0015 opt_send_without_block <calldata!mid:keyword, argc:2, ARGS_SPLAT|ARGS_SPLAT_MUT|FCALL|KW_SPLAT> 0017 leave ( 8)[Re] ``` Instructions after: ``` == disasm: #<ISeq:test@test.rb:4 (4,0)-(8,3)> local table (size: 2, argc: 1 [opts: 0, rest: -1, post: 0, block: -1, kw: -1@-1, kwrest: -1]) [ 2] empty_hash@0<Arg>[ 1] empty_array@1 0000 newarray 0 ( 5)[LiCa] 0002 setlocal_WC_0 empty_array@1 0004 putself ( 7)[Li] 0005 getlocal_WC_0 empty_array@1 0007 splatarray false 0009 putobject {:a=>2} 0011 opt_send_without_block <calldata!mid:keyword, argc:2, ARGS_SPLAT|FCALL|KW_SPLAT> 0013 leave ( 8)[Re] ``` Differences: * `splatarray` is `false` not `true * `putobject`, `putobject`, `newhash` is simply `putobject` with optimizations on * Remove `ARGS_SPLAT_MUT` flag Related: ruby/prism#2994 Co-authored-by: Kevin Newton <kddnewton@gmail.com> Notes: Merged: https://github.com/ruby/ruby/pull/11438
2024-08-27[ruby/prism] Fix warning when `#!` ends with carriage returnAlexander Momchilov
https://github.com/ruby/prism/commit/5753fb6260
2024-08-27Optimize Array allocationsAlexander Momchilov
… by allocating them with the correct capacity.
2024-08-26[PRISM] Fix up nested string flags inside string concatenationKevin Newton
Notes: Merged: https://github.com/ruby/ruby/pull/11461
2024-08-26Shrink `pm_integer_t` (32 bytes → 24)Alexander Momchilov