YAML::Syck line numbers?

D

Dan Kirkwood

I've dug through the YAML::Syck library source and the Ruby library,
but was unable to find what I'm looking for.. If the syck parser
finds a syntax error, it reports the line number of the error. Is
there a way to obtain line numbers of elements after a successful
load? This will be necessary in reporting errors in the semantics of
a configuration file..

For example:
pets = "---\nPets:\n boss: { species: feline }\n abby: { specied:
canine }\n...\n"
y = YAML::load(pets)
y['Pets']['abby'].line_number
Has anyone looked at doing this? Is the capability available from the
libsyck library? I'm interested in getting this info through both the
Ruby and Perl libraries..

-dan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,008
Latest member
HaroldDark

Latest Threads

Top