Git Product home page Git Product logo

Comments (3)

kaj avatar kaj commented on September 18, 2024 1

Agreed. The first one would be easy enough to fix by failing the build job when there is an error in compiling a template. That would mean only seeing errors like the second kind, and never attempt to actually compile the rust code that uses the templates when template compilation fails.

To improve the second kind require learning to provide specific parser error messages from the nom parser generator. I'm not even sure how good support nom has for that yet, but I will look into it.

from ructe.

kaj avatar kaj commented on September 18, 2024 1

I've been experimenting some more with this (without committing any code). It seems to be possible to get rather good error information from nom, but the parser has to be partially reconstructed; I have typically created largish sub-parsers (e.g. one parser for a complete @for item in items { something } and one for @if condition { something }) and joined them with alt!. This won't work since the generated parser will ignore errors in all but the last branch. It can be fixed by using the switch! macro rather than alt!. But I still have problem with looping constructs, which will just assume the loop ended on any error, rather than reporting the actual error.

I have not given up, but this may take some time.

from ructe.

kaj avatar kaj commented on September 18, 2024

I think this is done for now (although not released yet).

from ructe.

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.