Skip to content

Have includes occur in the correct order#404

Open
cpha-trifork wants to merge 3 commits intoakkadotnet:devfrom
tsbxorg:dev
Open

Have includes occur in the correct order#404
cpha-trifork wants to merge 3 commits intoakkadotnet:devfrom
tsbxorg:dev

Conversation

@cpha-trifork
Copy link
Copy Markdown

Changes

Includes are currently handled incorrectly. Whether they occur first or last in the file they are given precedence, as if they occurred last. So if you do

include "other.conf"

foo {
  a: 1
  c: 4
}

where other.conf is

foo {
  a: 2
  b: 3
}

the result is

foo {
  a: 2
  b: 3
  c: 4
}

with the value of a coming from the included file whereas, because the include occurs first in the file, the correct result should be a: 1.

This change fixes the problem though admittedly I don't understand the code well enough to know if it's the most appropriate solution. I also haven't added a test case since I could find no existing include tests. If you're interested in merging this I'm happy to add a test.

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

Successfully merging this pull request may close these issues.

1 participant