GithubHelp home page GithubHelp logo

Problem with quoted semicolons about parinfer.js HOT 4 CLOSED

snoe avatar snoe commented on May 30, 2024
Problem with quoted semicolons

from parinfer.js.

Comments (4)

shaunlebron avatar shaunlebron commented on May 30, 2024

Thanks for reporting this. This uncovers another case where Parinfer can corrupt strings.

The problem is that inserting a quote before ";" gives "";", which is still a valid clojure expression, and Parinfer will operate on anything valid.

I'm not yet sure if this problem is solvable. But I have no doubt that the information fundamental to and necessary for solving it is related to quote-directionality. If we can capture the intended direction that these quotes are pointed, we may be able to come up with some rules for handling these intermediate states created by inserting or deleting quotes.

from parinfer.js.

shaunlebron avatar shaunlebron commented on May 30, 2024

There are two things that I think can help this case without introducing much complexity:

  • a trapdoor to disable parinfer once odd number of quotes are found
  • auto-closing strings to prevent trapdoor encounters

details here: https://github.com/shaunlebron/parinfer/wiki/The-Problem-with-Quotes

from parinfer.js.

shaunlebron avatar shaunlebron commented on May 30, 2024

this is fixed in the quotefix branch. see test cases here

I'm going to finish #63 before cutting a release

from parinfer.js.

shaunlebron avatar shaunlebron commented on May 30, 2024

@snoe: sorry, forgot to follow-up on this, but this has been fixed for the past few releases (at 1.4.0 now). Here's the demo of your case in atom-parinfer:

from parinfer.js.

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.