mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-12 09:29:07 +02:00
pas2js: fixed handlign error on first token of used unit
git-svn-id: trunk@37782 -
This commit is contained in:
parent
6f1e770887
commit
e00e7d9cfd
@ -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;
|
||||||
|
@ -126,7 +126,7 @@ begin
|
|||||||
tkLibrary:
|
tkLibrary:
|
||||||
ParseLibrary(Module);
|
ParseLibrary(Module);
|
||||||
else
|
else
|
||||||
ExpectToken(tkUnit);
|
CheckToken(tkUnit);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user