Coder Social home page Coder Social logo

Nested codes about qcoder HOT 6 CLOSED

ropenscilabs avatar ropenscilabs commented on June 12, 2024
Nested codes

from qcoder.

Comments (6)

elinw avatar elinw commented on June 12, 2024

Also probably this solution should include indicating an invalid tag set, specifically an open without a close or a close without an open. That should actually run on save?

from qcoder.

learithe avatar learithe commented on June 12, 2024

I've written a function that can handle nested qcodes now, it's a significant change since you can't just do it with a straight regex in R (as far as I know you can't do recursive regex in R?). I'll fit my solution into into the existing code and put it up soon.

For flagging an invalid tag set ... with nested codes I don't think we could necessarily tell which open or close went with which for reporting the specific invalid tag? We could however do the following pretty easily: 1) indicate if the number of (QCODE) and (/QCODE) tags do not match, 2) indicate if there is a (/QCODE) not immediately followed by {#code}. Would that be sufficient? How would you like this to be reported?

from qcoder.

elinw avatar elinw commented on June 12, 2024

from qcoder.

learithe avatar learithe commented on June 12, 2024

I've submitted a pull request. I also added some simple error checking and generated warnings if these are detected.

I don't see an easy way with my function to identify what specific text block is missing an opening or closing block. I can think about it a bit -- if you spot one, add it! It would be a lot easier if we had a tree structure, which I suppose could be easier to build with your str_locate_all solution?

from qcoder.

elinw avatar elinw commented on June 12, 2024

Not sure, but it's possible. One thing we can do is just count the open and closes and make sure the numbers match? I merged what you have. Definitely a big deal to have nested support!

from qcoder.

FrdVnW avatar FrdVnW commented on June 12, 2024

Globally, for me, nested coding is working. Expect when it is exactly the same strings. I open a new issue and I proposed a little thing that can resolved in a PR

from qcoder.

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.