mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-24 03:09:21 +02:00
pas2js: fixed not existsing default config
git-svn-id: trunk@40484 -
This commit is contained in:
parent
4fc633b13e
commit
1b4c201a68
@ -2036,7 +2036,6 @@ begin
|
||||
begin
|
||||
repeat
|
||||
Expr:=DoParseExpression(Params);
|
||||
writeln('AAA1 TPasParser.ParseParams ',CurTokenString,' ',curtoken);
|
||||
if not Assigned(Expr) then
|
||||
ParseExcSyntaxError;
|
||||
Params.AddParam(Expr);
|
||||
|
@ -1223,8 +1223,6 @@ begin
|
||||
Compiler.Terminate(ExitCodeConverterError);
|
||||
end;
|
||||
|
||||
|
||||
|
||||
procedure TPas2jsCompilerFile.HandleUnknownException(E: Exception);
|
||||
begin
|
||||
if not (E is ECompilerTerminate) then
|
||||
@ -4417,7 +4415,6 @@ begin
|
||||
if Assigned(aFile.PCUSupport) then
|
||||
begin
|
||||
aFile.FileResolver.BaseDirectory:=ExtractFilePath(UnitFilename);
|
||||
writeln('AAA1 TPas2jsCompiler.LoadPasFile ',GetObjName(aFile.PCUSupport));
|
||||
aFile.PCUSupport.CreatePCUReader;
|
||||
end
|
||||
else
|
||||
|
@ -47,7 +47,6 @@ end;
|
||||
|
||||
Function TPas2JSFileConfigSupport.FindDefaultConfig : String;
|
||||
|
||||
|
||||
function TryConfig(aFilename: string): boolean;
|
||||
begin
|
||||
Result:=false;
|
||||
@ -56,6 +55,7 @@ Function TPas2JSFileConfigSupport.FindDefaultConfig : String;
|
||||
if Compiler.ShowDebug or Compiler.ShowTriedUsedFiles then
|
||||
Compiler.Log.LogMsgIgnoreFilter(nConfigFileSearch,[aFilename]);
|
||||
if not Compiler.FS.FileExists(aFilename) then exit;
|
||||
FindDefaultConfig:=aFilename;
|
||||
Result:=true;
|
||||
end;
|
||||
|
||||
@ -63,13 +63,14 @@ var
|
||||
aFilename: String;
|
||||
|
||||
begin
|
||||
Result:='';
|
||||
// first try HOME directory
|
||||
aFilename:=ChompPathDelim(GetEnvironmentVariablePJ('HOME'));
|
||||
if aFilename<>'' then
|
||||
begin
|
||||
aFilename:=aFilename+PathDelim{$IFDEF UNIX}+'.'{$ENDIF}+DefaultConfigFile;
|
||||
if TryConfig(aFileName) then
|
||||
exit(aFileName);
|
||||
exit;
|
||||
end;
|
||||
|
||||
// then try compiler directory
|
||||
@ -80,14 +81,14 @@ begin
|
||||
begin
|
||||
aFilename:=IncludeTrailingPathDelimiter(aFilename)+DefaultConfigFile;
|
||||
if TryConfig(aFilename) then
|
||||
exit(aFileName);
|
||||
exit;
|
||||
end;
|
||||
end;
|
||||
|
||||
// finally try global directory
|
||||
{$IFDEF Unix}
|
||||
if TryConfig('/etc/'+DefaultConfigFile) then
|
||||
exit(aFileName);
|
||||
exit;
|
||||
{$ENDIF}
|
||||
end;
|
||||
|
||||
|
@ -512,7 +512,9 @@ Function TConsoleFileWriter.DoWrite(Const S : TJSWriterString) : Integer;
|
||||
|
||||
begin
|
||||
Result:=Length(S);
|
||||
{AllowWriteln}
|
||||
Writeln(S);
|
||||
{AllowWriteln-}
|
||||
end;
|
||||
|
||||
procedure TConsoleFileWriter.FLush;
|
||||
|
Loading…
Reference in New Issue
Block a user