tunnelvisionlabs / antlr4ts

Optimized TypeScript target for ANTLR 4
Other
639 stars 108 forks source link

Can't compile with '"module": "amd"' #357

Open bennysalewski opened 6 years ago

bennysalewski commented 6 years ago

I get following errors if I try to compile it with amd-target:

src/tree/xpath/XPath.ts(89,9): error TS2339: Property 'recover' does not exist on type 'XPathLexer'.
src/tree/xpath/XPath.ts(91,9): error TS2339: Property 'removeErrorListeners' does not exist on type 'XPathLexer'.
src/tree/xpath/XPath.ts(92,9): error TS2339: Property 'addErrorListener' does not exist on type 'XPathLexer'.
src/tree/xpath/XPath.ts(93,43): error TS2345: Argument of type 'XPathLexer' is not assignable to parameter of type 'TokenSource'.
  Property 'nextToken' is missing in type 'XPathLexer'.
src/tree/xpath/XPath.ts(99,29): error TS2339: Property 'charPositionInLine' does not exist on type 'XPathLexer'.
src/tree/xpath/XPathLexer.ts(4,21): error TS2307: Cannot find module 'antlr4ts/atn/ATN'.
src/tree/xpath/XPathLexer.ts(5,33): error TS2307: Cannot find module 'antlr4ts/atn/ATNDeserializer'.
src/tree/xpath/XPathLexer.ts(6,28): error TS2307: Cannot find module 'antlr4ts/CharStream'.
src/tree/xpath/XPathLexer.ts(7,23): error TS2307: Cannot find module 'antlr4ts/Lexer'.
src/tree/xpath/XPathLexer.ts(8,35): error TS2307: Cannot find module 'antlr4ts/atn/LexerATNSimulator'.
src/tree/xpath/XPathLexer.ts(9,25): error TS2307: Cannot find module 'antlr4ts/Decorators'.
src/tree/xpath/XPathLexer.ts(10,26): error TS2307: Cannot find module 'antlr4ts/Decorators'.
src/tree/xpath/XPathLexer.ts(11,29): error TS2307: Cannot find module 'antlr4ts/RuleContext'.
src/tree/xpath/XPathLexer.ts(12,28): error TS2307: Cannot find module 'antlr4ts/Vocabulary'.
src/tree/xpath/XPathLexer.ts(13,32): error TS2307: Cannot find module 'antlr4ts/VocabularyImpl'.
src/tree/xpath/XPathLexer.ts(15,24): error TS2307: Cannot find module 'antlr4ts/misc/Utils'.
src/tree/xpath/XPathLexer.ts(54,8): error TS2339: Property '_interp' does not exist on type 'XPathLexer'.
src/tree/xpath/XPathLexer.ts(81,24): error TS2339: Property 'text' does not exist on type 'XPathLexer'.
src/tree/xpath/XPathLexer.ts(82,66): error TS2339: Property 'type' does not exist on type 'XPathLexer'.
src/tree/xpath/XPathLexer.ts(83,18): error TS2339: Property 'type' does not exist on type 'XPathLexer'.

I am using following tsconfig.ts:

{
  "compilerOptions": {
    "outDir": "target",
    "sourceMap": true,
    "module": "amd",
    "target": "es6",
    "noImplicitAny": true,
    "strictNullChecks": true,
    "experimentalDecorators": true,
    "declaration": true,
    "preserveConstEnums": true,
    "typeRoots": [
      "./node_modules/@types"
    ]
  },
  "exclude": [
    "node_modules",
    "target",
    "tool",
    "test",
    "benchmark"
  ]
}
BurtHarris commented 6 years ago

'XPathLexer' is the one piece of code where we use the code-generation tool in building the runtime library, so I'm guessing this is some sort of build-order problem.