pas2js: fixed handlign error on first token of used unit

git-svn-id: trunk@37782 -
This commit is contained in:
Mattias Gaertner 2017-12-21 22:24:06 +00:00
parent 6f1e770887
commit e00e7d9cfd
2 changed files with 9 additions and 7 deletions

View File

@ -934,8 +934,6 @@ begin
Log.LogRaw('Pas-Module:'); Log.LogRaw('Pas-Module:');
Log.LogRaw(PasModule.GetDeclaration(true)); Log.LogRaw(PasModule.GetDeclaration(true));
end; end;
if PasModule.CustomData=nil then
PasModule.CustomData:=Self;
// analyze // analyze
UseAnalyzer.AnalyzeModule(FPasModule); UseAnalyzer.AnalyzeModule(FPasModule);
@ -970,14 +968,18 @@ begin
Parser.ParseMain(FPasModule) Parser.ParseMain(FPasModule)
else else
Parser.ParseSubModule(FPasModule); Parser.ParseSubModule(FPasModule);
if PasModule.CustomData=nil then
PasModule.CustomData:=Self;
if (FPasModule.ImplementationSection<>nil)
and (FPasModule.ImplementationSection.PendingUsedIntf<>nil) then
exit;
ParserFinished;
except except
on E: Exception do on E: Exception do
HandleException(E); HandleException(E);
end; end;
if (FPasModule.ImplementationSection<>nil) if (PasModule<>nil) and (PasModule.CustomData=nil) then
and (FPasModule.ImplementationSection.PendingUsedIntf<>nil) then PasModule.CustomData:=Self;
exit;
ParserFinished;
end; end;
procedure TPas2jsCompilerFile.CreateJS; procedure TPas2jsCompilerFile.CreateJS;

View File

@ -126,7 +126,7 @@ begin
tkLibrary: tkLibrary:
ParseLibrary(Module); ParseLibrary(Module);
else else
ExpectToken(tkUnit); CheckToken(tkUnit);
end; end;
end; end;