Граф коммитов

946 Коммитов

Автор SHA1 Сообщение Дата
Kevin Newton 1a7364b347 [ruby/prism] Use create_unescaped functions for empty heredocs
https://github.com/ruby/prism/commit/acec5a13cb
2023-10-13 15:31:30 -04:00
Kevin Newton da47a71325 [ruby/prism] Use current_string for x string escape sequences
https://github.com/ruby/prism/commit/66ce9280bb
2023-10-13 15:31:30 -04:00
Kevin Newton a7f71e461e [ruby/prism] Use token buffer for string lexing
https://github.com/ruby/prism/commit/087cd8f28b
2023-10-13 15:31:30 -04:00
Kevin Newton 973ecf6848 [ruby/prism] Extract out a couple more token buffer functions
https://github.com/ruby/prism/commit/341e027d23
2023-10-13 15:31:30 -04:00
Kevin Newton af8484bc39 [ruby/prism] Capture the token buffer logic into its own struct and functions
https://github.com/ruby/prism/commit/4334f0775b
2023-10-13 15:31:30 -04:00
Kevin Newton ef1e5b65dc [ruby/prism] Use current_string to handle escapes in string literals
https://github.com/ruby/prism/commit/d912d48104
2023-10-13 15:31:30 -04:00
Kevin Newton f64a0434dd [ruby/prism] Use current_string to handle %I
https://github.com/ruby/prism/commit/831d5f4b45
2023-10-13 15:31:30 -04:00
Kevin Newton 5fc34f1cde [ruby/prism] Use current_string for handling %W lists
https://github.com/ruby/prism/commit/edb1674725
2023-10-13 15:31:30 -04:00
Kevin Newton 41ac8ddca3 [ruby/prism] Extract out string handling for %W lists
https://github.com/ruby/prism/commit/dba9bd6b1f
2023-10-13 15:31:30 -04:00
Kevin Newton 3c743445d7 [ruby/prism] Use current_string to handle %i escapes
https://github.com/ruby/prism/commit/9c90d0a777
2023-10-13 15:31:30 -04:00
Kevin Newton 4e3013f42d [ruby/prism] Use current_string to handle %w escapes
https://github.com/ruby/prism/commit/b8420ea7ae
2023-10-13 15:31:30 -04:00
Kevin Newton 3dba3ab47d [ruby/prism] Strip out old char unescaping
https://github.com/ruby/prism/commit/27ca207ab3
2023-10-13 15:31:30 -04:00
Kevin Newton dd3986876a [ruby/prism] Handle remaining escape sequences for character literals
https://github.com/ruby/prism/commit/ba33607034
2023-10-13 15:31:30 -04:00
Kevin Newton 1a941c70e4 [ruby/prism] Track current_string to pass forward for character literals
https://github.com/ruby/prism/commit/be1d8ae8bb
2023-10-13 15:31:30 -04:00
Kevin Newton a0a0cd0caa [ruby/prism] Fix escaped 8 and escaped 9
https://github.com/ruby/prism/commit/c3a46e2de5
2023-10-13 15:31:30 -04:00
Haldun Bayhantopcu 4387af1b4a [ruby/prism] Fix parsing symbols in strings after labels
https://github.com/ruby/prism/commit/e16531650d
2023-10-12 16:01:40 +00:00
Matt Valentine-House 5c8764477f [ruby/prism] Increase the depth for the For node index variable
In CRuby's parser locals in for nodes appear deeper in the ast than they
do in Prism, but we can fix that with a transparent scope

https://github.com/ruby/prism/commit/460187f41e
2023-10-12 15:26:29 +00:00
Matt Valentine-House 9af5abd23a [ruby/prism] Allow Scope nodes to be created for a For loop
https://github.com/ruby/prism/commit/ded8711807
2023-10-11 18:26:00 +00:00
Kevin Newton f413e50ec2 [ruby/prism] Add Node::type
https://github.com/ruby/prism/commit/ca4943e3f9
2023-10-11 17:55:36 +00:00
Matt Valentine-House 0fdee133fc [ruby/prism] Attach the ast node to the scope
So when building instruction sequences for a scope we can reference
items from the ast node that requires the scope. This is useful for for
loops, where the local variable tables from the parent scope will need
to be referenced.

https://github.com/ruby/prism/commit/426b1ca094
2023-10-09 10:16:01 +00:00
Haldun Bayhantopcu 7eccc13c1f [ruby/prism] Emit error when assigning to a numbered parameter
https://github.com/ruby/prism/commit/66248ac2f6
2023-10-06 14:10:28 +00:00
Matt Valentine-House 7db4ce13ed [ruby/prism] Introduce transparent scopes.
A transparent scope is a scope that cannot have local variables added to
it's local table. When a local is added to it's table, it instead gets
added to the first non-transparent parent scope.

This is used in for loops to ensure the correct depth for local
variables inside the body

