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(PasModule.GetDeclaration(true));
end;
if PasModule.CustomData=nil then
PasModule.CustomData:=Self;
// analyze
UseAnalyzer.AnalyzeModule(FPasModule);
@ -970,14 +968,18 @@ begin
Parser.ParseMain(FPasModule)
else
Parser.ParseSubModule(FPasModule);
if PasModule.CustomData=nil then
PasModule.CustomData:=Self;
if (FPasModule.ImplementationSection<>nil)
and (FPasModule.ImplementationSection.PendingUsedIntf<>nil) then
exit;
ParserFinished;
except
on E: Exception do
HandleException(E);
end;
if (FPasModule.ImplementationSection<>nil)
and (FPasModule.ImplementationSection.PendingUsedIntf<>nil) then
exit;
ParserFinished;
if (PasModule<>nil) and (PasModule.CustomData=nil) then
PasModule.CustomData:=Self;
end;
procedure TPas2jsCompilerFile.CreateJS;

View File

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