Skip to content

Commit 3a98c0d

Browse files
committed
Fix eslint errors
1 parent 15eb83b commit 3a98c0d

File tree

5 files changed

+13
-13
lines changed

5 files changed

+13
-13
lines changed

src/types/ast/astExtractor/statement-extractor.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ export class StatementExtractor extends BaseJavaCstVisitorWithDefaults {
154154

155155
primary(ctx: PrimaryCtx): Primary {
156156
// Assignment LHS, MethodInvocation identifier
157-
let { name, location } = this.visit(ctx.primaryPrefix)
157+
const primaryPrefix = this.visit(ctx.primaryPrefix)
158158
if (ctx.primarySuffix) {
159159
const lastSuffix = ctx.primarySuffix[ctx.primarySuffix.length - 1]
160160
if (lastSuffix.children.arrayAccessSuffix) {
@@ -173,23 +173,23 @@ export class StatementExtractor extends BaseJavaCstVisitorWithDefaults {
173173
}
174174

175175
for (const s of ctx.primarySuffix.filter(s => !s.children.methodInvocationSuffix)) {
176-
name += '.' + this.visit(s)
176+
primaryPrefix.name += '.' + this.visit(s)
177177
}
178178

179179
// MethodInvocation
180180
if (ctx.primarySuffix[ctx.primarySuffix.length - 1].children.methodInvocationSuffix) {
181181
return {
182182
kind: 'MethodInvocation',
183-
identifier: name,
183+
identifier: primaryPrefix.name,
184184
argumentList: this.visit(ctx.primarySuffix[ctx.primarySuffix.length - 1]),
185-
location
185+
location: primaryPrefix.location
186186
} as MethodInvocation
187187
}
188188
}
189189
return {
190190
kind: 'ExpressionName',
191-
name,
192-
location
191+
name: primaryPrefix.name,
192+
location: primaryPrefix.location
193193
}
194194
}
195195

@@ -236,13 +236,13 @@ export class StatementExtractor extends BaseJavaCstVisitorWithDefaults {
236236

237237
fqnOrRefType(ctx: FqnOrRefTypeCtx) {
238238
// Assignment LHS, MethodInvocation identifier
239-
let { name, location } = this.visit(ctx.fqnOrRefTypePartFirst)
239+
const fqnOrRefTypePartFirst = this.visit(ctx.fqnOrRefTypePartFirst)
240240
if (ctx.fqnOrRefTypePartRest) {
241241
for (const r of ctx.fqnOrRefTypePartRest) {
242-
name += '.' + this.visit(r).name
242+
fqnOrRefTypePartFirst.name += '.' + this.visit(r).name
243243
}
244244
}
245-
return { name, location }
245+
return fqnOrRefTypePartFirst
246246
}
247247

248248
fqnOrRefTypePartFirst(ctx: FqnOrRefTypePartFirstCtx) {

src/types/ast/types/classes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export interface MethodHeader {
6767
formalParameterList: Array<FormalParameter>
6868
}
6969

70-
export type Result = 'void' | UnannType
70+
export type Result = UnannType
7171

7272
export interface FormalParameter {
7373
kind: 'FormalParameter'

src/types/checker/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ import {
2525
getFloatType,
2626
getNumberType
2727
} from '../types/primitives'
28-
import { Frame } from './environment'
2928
import { createArrayType } from '../typeFactories/arrayFactory'
29+
import { Frame } from './environment'
3030

3131
export type Result = {
3232
currentType: Type | null

src/types/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Node } from '../ast/types/ast'
1+
import { Node } from './ast/types'
22
import { check } from './checker'
33

44
export type TypeCheckResult = { hasTypeErrors: boolean }

src/types/types/methods.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ export class Method extends Type {
142142
return new Error('not impemented')
143143
}
144144

145-
public canBeAssigned(type: Type): boolean {
145+
public canBeAssigned(_type: Type): boolean {
146146
throw new Error('Not implemented yet')
147147
}
148148

0 commit comments

Comments
 (0)