[x3d-public] Effects of scrunching all VRMLscript in a Script into a single line, X_ITE.

John Carlson yottzumm at gmail.com
Mon Mar 5 10:22:12 PST 2018


Thanks for your explanation, Andreas.  It looks like I should proceed with
good speed at coming up with a replacement for X3dToJson.xslt.    which is
almost complete, if someone wants to help...

https://github.com/coderextreme/X3DJSONLD/blob/master/src/main/node/DOM2JSONSerializer.js

One of the last tasks is identifying which arrays should be objects.

John

On Mar 5, 2018 12:57 PM, "Andreas Plesch" <andreasplesch at gmail.com> wrote:

> One (fatal) issue with just merging all lines into a single line are
> caused by ecmascript single line comments:
>
> // helpful explanation
> var radius1 = outerRadius - toothDepth / 2;
> ...
>
> versus
>
> // helpful explanation var radius1 = outerRadius - toothDepth / 2; ...
>
> which never evaluates radius1.
>
> If all comments would be replaced by multiline commenting  as in /*
> helpful explanation */ , the single script line may work (if all lines
> are carefully terminated by semicolons which is not required in many
> situations in ecmascript:
> https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe
> rence/Lexical_grammar#Automatic_semicolon_insertion
> , https://www.theregister.co.uk/2018/01/12/javascript_technica
> l_group_semicolons/).
>
> It is definitely safest (and probably unavoidable) to preserve line
> breaks in the json.
>
> X_ITE itself cannot really do much more than eval the provided script as
> is.
>
> -Andreas
>
>
>
>
> On Mon, Mar 5, 2018 at 11:23 AM, John Carlson <yottzumm at gmail.com> wrote:
> > Holger, can you look at X_ITE to see the effect of scrunching all the
> > VRMLScript in a Script into a single line?  I’m having issues with that
> > right now, with JSON.  Thanks!
> >
> >
> >
> > John
>
>
>
> --
> Andreas Plesch
> Waltham, MA 02453
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20180305/0e38e172/attachment.html>


More information about the x3d-public mailing list