Giter VIP home page Giter VIP logo

Comments (1)

thestr4ng3r avatar thestr4ng3r commented on July 30, 2024 1

Requirements for the text format:

  • Correctly handle (escape) all valid strings as keys and values, including '=', '\n', '\', etc.
  • Support namespaces somehow

Here is my proposal for a concrete format since I am quite sure the current text k=v is completely broken (# stuff are just comments for explaining but should maybe not be part of the format):

some_key=some_val                             # a record in the root namespace
something\nwith\nnewlines=val\nwith\nnewlines # newlines separate different records, so must be escaped
key\=with\=equals=val=with\=quals             # = must be escaped in the key, but in the value it's optional
key\\with\\backslash=val\\with\\backslash

# completely empty lines are ignored

/subns                                        # lines beginning with '/' and no '=' enter a new namespace (path is always absolute to the root)
key_in_subns=val_in_subns

/subns/deeper                                 # deeper nesting (again, path is absolute)
deepest_key=deepest_val

/weird\=ns\\\nwtf                             # namespace names use the same escaping as keys ...
\/justa_key=henlo                             # except that keys must always escape the first char if it is a slash

/                                             # return to the root namespace (do we want to allow multiple places for a single ns?)
key_in=root

from sdb.

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.