Giter Site home page Giter Site logo

clarify quoting and escaping about kivar HOT 4 CLOSED

honzakutil avatar honzakutil commented on August 26, 2024
clarify quoting and escaping

from kivar.

Comments (4)

markh-de avatar markh-de commented on August 26, 2024

I have slightly reworded some parts of that section, but I don't think that's what you mean.

Background: When using special separator characters, you need a way to "protect" verbatim parts of your input string. For example, when a separator appears inside a quoted string, you want to keep the quoted string as a verbatim string, and do not want to mess with separation. Same with parentheses: Imagine a fictional programming language function call: function_name(arg1, another_function(foo, bar), arg3). When comma-splitting the content of the outer parens, you would not want to let your parser split foo and bar, as they are inside a "protected" scope.

As separating parts of a rule is done from the outside to the inside, the parser must be aware of (nested) parens and keep their content together, so that the rule is split correctly.

For KiVar: If the parser would not do this, the spaces inside a choice definition would be used to split the rule definition into its sections. E.g. asp ch1(value -!) would be separated into asp, ch1(value and -!).

To answer your question: The outcome of how you have used the parens is a side-effect without a use-case.

Hope this explains it.

Anyway, if you find the documentation misleading, please point me to the exact part which confuses you.

There will be so much to be updated in the documentation once I got all my current plans implemented. 😄

from kivar.

markh-de avatar markh-de commented on August 26, 2024

Ah, I think I know what you mean. Yes, you are right, it may be misleading. Special characters are only protected inside inner unresolved parens. It's more an implementation detail, and expected by the user anyway. I'll change this into a less prominent side-note (when reworking the docs).

I'll keep this issue to remind me. 😄

from kivar.

markh-de avatar markh-de commented on August 26, 2024

Nevermind. Just removed the stuff about the parens.

They do not belong into the list anyways. Because the difference between quoting/escaping and the parens is: The quoting and escaping is virtual (it gets removed by the parser and is not part of the result), whereas parens are kept, they just protect their content as a side-effect.

So, this must have been the part that confused you. Sorry.

Is this issue resolved for you?

from kivar.

honzakutil avatar honzakutil commented on August 26, 2024

Thanks for explanation. Outcome for me is, that parentheses are not intended for any other use than choice(value). Because documentation of KiVar is one of the best I have seen on github, I was curious, if it is mistake or intention with some feature behind.

from kivar.

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.