Giter VIP home page Giter VIP logo

Comments (6)

Stebalien avatar Stebalien commented on May 26, 2024

You're missing a semicolon before @ if nabar_drawer (what, you wanted a nice error message?). In the past, issuing compiler errors from macros was impossible so I didn't even bother trying to handle error cases nicely but that has since changed with the introduction of the compile_error macro so I'll open an issue for sane errors.

from horrorshow-rs.

Stebalien avatar Stebalien commented on May 26, 2024

#18

from horrorshow-rs.

Txuritan avatar Txuritan commented on May 26, 2024

Thank you that fixed it, I though I got all those. I also never knew that macros couldn't have error handling, but yes having any type of error handling would be nice other than the 'it failed' kind it has now.

from horrorshow-rs.

Stebalien avatar Stebalien commented on May 26, 2024

They can now but it's still very difficult. For example, there's no way to get the line on which a token occurs in a macro (as far as I know at least).

Note: This only applies to declarative macros (like horrorshow). Procedural macros are a lot more flexible (they're just procedural code).

from horrorshow-rs.

Txuritan avatar Txuritan commented on May 26, 2024

Perhaps it could be done by the render, like it walks through and if it finds something that breaks then it takes note of it and logs it.

from horrorshow-rs.

Stebalien avatar Stebalien commented on May 26, 2024

Unfortunately not. That happens at run-time but macro syntax errors happen at compile time.

from horrorshow-rs.

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.