Skip to content

Key chaining before defining full object #3

@JakeStanger

Description

@JakeStanger

The spec currently specifies that key-chaining can be mixed with full-object representation:

specification/spec.md

Lines 409 to 419 in b5084cb

The 'standard' nested object syntax can be mixed with key chaining:
```corn
{
foo = {
bar = 42
}
foo.pi = 3.14
}
```

What is not specified is whether this should be supported in reverse, ie chaining prior to the full-object.

{
    value.foo = 42
    value = { bar = 3.14 }
}

https://github.com/corn-config/test-suite/blob/0a493cedc8f0039bc9a0aceeb6a3c66ba0024bce/corn/key/chaining/start.pos.corn

The current (v0.10) behaviour is that foo is overwritten and lost.

{ "value": { "bar": 3.14 } }

https://github.com/corn-config/test-suite/blob/0a493cedc8f0039bc9a0aceeb6a3c66ba0024bce/json/key/chaining/start.json

Should this be the the case, or should the expected result be an object with both foo and bar?

A decision is required, and the spec needs to be updated either way.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions