chevrotain: Parsing fails in Safari

We used chevrotain (v4.6.0) for a new VRML loader in three.js. The loader works fine in Chrome and Firefox, but a user has reported an issue with Safari.

A VRML is a text file that can contain the keywords TRUE and FALSE. A typical example is the definition of a directional light e.g.

DirectionalLight {
    ambientIntensity 0
    color 1 1 1
    on TRUE
}

We use in our loader a token in order to detect the booleans like so:

const BooleanLiteral = createToken( { name: 'BooleanLiteral', pattern: /TRUE|FALSE/ } );

But for some reasons, this does not work in Safari (it throws a MismatchedTokenException). Any ideas what could cause the problem? I’ve debugged this since a while now and I’m not able to find a solution in my code.

You should be able to reproduce the runtime error with Safari with the following URL (exception is logged in the console): https://threejs.org/examples/webgl_loader_vrml

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 16 (9 by maintainers)

Most upvoted comments

Many thanks for your support!

I’ll close this for now as it is not a bug in Chevrotain…