Comments (11)
That's strange, what does your include
directive look like?
I think there are some pretty strict limitations on it right now, but I've definitely used it for something like include file("/absolute/path")
and include classpath("local/file")
.
Actually, I take that back... not sure I've used those examples with this hocon parser.
from cpp-hocon.
I think you are hitting #94
from cpp-hocon.
BTW, as I see some people commenting, is this project maintained? I sent a PR for fixing another bug with included files (#95) without any reaction for more than 3 months. @dvhwgumby , sorry for the noise,
from cpp-hocon.
from cpp-hocon.
FWIW, the "spec" for HOCON ([https://github.com/lightbend/config/blob/master/HOCON.md#includes]) considers the syntax our team used to be legit.
from cpp-hocon.
Understood. This is currently an incomplete implementation of the spec. It would be nice to improve it, but I'm not personally spending a ton of time on it.
I'm surprised the lightbend parser rejected include file("foo")
, since they seem to claim to support it in https://github.com/lightbend/config#features-of-hocon.
from cpp-hocon.
I ran into a similar situation.
In my case, I have a.conf and b.conf both in directory "ProjectDir/conf/".
a.conf is like
{ include "b.conf" ...}
when I run code in directory "ProjectDir/bin/", I always get an error:
Something went wrong when parsing hocon file. Exception message:reader() should not be called on resources
I wonder how I can fix that.
from cpp-hocon.
I can give some suggestions of where to look to start a fix. Our code mirrors the lightbend/config implementation fairly closely, so you can use that to compare where we might be missing some implementation.
The parser is in src/config_document_parser.cc. parse_context::parse_include
is the first place I'd look, which at least accepts include "foo"
. It's possible we're setting that up with the wrong type, but I suspect the actual problem is later. It's possible parse_context::parse_include
in src/config_parser.cc is a problem.
If b.conf
is empty, do you get an error? Possible the parser for the included file is not setup correctly.
from cpp-hocon.
In my case, I fix it by changing some code. And my change exists here . For now, it works fine for me. I want you guys review my code and find out where bugs may lay.
Thanks a lot ~
from cpp-hocon.
Thanks for providing that! Not sure when someone might get to looking at it. If anyone's interested in turning that into a PR, I can try to help review it.
from cpp-hocon.
I believe this is fixed by #115. Please re-open the issue if I'm mistaken.
from cpp-hocon.
Related Issues (18)
- Why is include name hocon/xxx but library is libcpp-hocon? HOT 2
- Self-Referential Substitutions don't work HOT 11
- 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
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.