GithubHelp home page GithubHelp logo

Comments (11)

MikaelSmith avatar MikaelSmith commented on May 24, 2024

The implementation is incomplete. I would appreciate any help finishing it for those cases.

from cpp-hocon.

troizky avatar troizky commented on May 24, 2024

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.

MikaelSmith avatar MikaelSmith commented on May 24, 2024

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.

MikaelSmith avatar MikaelSmith commented on May 24, 2024

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.

MikaelSmith avatar MikaelSmith commented on May 24, 2024

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.

troizky avatar troizky commented on May 24, 2024

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.

troizky avatar troizky commented on May 24, 2024

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.

troizky avatar troizky commented on May 24, 2024

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.

troizky avatar troizky commented on May 24, 2024

Here is my suggested patch:
cpp-hocon.patch.gz

from cpp-hocon.

troizky avatar troizky commented on May 24, 2024

Open Merge Request #106

from cpp-hocon.

MikaelSmith avatar MikaelSmith commented on May 24, 2024

Thanks for digging into this! I'll work on reviewing the PRs.

from cpp-hocon.

Related Issues (18)

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.