Stream: t-compiler/wg-rls-2.0

Topic: Attributes in elements of array and args


Edwin Cheng (Jan 12 2020 at 04:59, on Zulip):

While looking at #2801, #2783,#2781, I just wonder what is the proper place to insert the Attr node for these element ?Some element could be a simple literal, I don't know it is okay to insert in.

matklad (Jan 12 2020 at 11:14, on Zulip):

I think we already account for attributes in literal expressions:

impl ast::Literal {
    pub fn token(&self) -> SyntaxToken {
        self.syntax()
            .children_with_tokens()
            .find(|e| e.kind() != ATTR && !e.kind().is_trivia())
            .and_then(|e| e.into_token())
            .unwrap()
    }
matklad (Jan 12 2020 at 11:14, on Zulip):

so yeah, it's ok

Edwin Cheng (Jan 12 2020 at 11:22, on Zulip):

Nice!

Last update: May 26 2020 at 10:15UTC