GithubHelp home page GithubHelp logo

Comments (2)

cyrusfirheir avatar cyrusfirheir commented on June 15, 2024

Child macros and their position and stuff aren't validated as of now. Currently, the parser only sees the entire if block, and not different sections inside it.

from twee3-language-tools.

MinusGix avatar MinusGix commented on June 15, 2024

We might be able to do this:

  • Get the range for the if macro we're looking at
  • Iterate over all macros (starting after current). Filter so that their start is within the if macros range.
  • For each of those macros, if they're a container macro then we filter out all the macros within its range, this avoids checking the macros inside the container which would be bad
  • If it is one of our children macros then we keep a count of it (probably only for ones with max field defined on them, where we need to do that)
  • If it goes over the max field (we could also easily add a min, but I'm unsure if there's any which would benefit from that?) then we warn.

It is a bit more expensive to compute than I'd like, but avoids generating an entire tree since we don't need it. I'll try implementing this.
It would allow for a min requirement, as well as requirements like else must always be after either nothing (if) or elseif (though this one is a bit more complex).

from twee3-language-tools.

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.