Recent

Author Topic: Include path in Fcl-Passrc parser  (Read 1103 times)

simone

  • Hero Member
  • *****
  • Posts: 573
Include path in Fcl-Passrc parser
« on: April 19, 2019, 03:59:44 pm »
As it is shown in the wiki: http://wiki.freepascal.org/fcl-passrc

the parser is started with a call to following function:

Code: Pascal  [Select][+][-]
  1. function ParseSource(AEngine: TPasTreeContainer;
  2.                      const FPCCommandLine, OSTarget, CPUTarget: String;
  3.                      Options : TParseSourceOptions): TPasModule;

The parameter CommandLine supports some options. For example it is
possible to use -I to include research path in order to find file included in code
with {$I xxx.inc}.

I have problems with path having spaces. In this case It's raised the exception
with message 'please specify only one source file'. I tried to enclose path between
single/double quotes without success.

Can someone suggest to me a cross platform solution to the problem? Thanks.
« Last Edit: April 19, 2019, 04:08:51 pm by simone »
Microsoft Windows 10 64 bit - Lazarus 3.0 FPC 3.2.2 x86_64-win64-win32/win64

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11453
  • FPC developer.
Re: Include path with in Fcl-Passrc parser
« Reply #1 on: April 19, 2019, 04:02:31 pm »
Try to quote the whole argument, so  "-I/path with space/bla"

simone

  • Hero Member
  • *****
  • Posts: 573
Re: Include path with in Fcl-Passrc parser
« Reply #2 on: April 19, 2019, 04:06:19 pm »
I have already tried without success using:

Code: Pascal  [Select][+][-]
  1. M:=ParseSource(E,'"-ID:\Exp\Nuova cartella" temp.pas','linux','i386');

Microsoft Windows 10 64 bit - Lazarus 3.0 FPC 3.2.2 x86_64-win64-win32/win64

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11453
  • FPC developer.
Re: Include path in Fcl-Passrc parser
« Reply #3 on: April 19, 2019, 04:18:14 pm »
There seems to be no quoting support, please file a bug.

simone

  • Hero Member
  • *****
  • Posts: 573
Re: Include path in Fcl-Passrc parser
« Reply #4 on: April 19, 2019, 09:21:19 pm »
Microsoft Windows 10 64 bit - Lazarus 3.0 FPC 3.2.2 x86_64-win64-win32/win64

 

TinyPortal © 2005-2018