pas2js: fixed not existsing default config

git-svn-id: trunk@40484 -
This commit is contained in:
Mattias Gaertner 2018-12-07 00:00:13 +00:00
parent 4fc633b13e
commit 1b4c201a68
4 changed files with 7 additions and 8 deletions

View File

@ -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);

View File

@ -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

View File

@ -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;

View File

@ -512,7 +512,9 @@ Function TConsoleFileWriter.DoWrite(Const S : TJSWriterString) : Integer;
begin
Result:=Length(S);
{AllowWriteln}
Writeln(S);
{AllowWriteln-}
end;
procedure TConsoleFileWriter.FLush;