File tree Expand file tree Collapse file tree 6 files changed +13
-11
lines changed
Expand file tree Collapse file tree 6 files changed +13
-11
lines changed Original file line number Diff line number Diff line change 11import { BaseJavaCstVisitorWithDefaults , CstNode , TypeDeclarationCtx } from 'java-parser'
22
33import { NormalClassDeclaration } from '../types/classes'
4- import { AST } from '../types'
4+ import { AST , Location } from '../types'
55import { ClassExtractor } from './class-extractor'
66
77export class ASTExtractor extends BaseJavaCstVisitorWithDefaults {
@@ -13,7 +13,7 @@ export class ASTExtractor extends BaseJavaCstVisitorWithDefaults {
1313 kind : 'CompilationUnit' ,
1414 importDeclarations : [ ] ,
1515 topLevelClassOrInterfaceDeclarations : this . topLevelClassOrInterfaceDeclarations ,
16- location : cst . location
16+ location : cst . location as Location
1717 }
1818 }
1919
Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ export class ConstructorExtractor extends BaseJavaCstVisitorWithDefaults {
3333 private location : Location
3434
3535 extract ( cst : ConstructorDeclarationCstNode ) : ConstructorDeclaration {
36- this . location = cst . location
36+ this . location = cst . location as Location
3737 this . visit ( cst )
3838 return {
3939 kind : 'ConstructorDeclaration' ,
Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ export class ExpressionExtractor extends BaseJavaCstVisitorWithDefaults {
5656 private location : Location
5757
5858 extract ( cst : ExpressionCstNode ) : Expression {
59- this . location = cst . location
59+ this . location = cst . location as Location
6060 return this . visit ( cst )
6161 }
6262
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import { Expression } from '../types/blocks-and-statements'
1010import { Identifier , FieldDeclaration , FieldModifier } from '../types/classes'
1111import { ExpressionExtractor } from './expression-extractor'
1212import { TypeExtractor } from './type-extractor'
13+ import { Location } from '../types'
1314
1415export class FieldExtractor extends BaseJavaCstVisitorWithDefaults {
1516 private modifier : Array < FieldModifier > = [ ]
@@ -30,7 +31,7 @@ export class FieldExtractor extends BaseJavaCstVisitorWithDefaults {
3031 variableInitializer : this . value
3132 }
3233 ] ,
33- location : cst . location
34+ location : cst . location as Location
3435 }
3536 }
3637
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ import {
2121import { BlockStatement } from '../types/blocks-and-statements'
2222import { BlockStatementExtractor } from './block-statement-extractor'
2323import { TypeExtractor } from './type-extractor'
24+ import { Location } from '../types'
2425
2526export class MethodExtractor extends BaseJavaCstVisitorWithDefaults {
2627 private modifier : Array < MethodModifier > = [ ]
@@ -42,9 +43,9 @@ export class MethodExtractor extends BaseJavaCstVisitorWithDefaults {
4243 methodBody : {
4344 kind : 'Block' ,
4445 blockStatements : this . body ,
45- location : cst . location
46+ location : cst . location as Location
4647 } ,
47- location : cst . location
48+ location : cst . location as Location
4849 }
4950 }
5051
Original file line number Diff line number Diff line change @@ -9,10 +9,10 @@ export type AST = CompilationUnit
99export interface Location {
1010 startOffset : number
1111 startLine : number
12- startColumn ? : number
13- endOffset ? : number
14- endLine ? : number
15- endColumn ? : number
12+ startColumn : number
13+ endOffset : number
14+ endLine : number
15+ endColumn : number
1616}
1717
1818export interface BaseNode {
You can’t perform that action at this time.
0 commit comments