Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

README doesn't match actual behaviour #284

Open
vthriller opened this issue Mar 6, 2024 · 1 comment
Open

README doesn't match actual behaviour #284

vthriller opened this issue Mar 6, 2024 · 1 comment

Comments

@vthriller
Copy link

From README.md:

UCL accepts named keys and organize them into objects hierarchy internally. Here is an example of this process:

section "blah" {
	key = value;
}
section foo {
	key = value;
}

is converted to the following object:

section {
	blah {
		key = value;
	}
	foo {
		key = value;
	}
}

Yet section is currently parsed as a list of multiple dicts instead of a unified dict:

In [1]: import ucl

In [2]: ucl.load('''
   ...: section "blah" {
   ...:     key = value;
   ...: }
   ...: section foo {
   ...:     key = value;
   ...: }
   ...: ''')
Out[2]: {'section': [{'blah': {'key': 'value'}}, {'foo': {'key': 'value'}}]}

No idea whether this is actual regression or just docs being outdated, hence this issue.

Tested with:

libucl $ git show
commit edf094c0d2150e1494a877cbe06b651a306a0589 (HEAD, tag: 0.9.0)
@Crest
Copy link

Crest commented Apr 2, 2024

I can confirm that the resulting UCL parser root object contains a multi-valued "section" which presents to most ways to iterate/emit the object as an (implicit) array of multiple sub-objects instead of a single merged sub-object.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants