-pp compiler option

Forum for discussion about the documentation project.
dodicat
Posts: 7983
Joined: Jan 10, 2006 20:30
Location: Scotland

Re: -pp compiler option

Post by dodicat »

Yea thanks fxm.
I was also a bit ratty with Josep Roca in the other post, also regarding -pp.
You could perhaps add as a footnote to the -pp help
Warning: repeated use of -pp has been known to cause bad temper and aloofness.
deltarho[1859]
Posts: 4308
Joined: Jan 02, 2017 0:34
Location: UK
Contact:

Re: -pp compiler option

Post by deltarho[1859] »

dodicat wrote:I am not keen on being moderated by the hoi polloi.
Funny you should mention that because I am not overly keen either.
Warning: repeated use of -pp has been known to cause bad temper and aloofness.
Alternatively, "To be used in moderation" <grin>
St_W
Posts: 1626
Joined: Feb 11, 2009 14:24
Location: Austria
Contact:

Re: -pp compiler option

Post by St_W »

<ot>
@dodicat: whether you want to be constructive or destructive is your decision - only your decision. There's practically no moderation on this forum so you can say nearly anything without having to fear any consequences. I just try to encourage people to take part in discussions in a constructive fashion, but unfortunately that doesn't always work out as intended :-|
</ot>
deltarho[1859]
Posts: 4308
Joined: Jan 02, 2017 0:34
Location: UK
Contact:

Re: -pp compiler option

Post by deltarho[1859] »

St_W wrote:There's practically no moderation on this forum so you can say nearly anything without having to fear any consequences.
What a sorry state of affairs.
sancho3
Posts: 358
Joined: Sep 30, 2017 3:22

Re: -pp compiler option

Post by sancho3 »

Following up on DKL's suggestion for an example I propose something like this:

Code: Select all

' FileA.bas
#Define txt(n) "File" + n
Print "Hello from " + txt("A") 

Code: Select all

' FileB.bas
#Macro From(n)
	Print "Hello again from " + n
#EndMacro
From("FileB")

Code: Select all

' FileC.bas
#Include "FileA.bas"
#Include "FileB.bas"
From("FileC") 
Print "Goodbye from " + txt("C")

Code: Select all

' Resulting FileC.pp.bas file
Print "Hello from " + "File" + "A"


 Print "Hello again from " + "FileB"
 Print "Hello again from " + "FileC"
Print "Goodbye from " + "File" + "C"
I see that -pp inserts lines after expanding the #includes, and indents code expanded from #macro. I am not sure if that can be cleaned up.

EDIT: I fixed an error in the macro 'From'
Off topic a bit, is it a known issue that the following does not return an error?

Code: Select all

print "a" "b" "c"
Last edited by sancho3 on Nov 13, 2017 5:03, edited 2 times in total.
Boris the Old
Posts: 139
Joined: Feb 04, 2011 20:34
Location: Ontario, Canada

Re: -pp compiler option

Post by Boris the Old »

fxm wrote:
dodicat wrote:I am not keen on being moderated by the hoi polloi.
  • vocabulary.com wrote: The hoi polloi is a way of referring to common people, and it is an elitist term usually used by people who consider themselves to be above the masses.
    :-(
And it's also a derogatory term commonly used by the plebs to describe the elitists who are deservingly above them. :-)

And by the way, why not just say that the -pp compiler option suppresses the actual compile, and creates a copy of the source file that shows the contents of the include statements and the code generated by the macros. There's really not much more to say about it.

Rod
fxm
Moderator
Posts: 12107
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: -pp compiler option

Post by fxm »

Boris the Old wrote:
fxm wrote:And by the way, why not just say that the -pp compiler option suppresses the actual compile, and creates a copy of the source file that shows the contents of the include statements and the code generated by the macros. There's really not much more to say about it.
I think that's what's written now in the manual (Compiler Option: -pp)
Me too, I think that's enough!
Post Reply