Code Monkey home page Code Monkey logo

Comments (12)

NalaGinrut avatar NalaGinrut commented on May 13, 2024 1

@bjorn3 nice to know it, however, -Z seems only for nightly.

@philberty If you just want to output the current result to a file with an option, I think it's just a few lines code. It's possible to refactor the current dump framework to support multiple dump format, and even for a different stage of the pipeline, but I don't think it's our current work. Anyway it's a good idea to add to TODO.

from gccrs.

bjorn3 avatar bjorn3 commented on May 13, 2024 1

Did you forget to close this?

from gccrs.

NalaGinrut avatar NalaGinrut commented on May 13, 2024
  • Traverse AST top-down and resolve every encountered name.
  • The situation that new scope should be added:
    • A block enclosing with curly braces
    • Let binding
    • Hygiene macro
  • The rustc introduced a concept of Ribs to include all these kinds of scopes. Each Ribs maintain its own stack for storing the scopes. I think this can be implemented by a base class Scope. Maybe we don't have to reinvent a new concept.
  • These items have their own namespace, so the identifier is NOT unique among them:
    • Types
    • Values
    • Macros.

from gccrs.

bjorn3 avatar bjorn3 commented on May 13, 2024

The RFC for the current name resolution is: https://github.com/rust-lang/rfcs/blob/master/text/1560-name-resolution.md

from gccrs.

NalaGinrut avatar NalaGinrut commented on May 13, 2024

Oh nice! That's what we need, I googled an obsoleted result. Thanks!

from gccrs.

NalaGinrut avatar NalaGinrut commented on May 13, 2024

I think we should also add an option to dump the AST after the resolution, for debugging the resolution.

from gccrs.

philberty avatar philberty commented on May 13, 2024

I agree we can reuse the same command line option and i think dumping to file would be really helpful aswell lets makea new issue to dump to file instead of console

from gccrs.

bjorn3 avatar bjorn3 commented on May 13, 2024

Rustc has several versions of this: rustc -Zunpretty=help

from gccrs.

NalaGinrut avatar NalaGinrut commented on May 13, 2024

The resolution relies on macro expansion, so I'm starting to work on macros parallelly. #17

from gccrs.

philberty avatar philberty commented on May 13, 2024

Sorry for the closed issues i wanted to see if tagging commits linked them to issues but it seems to just close them instead

from gccrs.

philberty avatar philberty commented on May 13, 2024

Closing this as there is documentation available over on the wiki for name resolution

from gccrs.

philberty avatar philberty commented on May 13, 2024

Thanks, Again we are following rustc more documentation will be added to the wiki over time. See -frust-dump-all for debug outputs and this diagram.

image

from gccrs.

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.