Comments (5)
Hopefully the issue should be fixed now, please give it another shot!
from rune.
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.
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.
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
rune/crates/rune/src/indexing/index.rs
Line 383 in c994be9
Missing item for id Id(1)
from rune.
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)
- feature request: Integrate FlexStr
- Support non-qualified imports of macros and imports which happen after the macro is used HOT 4
- Formatting misfire with anything following item macro call HOT 9
- Ergonomics of macro implementation HOT 2
- Make derive macros work outside of `rune` HOT 4
- fs functions HOT 2
- Printable errors HOT 7
- Allow to iteration over functions available in loaded source HOT 3
- Attribute macro to generate rune module from rust module HOT 1
- Support raw strings
- Custom prelude HOT 1
- Could variadic functions be supported? HOT 1
- Allow to "implement" `?` via new `Protocol::TRY` HOT 4
- Detect when a VmExecution has finished (using step) HOT 4
- Is there a reason LitStr does not implement Peek? HOT 1
- [Regression] Installing a module with a crate name panics. HOT 3
- "Vm::call takes self by value, which means we're forced to clone()" - as per blog of 2020. What is the workaround or status as of year 2023? HOT 1
- Give visitor access to more information
- Can rune run untrusted code/is it sandboxed? HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rune.