monte-language / typhon

A virtual machine for Monte.
Other
67 stars 10 forks source link

Linter does not consider sequence properly #184

Open washort opened 7 years ago

washort commented 7 years ago

monte lint reports false positives for names that are defined in a scope but have uses before the definition.

This source:

x
def x := 0
x

produces this report:

bad.mt:3.1-4.2: Undefined name x
bad.mt:1.1-2.2: Undefined name x

Only the second line is correct. Proper name usage analysis will need to take ordering into consideration.