Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debug output #23

Open
gustavnikolaj opened this issue Apr 22, 2015 · 1 comment
Open

Debug output #23

gustavnikolaj opened this issue Apr 22, 2015 · 1 comment
Labels

Comments

@gustavnikolaj
Copy link
Collaborator

Where did the line come from?

conf1.cjson:
{
  "#include": "conf2.cjson",
  "foo": "bar"
}

conf2.cjson:
{
  "baz": "qux"
}

yields

{
  "foo": "bar", // conf1.cjson
  "baz": "qux" // conf2.cjson
}
@msiebuhr
Copy link
Contributor

I considered hacking it by adding sidecar-values to all imported keys;

1.json:

{
  "#include": "2.cjson",
  "foo": "bar",
  "foo#origin": "1.json"
}

2.json:

{
  "baz": "qux",
  "baz#origin": "2.json"
}

It messed the files quite badly for re-use, but it does get the desired output without messing around building a AST of any sort, having a cjson writer with comments (though one could be retrofitted on this) or any such things.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants