Skip to content

Commit

Permalink
Merge pull request #30 from DigitalPrimates/master
Browse files Browse the repository at this point in the history
Possible Fix for Issue# 29
  • Loading branch information
ialpert authored Aug 11, 2018
2 parents af66c77 + 5fccd29 commit a01125c
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/BaseVisitor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,16 @@ export class BaseVisitor extends Visitor {
}

protected mergeTrailing(elements: ASTNode[] = [], trailing: ASTNode[] = []): ASTNode[] {
const linedElements = this.byLine(elements)
const linedTrailing = this.byLine(trailing)

const merger = (el: ASTNode, line: number): ASTNode => {
const merger = (el: ASTNode): ASTNode => {
const line = el.loc && el.loc.start.line
if (linedTrailing[line]) {
el.trailing = linedTrailing[line]
}

return el
}

return map<ASTNode>(linedElements, merger) as any
return map<ASTNode>(elements, merger) as any
}

protected Location(head: ASTNode, tail: ASTNode): Location {
Expand Down

0 comments on commit a01125c

Please sign in to comment.