libucl icon indicating copy to clipboard operation
libucl copied to clipboard

Ability to request line/col object?

Open mitchellh opened this issue 10 years ago • 3 comments

This is just a feature request. It would be really great for validation reasons if we could extract the line/col for objects. Thoughts?


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

mitchellh avatar Jul 18 '14 23:07 mitchellh

It is not complicated to the parser to save this data. However, currently ucl_object_t is optimized for the cache line size and is exactly 64 bytes. Adding new fields is rather painful, but maybe I could use thrash_stack for these purposes...

vstakhov avatar Jul 19 '14 00:07 vstakhov

Yeah I figured that would cause friction. So I'm not sure.

I realize too that storing that much data for all objects on large configs might be painful, so maybe a parser flag as well to flag it on/off. But if it could be done, it would be very nice.

mitchellh avatar Jul 19 '14 00:07 mitchellh

+1 to this. When emitting config errors, it if very helpful to be able to point to the file and line number where the error came from, especially when using 'include' to parse multiple files.

allanjude avatar Nov 10 '14 00:11 allanjude