possible diagnostic improvement when unquoted string encountered
brutzman opened this issue · comments
A flaw in X3dToVrml97.xslt conversion (now corrected) was originally not quoting some SFString values correctly, for example
appearance DEF MatOpaque Appearance {
alphaMode OPAQUE
should have been
appearance DEF MatOpaque Appearance {
alphaMode "OPAQUE"
The diagnostic message first provided by tovrmlx3d.exe was confusing, since it looked like the unquoted value encountered was quoted:
tovrmlx3d: Warning: VRML/X3D: Error when reading, will skip the rest of X3D file: Error at line 47 column 33: Expected string, got "OPAQUE"`
This diagnostic might be improved by indicating that an unquoted value encountered needs quotation-mark delimiters.
Thanks, fixed!
The error message will now be like
VRML/X3D: Error when reading, will skip the rest of X3D file: Error at line ... column ...: Expected string, got identifier (unquoted in X3D file) "OPAQUE"
This was indeed an unexpected confusion caused by our standard usage of double quotes in error messages to surround the problematic input. Indeed it was confusing in this case, as the error message shows the text in double quotes, and at the same time the very problem is that double quotes are missing in the input file :)
As usual, the fix is actually in Castle Game Engine and it will become available in view3dscene "snapshot" on https://castle-engine.io/view3dscene.php when this page: castle-engine/castle-engine@snapshot...master will no longer show the commit "Improve warning in case we got identifier (name) in file" .