Giter VIP home page Giter VIP logo

Comments (5)

udoprog avatar udoprog commented on July 3, 2024 1

Hopefully the issue should be fixed now, please give it another shot!

from rune.

udoprog avatar udoprog commented on July 3, 2024

Gosh, we broke something huh. Thought we had a test for this.

I know I messed around a bit with indexing recently (this is also where all macro expansion happens), so I might've inadvertently re-ordered how items are inserted somewhere.

What happens with each AST element is that they have an opaque identifier associated with them which starts out being uninitialized. The compiler then associated data with it - in this instance item names based on a stack. This line here looks mighty suspect. Especially since we already have a usable id for the path above. The id is also only ever used for diagnostics. Or maybe we're just straight up missing ItemMeta for the root item.

Thanks for the report!

from rune.

ModProg avatar ModProg commented on July 3, 2024

That line seams to be the issue

[crates/rune/src/indexing/index.rs:381] compile::Error::msg(ast.span(), e) = Error {
    span: Span(
        20,
        82,
    ),
    kind: Custom {
        message: "missing last inserted id into the items stack",
    },
}

from rune.

ModProg avatar ModProg commented on July 3, 2024

Tried looking into it, but wasn't able to figure it out. It might be that the root ItemMeta is acutally missing, because just removing that line would yield an error on

let item = self.q.item_for((ast.span(), id))?;
:

Missing item for id Id(1)

from rune.

udoprog avatar udoprog commented on July 3, 2024

Got some time today to check it out, #522 should hopefully fix this. There is a bit of "identifier soup" going on right now which I'd like to refactor some time in the future, namely items have two kinds of identifiers:

  • One which is associated with its allocation in the item pool (allowing for deduplicating item allocations).
  • One which associated context metadata to the item, such as its visibility, which module its in, the source location it belongs to. This is what's being referenced by ast items such as ItemFn::id.

The second one is what's being associated with the opaque ast id you can see all over the place, and is the one which was missing. We just had to make sure item meta was present for it and that the Items stack which is used to build items are seeded correctly with identifiers.

from rune.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.