Recent

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

simone

  • Full Member
  • ***
  • Posts: 178
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 »

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 7007
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

  • Full Member
  • ***
  • Posts: 178
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');


marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 7007
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

  • Full Member
  • ***
  • Posts: 178
Re: Include path in Fcl-Passrc parser
« Reply #4 on: April 19, 2019, 09:21:19 pm »