Hilarious parsing errors

Help
Anonymous
2012-07-15
2013-06-12
  • Anonymous - 2012-07-15

    Is there something I don't understand?

    From version 7.6.1

    JSONWorker.cpp : 659

    json_string name(value_t.begin() + 1, value_t.begin() + name_ending - 1);
    

    The -1 removes the last character from the name

    JSONWorker.cpp : 596

    myinternal = internalJSONNode::newInternal(++runner, value);
    

    The ++ removes the last character from the name.

    Is there something wrong with my setup? (ubuntu 12.04, G++-4.6, amd64)

     
  • Anonymous - 2012-07-15

    Can you give an example of your actual code and the invalid result that you are getting? I've never had a problem setting the node name before. Also the config options that you are compiling with.

     
  • Jonathan Wallace

    Yeah, there are loads of unit tests.  The -1 isn't removing the last character from the name, it's removing the trailing quote.  ++runner is removing the leading quote.  For example:
    {
    "name" : "value"
    }

    The name of the item is name, not "name"

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks