Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot parse with webidl2 because [] is deprecated #191

Open
bglgwyng opened this issue Mar 25, 2018 · 0 comments
Open

Cannot parse with webidl2 because [] is deprecated #191

bglgwyng opened this issue Mar 25, 2018 · 0 comments

Comments

@bglgwyng
Copy link

bglgwyng commented Mar 25, 2018

I'm trying to generate typescript definition d.ts from ammo.idl using webidl2.

import * as fs from "fs";
import WebIDL2 from "webidl2";

const source = fs.readFileSync("./ammo.idl").toString();
const ast = WebIDL2.parse(source, { allowNestedTypedefs: true });

But it gave me an error

D:\webidl-typer\node_modules\webidl2\lib\webidl2.js:142
      throw new WebIDLParseError(message, line, tok, tokens.slice(0, maxTokens));
      ^
Got an error during or right after parsing `interface btTransform`: Unterminated operation, line 82 (tokens: 'float[] m')

So I tested

interface test {
  void test(float a[]);
};

and the same error came out.
According to this commit and also this one,
[] seems deprecated in the latest webidl syntax.
From my understanding, just removing [] to make float[] sequence<float> is the right adjustment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant