Project

General

Profile

Actions

Feature #20329

closed

Clean up `--dump` sub-options

Added by nobu (Nobuyoshi Nakada) about 2 months ago. Updated 21 days ago.

Status:
Closed
Assignee:
-
Target version:
-
[ruby-core:117088]

Description

Currently we have 5 options for --dump command line option.

  • insns
  • insns_without_opt
  • yydebug(+error-tolerant)
  • parsetree(+error-tolerant)
  • parsetree_with_comment(+error-tolerant)

Among these, insns_without_opt is a variant of insns, and parsetree_with_comment is a variant of parsetree.
However, there is now another way to specify variants (e.g. +error-tolerant).
How about unifying the two so that the former can also be specified in the same form, such as --dump=parsetree+comment+error-tolerant?
It also will be able to abbreviate as parse+comm+err or more.

Updated by k0kubun (Takashi Kokubun) about 2 months ago

What will replace insns? I don't want to type insns+opt every single time. If it stays as is and insns_without_opt is changed to insns-opt (insns minus opt) or something, I'm good.

Updated by nobu (Nobuyoshi Nakada) about 2 months ago

--dump=insns will not be changed.
Since + is the separator, insns+-opt will be same as the current insns_without_opt.

Actions #3

Updated by nobu (Nobuyoshi Nakada) about 2 months ago

  • Description updated (diff)

Updated by eightbitraptor (Matthew Valentine-House) about 2 months ago

I don't feel particularly strongly about this, but something about have +- in the argument feels a little clunky to me.

I understand the desire to not change the existing options like --dump=insns, and that we've got ourselves into a state where we have both with and without, but what about if we changed the + to , - similar to how you pass options to the linker through gcc. Something like:

dump=insns
dump=insns,-opt
dump=parsetree,+error-tolerant,+comment
dump=yydebug,+error_tolerant
...etc...

Updated by nobu (Nobuyoshi Nakada) about 1 month ago

eightbitraptor (Matthew Valentine-House) wrote in #note-4:

dump=insns
dump=insns,-opt
dump=parsetree,+error-tolerant,+comment
dump=yydebug,+error_tolerant
...etc...

This looks nice.

Would --dump=insns --dump=-opt have the same effect with --dump=insns,-opt?

Updated by eightbitraptor (Matthew Valentine-House) about 1 month ago ยท Edited

nobu (Nobuyoshi Nakada) wrote in #note-5:

This looks nice.

Would --dump=insns --dump=-opt have the same effect with --dump=insns,-opt?

seems like a good idea.

Actions #7

Updated by nobu (Nobuyoshi Nakada) 21 days ago

  • Status changed from Open to Closed

Applied in changeset git|9b5d4274a247567c583667f4c8442872d8765d39.


[Feature #20329] Clean up dump sub-options

Restructure insns_without_opt and parsetree_with_comment as
insns+without_opt and parsetree+with_comment respectively, like
+error-tolerant.

Actions

Also available in: Atom PDF

Like1
Like0Like0Like0Like0Like0Like0Like0