Renamed resolver API methods

This commit is contained in:
arookas 2016-02-07 17:02:34 -05:00
parent 2bab0f4389
commit 99ef85deb3
2 changed files with 9 additions and 9 deletions

View file

@ -145,12 +145,12 @@ namespace arookas {
throw new ArgumentNullException("name"); throw new ArgumentNullException("name");
} }
sunScriptFile file; sunScriptFile file;
var result = mResolver.ResolveImport(name, out file); var result = mResolver.Resolve(name, out file);
if (result == sunImportResult.Loaded) { if (result == sunImportResult.Loaded) {
try { try {
mResolver.EnterFile(file); mResolver.Enter(file);
mParser.Parse(file).Compile(this); mParser.Parse(file).Compile(this);
mResolver.ExitFile(file); mResolver.Exit(file);
} }
finally { finally {
file.Dispose(); file.Dispose();

View file

@ -9,9 +9,9 @@ namespace arookas {
get { return new sunDefaultImportResolver(); } get { return new sunDefaultImportResolver(); }
} }
public abstract void EnterFile(sunScriptFile file); public abstract void Enter(sunScriptFile file);
public abstract void ExitFile(sunScriptFile file); public abstract void Exit(sunScriptFile file);
public abstract sunImportResult ResolveImport(string name, out sunScriptFile file); public abstract sunImportResult Resolve(string name, out sunScriptFile file);
// default implementation // default implementation
sealed class sunDefaultImportResolver : sunImportResolver { sealed class sunDefaultImportResolver : sunImportResolver {
@ -36,13 +36,13 @@ namespace arookas {
mCurrentDirectory = Directory.GetCurrentDirectory(); mCurrentDirectory = Directory.GetCurrentDirectory();
} }
public override void EnterFile(sunScriptFile file) { public override void Enter(sunScriptFile file) {
mFiles.Push(file); mFiles.Push(file);
} }
public override void ExitFile(sunScriptFile file) { public override void Exit(sunScriptFile file) {
mFiles.Pop(); mFiles.Pop();
} }
public override sunImportResult ResolveImport(string name, out sunScriptFile file) { public override sunImportResult Resolve(string name, out sunScriptFile file) {
file = null; file = null;
name = name.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar); name = name.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar);
var path = ""; var path = "";