Remove unused PROMPT_N
#685
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Since #500 (revision
364a6d56), thePROMPT_Nprompt format is no longer used (explanation follows). This change removes it.The only usage of
PROMPT_N's value is inIRB::Irb#eval_input:irb/lib/irb.rb
Lines 522 to 534 in 65e8e68
In order for
@context.prompt_nto be used here,continuemust be falsey andindentmust be positive.That block given to
set_promptis called only byRubyLex#prompt:irb/lib/irb/ruby-lex.rb
Lines 157 to 161 in 65e8e68
In order to satisfy the conditions above,
opensmust be empty (technically it could also be populated with only falsey values, but that's not the case here) andcalc_indent_level(opens)must be positive.RubyLex#calc_indent_levelis defined as:irb/lib/irb/ruby-lex.rb
Lines 365 to 388 in 65e8e68
If
opensis empty, then the block given toopens.each_with_indexwill never be evaluated, andcalc_indent_levelwill return the initial value ofindent_level:0. Thereforecalc_indent_level(opens)cannot be positive whileopensis empty.Since these conditions cannot be satisfied,
PROMPT_Nwill never be used.However, maybe it's unintended that
PROMPT_Nis unused now, in which case I can close this PR.