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

Ideas for a nicer Ruby API on nodes #1296

Closed
eregon opened this issue Aug 21, 2023 · 2 comments
Closed

Ideas for a nicer Ruby API on nodes #1296

eregon opened this issue Aug 21, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@eregon
Copy link
Member

eregon commented Aug 21, 2023

  1. It would be nice to have a LiteralNode superclass or included module in those, and that would guarantee a value method which returns the literal value -> A superclass/module/interface/flag for static literals #1531
  2. Would be nice if node.name returns a Symbol for CallNode. Maybe name fields in general should always be Symbols? -> Some type: string fields should be type: constant #1530
  3. node.constant_id is quite weird to access the local variable name of a LocalVariableReadNode (and other *ReadNode). node.name would be nice. DONE
  4. On LocalVariableWriteNode node.name does exist but returns a String and not Symbol, so that's extra confusing. DONE

From #1291

@eregon eregon added the enhancement New feature or request label Aug 21, 2023
eregon added a commit to eregon/yarp that referenced this issue Aug 27, 2023
* `constant_id` and `operator_id` are confusing.
* See ruby#1296
@eregon
Copy link
Member Author

eregon commented Aug 27, 2023

@eregon
Copy link
Member Author

eregon commented Sep 16, 2023

I'll close this, 3 and 4 are done, 2 is extracted to #1530, and 1 is extracted to #1531.

@eregon eregon closed this as completed Sep 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant