Skip to content

Commit 844f934

Browse files
committed
fix: make library compatible with TypeScript 2.8
1 parent d6abca7 commit 844f934

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"rimraf": "^2.6.2",
3030
"ts-jest": "^23.0.0",
3131
"tslint": "^5.10.0",
32-
"typescript": "^2.9.2"
32+
"typescript": "~2.8.2"
3333
},
3434
"dependencies": {
3535
"antlr4ts": "^0.4.1-alpha.0"

src/index.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
import { ANTLRInputStream, CommonTokenStream } from 'antlr4ts';
22
import { JavaLexer } from './parser/JavaLexer';
3-
import { JavaParser } from './parser/JavaParser';
3+
import { CompilationUnitContext, JavaParser } from './parser/JavaParser';
4+
export { CompilationUnitContext };
45

56
/**
67
* Parses the given source code and returns the AST
78
* @param source Java source code to parse
89
*/
9-
export function parse(source: string) {
10+
export function parse(source: string): CompilationUnitContext {
1011
const chars = new ANTLRInputStream(source);
1112
const lexer = new JavaLexer(chars);
1213
const tokens = new CommonTokenStream(lexer);

yarn.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3521,9 +3521,9 @@ type-check@~0.3.2:
35213521
dependencies:
35223522
prelude-ls "~1.1.2"
35233523

3524-
typescript@^2.9.2:
3525-
version "2.9.2"
3526-
resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.9.2.tgz#1cbf61d05d6b96269244eb6a3bce4bd914e0f00c"
3524+
typescript@~2.8.2:
3525+
version "2.8.4"
3526+
resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.8.4.tgz#0b1db68e6bdfb0b767fa2ab642136a35b059b199"
35273527

35283528
uglify-js@^2.6:
35293529
version "2.8.29"

0 commit comments

Comments
 (0)