realXtend / tundra

realXtend Tundra SDK, a 3D virtual world application platform.
www.realxtend.org
Apache License 2.0
84 stars 70 forks source link

tr1::regex on Visual Studio 2008 fails to parse some files #706

Closed cadaver closed 11 years ago

cadaver commented 11 years ago

In the LudoCraft Circus scene, asset references in a certain script file fail to be parsed due to tr1::regex implementation. Recompiling Tundra with Boost enabled fixes the problem. In practice this means that Boost should be forced on when compiling with VS2008.

jonnenauha commented 11 years ago

Does it use the , delimiter for sub assets? I remember Jukka saying Ludo uses that somewhere and that's why it would be good to preserve. Do you have examples on what refs it fails? We have deployed Rocket without boost for quite a while now and haven't seen things failing.

Stinkfist0 commented 11 years ago

How about VS2010 regex?

cadaver commented 11 years ago

The particular case where I observed it failing is rather odd though, as adding !refs to the file in question (PopcornMachine.js) had no effect, and none of the refs got parsed. No subassets in that file.

I will test VS2010 later. In the meanwhile, the bug is rather easy to test for: walk to the popcorn booth in the Circus scene, and if its UI file doesn't show up (but is rather shown unloaded in the Assets window) then you know that the script failed to pick up its asset refs.

jonnenauha commented 11 years ago

It does do the parsing as Utilities.js is found so the parsing is executed at least, but thats in the second engine.IncludeFile pass. We pretty much never use relative refs in // !ref: lines in our own scripts, I have kind of kept that as a convention for us as I just encountered problems with them too frequently. Might it be related more to the relative ref than anything else?

For anyone else interested part that you should be looking at https://github.com/Adminotech/tundra/blob/admino_tundra/src/EntityComponents/EC_Script/ScriptAsset.cpp?source=c#L55

cadaver commented 11 years ago

Also happens on VS2010. This is actually a newline issue, and occurs with scripts that have Unix newlines. Good news is that it can be fixed in the regex, by matching both \n and \r.