Moved local identifiers to resolver and AST
Now the local identifier is associated with each node so symbols in function bodies (which are compiled long after the associated sunScriptFile instances are closed) can be mangled correctly.
This commit is contained in:
parent
04aba6938b
commit
675f2ab4a7
6 changed files with 161 additions and 85 deletions
frontend
|
@ -31,7 +31,7 @@ namespace arookas
|
|||
else {
|
||||
if (results.Error is sunSourceException) {
|
||||
var error = results.Error as sunSourceException;
|
||||
Error(" in file \"{0}\"\n at line {1}, col {2}\n\n{3}{4}", error.Location.File, error.Location.Line, error.Location.Column, GetErrorPreview(error.Location), error.Message);
|
||||
Error(" in file \"{0}\"\n at line {1}, col {2}\n\n{3}{4}", error.Location.ScriptName, error.Location.Line, error.Location.Column, GetErrorPreview(error.Location), error.Message);
|
||||
exitCode = 1;
|
||||
}
|
||||
else {
|
||||
|
@ -107,7 +107,7 @@ namespace arookas
|
|||
static string GetErrorPreview(sunSourceLocation location) {
|
||||
Stream file;
|
||||
try {
|
||||
file = File.OpenRead(location.File);
|
||||
file = File.OpenRead(location.ScriptName);
|
||||
}
|
||||
catch {
|
||||
// simply don't do a preview if opening a file fails
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue