A comment isn’t code. The nodes are for code. A comment is more like a token —
RBComment basically has the same two instance variables as RBToken. Should
tokens also be nodes? For example, should a left paren token be represented as
a node?
If a comment is a node, how is it visited?
For example, if you have (“comment1” self “comment2” foo: “comment3” a bar:
“comment4” b “comment5”), what is the traversal order for the nodes?
To reproduce the code as it was typed why the representation a message
is not a sequence. because you need to encode that you
have comment1 and self and comment2
We do not have a structure that is responsible for that order.
We could have two entries in AST node;
one discrete where you can cherrypick what you want receiver
arguments selector
and one that represent the node placement.
Now when we emit bytecode comment would do nothing.
How having them as token helps? You will visit the receiver and check if
it has a token and place it.
I found that strange that comments are not part of the code tree as
first class citizen.
Furthermore, if comments are nodes, how do they affect all of the code
rewriting and validation that is part of the RB and its rewrite tools
With comments cannot act as nullobjects for such operation?
Stef