[NewCompiler] Comment, what do we want to see?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[NewCompiler] Comment, what do we want to see?

Mathieu SUEN
Hi,

Now I am close to give you a way of geting back comment.
To do so I provide a linked list of token and a stream to navigate through it.

I have disscusse with Damien Pollet who is doing gutenberg and Stephane. So we have thought about a
interface on the RBNode:

1. A method to get back comment befor:

        "a comment for statementA"
        statementA

2. Amethod to get comment after:

        statementA. "comment for statementA"
        "this one belong to the next node"

Do you see somthing else?

I have a difficulty:

Suppose you have this:
--
methodeA: bob

        "ok for this one"
        ^[] "can get this one"
--

The last comment is a bit difficult to catch beceause in the statement above we don't have token
inside. So we can't navigate through it.

The only way I see to get back is to put first/last token at parse time but do we really want this?

(we have the same problem with RBArrayNode if you write: {})

Thanks for any comments :)

        Math