GithubHelp home page GithubHelp logo

Comments (3)

minikomi avatar minikomi commented on June 22, 2024

Another strange edge case:

key:value
multi-line-value
[singleword]
newkey:yeah
[]
another multi line value
:end

Result:

{
  "key": "value",
  "singleword": [
    {
      "newkey": "yeah"
    }
  ],
  "newkey": "undefinedanother multi line value"
}

from archieml-js.

minikomi avatar minikomi commented on June 22, 2024

Also seems to be related:

{scope}
key:value
{}
value2
:end

result:

{
  "scope": {
    "key": "value"
  },
  "key": "undefinedvalue2"
}

from archieml-js.

abstrctn avatar abstrctn commented on June 22, 2024

Hey @minikomi - thanks for all of the examples, these were all bugs in the way archieml-js was handling multi-line values. We can continue the discussion here if there are any questions / concerns about the behavior in any specific circumstances, but the way we intended it to work was:

Start any value with either a key: value, or with an asterisk in the case of a simple array * value). The value as defined on that line is always included as the value. Sequential lines are added to the value only if those lines 1) do not contain any lines that would be interpreted as commands (i.e., {}), and are followed with an :end line.

All of the examples above broke because the javascript parser was trying to add the lines immediately preceding :end to the last key that was defined, even though there was a command line in the middle of the value that should have prevented it from being interpreted as a multi-line value.

I'm uploading a patch now that will cause key in most of your examples to wind up as a single-line value, value.

from archieml-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.