|
@ -233,14 +233,10 @@ export default class Module { |
|
|
bindReferences () { |
|
|
bindReferences () { |
|
|
this.statements.forEach( statement => { |
|
|
this.statements.forEach( statement => { |
|
|
statement.references.forEach( reference => { |
|
|
statement.references.forEach( reference => { |
|
|
let declaration; |
|
|
const declaration = reference.scope.findDeclaration( reference.name ) || |
|
|
|
|
|
this.trace( reference.name ); |
|
|
// find in local scope...
|
|
|
|
|
|
declaration = reference.scope.findDeclaration( reference.name ) || |
|
|
|
|
|
this.trace( reference.name ); |
|
|
|
|
|
|
|
|
|
|
|
if ( declaration ) { |
|
|
if ( declaration ) { |
|
|
reference.declaration = declaration; |
|
|
|
|
|
declaration.addReference( reference ); |
|
|
declaration.addReference( reference ); |
|
|
} else { |
|
|
} else { |
|
|
// TODO handle globals
|
|
|
// TODO handle globals
|
|
|