Comments (11)
The implementation is incomplete. I would appreciate any help finishing it for those cases.
from cpp-hocon.
Even the simplest testcase does not work:
"a": {
"b": 27
},
"obj": ${a}
"val": ${obj.b}
Maybe this one is easier to fix?
from cpp-hocon.
That is likely HC-73. I'll take a quick look to see if I can figure out what's wrong, but don't have a ton of time to spend on it before I'm on vacation for 2 weeks.
from cpp-hocon.
This library was implemented to closely mirror the structure of https://github.com/lightbend/config. So tracing the exception I get with your simple test case back to https://github.com/puppetlabs/cpp-hocon/blob/master/lib/src/values/config_reference.cc#L75 and comparing to https://github.com/lightbend/config/blob/master/config/src/main/java/com/typesafe/config/impl/ConfigReference.java#L70, it looks like the fallback code at https://github.com/puppetlabs/cpp-hocon/blob/master/lib/src/values/config_reference.cc#L61 wasn't implemented. I'll try that out.
from cpp-hocon.
It looks like this might have actually been fixed recently in config v1.3.2. So there's some work to incorporate the fixes added. Update: I might be jumping to conclusions here; but this is the area where a fix will probably be needed. If it's not a fix in config 1.3.2, then the lookup_subst
is failing somehow.
from cpp-hocon.
I've found bug in https://github.com/puppetlabs/cpp-hocon/blob/master/lib/src/values/simple_config_object.cc#L32, must be checking for non-empty.
Corresponding line in Java project: https://github.com/lightbend/config/blob/master/config/src/main/java/com/typesafe/config/impl/SimpleConfigObject.java#L364
Unfortunately 2 test cases are failing now...
from cpp-hocon.
Also found that method config_delayed_merge_object::resolve_substitutions was not implemented like here: https://github.com/lightbend/config/blob/master/config/src/main/java/com/typesafe/config/impl/ConfigDelayedMergeObject.java#L53
After fixing that I'm getting an exception 'should not be reached (merging non-simple_config_object)' in simple_config_object::merged_with_object on parsing following config:
a = {aa = mama, bb = mia}
b = ${a}
b.aa = mea
# below is failing
b.bb = culpa
from cpp-hocon.
One more bug in https://github.com/puppetlabs/cpp-hocon/blob/master/lib/inc/internal/values/config_delayed_merge_object.hpp#L10, class config_delayed_merge_object did not inherit from class unmergeable like here: https://github.com/lightbend/config/blob/master/config/src/main/java/com/typesafe/config/impl/ConfigDelayedMergeObject.java#L21
from cpp-hocon.
Here is my suggested patch:
cpp-hocon.patch.gz
from cpp-hocon.
Open Merge Request #106
from cpp-hocon.
Thanks for digging into this! I'll work on reviewing the PRs.
from cpp-hocon.
Related Issues (18)
- Why is include name hocon/xxx but library is libcpp-hocon? HOT 2
- Fails to build with Boost 1.72 HOT 3
- Is there a way to write configuration parameters to files ? HOT 1
- Automatically regenerate gh-pages branch on release
- Example doesn't compile, and segfaults when you fix the compilation issues
- Tests fail to compile with pre-release glibc and leatherman-vendored Catch HOT 3
- How can I merge two configs? HOT 2
- Good reference identified as "part of a cycle of substitutions"
- Some basic examples needed HOT 4
- "include" with files crashes HOT 3
- Valgrind errors (no observable impact) HOT 2
- releases aren't buildable HOT 2
- Array at root? HOT 4
- include quoted string HOT 2
- included file root
- Resolving inheritence/overloading HOT 2
- the include command causes an error HOT 11
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cpp-hocon.