codeworker Forum Index codeworker
A universal parsing tool & a source code generator
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Reference bug with loadProject

 
Post new topic   Reply to topic    codeworker Forum Index -> CodeWorker Inside
View previous topic :: View next topic  
Author Message
papy
newbie


Joined: 16 May 2008
Posts: 5

PostPosted: Tue Dec 23, 2008 8:00 am    Post subject: Reference bug with loadProject Reply with quote

Hi Cedric,

Sorry if my post is at the wrong place but i don't know where to post it.

So one of my student found a bug with reference with the loadProject function.

I have found a piece of code that describe and reproduce the bug (i think that this exemple is clear):



Code:
insert this.test = "bar";
ref this.foo = this.test;

pushItem this.labels;
pushItem this.labelTable;
ref this.labelTable = this.labels#back;
insert this.labels#back = "foo";

pushItem this.labels;
pushItem this.labels#back.sublabels;
ref this.labels#back.sublabels#back = this.test;

pushItem this.labels;
pushItem this.labels#back.sublabels;
ref this.labels#back.sublabels#back = this.foo;

saveProject("tutu");
loadProject("tutu");
saveProject("toto");


the resulting project file should be :


Code:
"project" =  {
   .test = "bar",
   .foo = &ref "project.test" = "bar",
   .labels =  {
      [
         "0":"foo",
         "1": {
            .sublabels =  {
               [
                  "0":&ref "project.test" = "bar"
               ]
            }
         },
         "2": {
            .sublabels =  {
               [
                  "0":&ref "project.test" = "bar"
               ]
            }
         }
      ]
   },
   .labelTable = &ref "project.labels[\"0\"]" = "foo"
}


but it's :


Code:
"project" =  {
   .test = "bar",
   .foo = &ref "project.test" = "bar",
   .labels =  {
      [
         "0":"foo",
         "1": {
            .sublabels =  {
               [
                  "0":"bar"
               ]
            }
         },
         "2": {
            .sublabels =  {
               [
                  "0":"bar"
               ]
            }
         }
      ]
   },
   .labelTable = &ref "project.labels[\"0\"]" = "foo"
}


I think that loadProject doesn't restore references to node that are in the parent node or in a upper level than referee node.

Best regards,

Christophe Fajardo.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    codeworker Forum Index -> CodeWorker Inside All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group