Giter VIP home page Giter VIP logo

etoml's People

Contributors

djui avatar kalta avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

etoml's Issues

Duplicate key handling incomplete

There can be three cases where duplicate keys appear:

  1. Duplicate keys on zero level
  2. Key in group name and then zero level
  3. Key in zero level and then in group name

Kind 2. is not handled intuitively, using {duplicate_key. _} error:

1> etoml:parse("[a]\n b = 1\n b = 1\n").
{error,{duplicated_key,<<"b">>}}

2> etoml:parse("[a.b]\n c = 1\n [a]\n b = 1\n").
{error,{duplicated_key,<<"b">>}}

3> etoml:parse("[a]\n b = 1\n [a.b]\n c = 1\n").
** exception error: bad argument
     in function  lists:keymember/3
        called as lists:keymember(<<"c">>,1,1)
     in call from etoml:join/3 (src/etoml.erl, line 97)
     in call from etoml:join/3 (src/etoml.erl, line 104)
     in call from etoml:join/2 (src/etoml.erl, line 92)
     in call from etoml:parse/1 (src/etoml.erl, line 60)

Parsing array of tables.

Hello!

First of all, thanks for all the contributors for this project.
Now let me bug you guys a little bit.

Does etoml supports parsing arrays of tables?
I have the following TOML:

# this is a toml file

id = "this_is_my_test"
directory = "test_scripts/"
results = "results/"



[[step]]
    info = "foo"
    [step.web]
        script = "simuterm.js"
        params = ["foo", "bar", "baz"]

[[step]]
    info = "bar"
    [step.web]
       script = "cat.js"
       params = ["can", "haz", "cheese"]

And I tried parsing it with etoml (I'm using it in a Elixir project) like:

iex> File.read!(~S(path/to/file)) |> :etoml.parse

and it gave me {:error, {:invalid_key, 9}}.

Well, 9 points to the first line of the toml where a array of tables is specified, so I'm guessing... parsing array of tables is not supported?
Thanks in advance!

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.