https://github.com/ruby/prism/commit/ddb8e82253

Co-Authored-By: Kevin Newton <kddnewton@gmail.com>
2023-10-06 12:21:03 +00:00
Haldun Bayhantopcu 8d8fe54355 [ruby/prism] Check for duplicate parameter names in destructured params
https://github.com/ruby/prism/commit/c3438aabea
2023-10-05 16:35:45 +00:00
Haldun Bayhantopcu 38cb92a00c [ruby/prism] Check for duplicate names in shadow args
https://github.com/ruby/prism/commit/e100c6b8ae
2023-10-05 15:12:05 +00:00
Haldun Bayhantopcu fb9795cf7a [ruby/prism] Fix parsing shadow args in lambda blocks
https://github.com/ruby/prism/commit/53efaf252d
2023-10-05 11:25:32 +00:00
Nathan Froyd e0c66b4749 [ruby/prism] [rust] write flag accessor functions
https://github.com/ruby/prism/commit/f2333ba4c8
2023-10-04 14:22:16 +00:00
Nathan Froyd cf2049cb55 [ruby/prism] give flag enums a non-`typedef`'d name
https://github.com/ruby/prism/commit/630af5cb0e
2023-10-04 14:22:15 +00:00
Kevin Newton d47af93110 [ruby/prism] Provide pm_parser_err_current and pm_parser_err_previous
https://github.com/ruby/prism/commit/4828c96939
2023-10-03 18:46:37 +00:00
Kevin Newton ad0e8ddbdb [ruby/prism] Consolidate diagnostic appendings
https://github.com/ruby/prism/commit/4f107d8962
2023-10-03 18:46:36 +00:00
Benoit Daloze 87dad067e0 Sync with prism CallNode#name changes
* https://github.com/ruby/prism/pull/1533
2023-10-02 09:18:56 -04:00
Nathan Froyd f88f5b59e8 [ruby/prism] remove `peek_string` to avoid subtle memory issues
https://github.com/ruby/prism/commit/f393d30ce1
2023-09-29 20:41:23 +00:00
Kevin Newton 9861ec4fb9 [ruby/prism] Mark ranges as static literal
https://github.com/ruby/prism/commit/4c77944dd4
2023-09-29 15:26:06 +00:00
Kevin Newton be63e2515b [ruby/prism] Bump version
https://github.com/ruby/prism/commit/3e44415ca2
2023-09-29 15:21:50 +00:00
Kevin Newton 100ce34331 [ruby/prism] Add a type method for quick comparison
https://github.com/ruby/prism/commit/0c7d9c3c01
2023-09-29 15:16:30 +00:00
Kevin Newton 223e9fcb27 [ruby/prism] Self should not be marked as static literal
https://github.com/ruby/prism/commit/81265ed8a7
2023-09-28 18:51:26 +00:00
Kevin Newton 56cf1633a2 [ruby/prism] Turn on static literal for assoc, hash, and array nodes
https://github.com/ruby/prism/commit/80c2c931b5
2023-09-28 18:15:35 +00:00
Kevin Newton a213d21448 Move CRuby-specific prism files to top level 2023-09-28 09:44:16 -04:00
Haldun Bayhantopcu 834560a923 [ruby/prism] Check whether the predicate is closed for conditionals
https://github.com/ruby/prism/commit/bf43006d0a
2023-09-28 13:32:02 +00:00
Haldun Bayhantopcu 7799fe90da [ruby/prism] Check for a semicolon or a newline after the inheritance operator
https://github.com/ruby/prism/commit/0326ba6775
2023-09-28 13:31:22 +00:00
Haldun Bayhantopcu 0084bac47a [ruby/prism] Fix assertion failure for fwd params after rest
https://github.com/ruby/prism/commit/f86bff6dd7
2023-09-28 13:24:57 +00:00
eileencodes 54bbf9a6e9 [PRISM] Implement MatchLastLineNode
This PR implements `MatchLastLineNode` for Prism.

Related: ruby/prism#1335
2023-09-27 18:36:23 -04:00
Nathan Froyd 2955513095 [ruby/prism] rearrange the constant pool so IDs can be used for indexing
https://github.com/ruby/prism/commit/6f243de0c7
2023-09-27 15:41:05 -04:00
Nathan Froyd 5b6a51ad9d [ruby/prism] shrink `yp_constant_t` by 8 bytes
https://github.com/ruby/prism/commit/5c01eb5e6f
2023-09-27 15:41:05 -04:00
Kevin Newton 3d0a46796b Rename YARP symbols to prism 2023-09-27 13:57:38 -04:00
Kevin Newton 4f73a7c2f7 Sync to prism rename commits 2023-09-27 13:57:38 -04:00
Kevin Newton 8ab56869a6 Rename YARP filepaths to prism filepaths 2023-09-27 13:57:38 -04:00