daokoder / dao

Dao Programming Language
http://daoscript.org
Other
198 stars 19 forks source link

Better error message for already defined constants #522

Open dumblob opened 8 years ago

dumblob commented 8 years ago

The error message should also contain some information where the constant has been declared. At least which module or better in which module and namespace.

load web.html import html

routine main(...: string as _cols) {
  cols = {=>}
  for (col in _cols) cols[col[1]] = none
  return 0
}
0$ dao ~/__dao_constant_cannot_be_modified.dao
[[ERROR]] in file "/home/test/__dao_constant_cannot_be_modified.dao":
  At line 5 : Invalid for loop --- " for (col in _cols) cols[col[1]] ... ";
  At line 5 : Constant cannot be modified --- " col ";