Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clear all context usages in RubyLex #684

Merged
merged 1 commit into from
Oct 4, 2023
Merged

Conversation

st0012
Copy link
Member

@st0012 st0012 commented Aug 17, 2023

After this change, RubyLex will not interact with Context directly in any way. This decoupling has a few benefits:

  • It makes RubyLex easier to test as it no longer has a dependency on Context. We can see this from the removal of build_context from test_ruby_lex.rb.
  • It will make RubyLex easier to understand as it will not be affected by state changes in Context objects.
  • It allows RubyLex to be used in places where Context is not available.

(This is based on #683 and needs it to be merged first)

@st0012 st0012 requested a review from a team August 17, 2023 11:52
@st0012 st0012 self-assigned this Aug 17, 2023
@st0012 st0012 marked this pull request as draft August 17, 2023 11:53
Base automatically changed from simplify-input-processing-flow to master August 21, 2023 15:42
@st0012 st0012 force-pushed the remove-context-from-ruby-lex branch from 5025d5a to ebea5b8 Compare August 21, 2023 16:03
@st0012 st0012 force-pushed the remove-context-from-ruby-lex branch from ebea5b8 to 343ac2b Compare October 1, 2023 22:12
@st0012 st0012 marked this pull request as ready for review October 1, 2023 22:13
lib/irb/source_finder.rb Outdated Show resolved Hide resolved
@st0012 st0012 force-pushed the remove-context-from-ruby-lex branch from 343ac2b to 4bdf0a0 Compare October 4, 2023 10:19
After this change, `RubyLex` will not interact with `Context` directly
in any way. This decoupling has a few benefits:

- It makes `RubyLex` easier to test as it no longer has a dependency on
  `Context`. We can see this from the removal of `build_context` from
  `test_ruby_lex.rb`.
- It will make `RubyLex` easier to understand as it will not be affected
  by state changes in `Context` objects.
- It allows `RubyLex` to be used in places where `Context` is not available.
@st0012 st0012 force-pushed the remove-context-from-ruby-lex branch from 4bdf0a0 to e8e9841 Compare October 4, 2023 10:21
@st0012 st0012 requested a review from tompng October 4, 2023 10:21
@tompng tompng merged commit d5b262a into master Oct 4, 2023
47 checks passed
@tompng tompng deleted the remove-context-from-ruby-lex branch October 4, 2023 12:13
matzbot pushed a commit to ruby/ruby that referenced this pull request Oct 4, 2023
(ruby/irb#684)

After this change, `RubyLex` will not interact with `Context` directly
in any way. This decoupling has a few benefits:

- It makes `RubyLex` easier to test as it no longer has a dependency on
  `Context`. We can see this from the removal of `build_context` from
  `test_ruby_lex.rb`.
- It will make `RubyLex` easier to understand as it will not be affected
  by state changes in `Context` objects.
- It allows `RubyLex` to be used in places where `Context` is not available.

ruby/irb@d5b262a076
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants