[Implemented] Compiler Feature : Check for Syntax

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
Flype
Addict
Addict
Posts: 1542
Joined: Tue Jul 22, 2003 5:02 pm
Location: In a long distant galaxy

[Implemented] Compiler Feature : Check for Syntax

Post by Flype »

+1

yes, good idea flype.
No programming language is perfect. There is not even a single best language.
There are only languages well suited or perhaps poorly suited for particular purposes. Herbert Mayer
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6166
Joined: Sat May 17, 2003 11:31 am
Contact:

Post by blueznl »

don't care :shock:

:lol:
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Post by ts-soft »

blueznl wrote:don't care :shock:

:lol:
+ 1
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
User avatar
Flype
Addict
Addict
Posts: 1542
Joined: Tue Jul 22, 2003 5:02 pm
Location: In a long distant galaxy

Post by Flype »

:lol:

it was just for amusing myself.

and have one more vote :wink:
No programming language is perfect. There is not even a single best language.
There are only languages well suited or perhaps poorly suited for particular purposes. Herbert Mayer
Tranquil
Addict
Addict
Posts: 952
Joined: Mon Apr 28, 2003 2:22 pm
Location: Europe

Post by Tranquil »

Tranquil wrote::-) SMALL(?) enhancement to the IDE?
@Flype:

answering own posts is total lame! :mrgreen: :roll:
Tranquil
User avatar
Blue
Addict
Addict
Posts: 964
Joined: Fri Oct 06, 2006 4:41 am
Location: Canada

Post by Blue »

Just the suggestion I was about to post. :shock:

Allow me to join Flype (who posted his answer to Flype !!!) in saying:
Good idea, Flype. :!:

This is a must as a time-saver in large projects.
PB Forums : Proof positive that 2 heads (or more...) are better than one :idea:
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6166
Joined: Sat May 17, 2003 11:31 am
Contact:

Post by blueznl »

Perhaps I should rephrase it. I'd LOVE a REAL TIME syntax check as GfaBasic had, it just wouldn't let you leave a line in the editor if there was a syntax error on that line.

Now that might be a bit harsh, but one could think of colouring lines that contain syntax errors whilst editing.

That would be a definite +1. It doesn't make much sense to have a dedicated function, those errors would show up when compiling, no, you want to fix your errors the moment you make them!
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
User avatar
Kaeru Gaman
Addict
Addict
Posts: 4826
Joined: Sun Mar 19, 2006 1:57 pm
Location: Germany

Post by Kaeru Gaman »

to blueznl's suggestion:
this feature can be useful, but I'd like it to be optional.
sometimes you might like to write half a line, continue in another line,
and then complete the line before.
or you want to copy the incomplete line to insert it ten times and then fill it with different arguments.
for this it is necessary to switch the on-the-fly-check off.

anyhow: an extra syntax-check without running would be a useful idea...
...but this thread is one and a half years old....
oh... and have a nice day.
freak
PureBasic Team
PureBasic Team
Posts: 5940
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Post by freak »

Fred and I discussed this once, and basically what he said was that this "Syntax check mode" would
not be significantly faster than a normal compilation as the compiler needs to do all the work anyway.
So basically all you could gain is the assembly and linking stages, and those are only reached when all
syntax was correct anyway. So unless you plan to check your syntax mostly when there are no errors at all,
you can just as well hit F5 to check your syntax.

As for the on-the-fly syntax checks: This was something i had in mind since quite a while ago,
but it was always pushed aside by other things and is not really a big priority for me right now.
So maybe someday, who knows ?
quidquid Latine dictum sit altum videtur
User avatar
Kaeru Gaman
Addict
Addict
Posts: 4826
Joined: Sun Mar 19, 2006 1:57 pm
Location: Germany

Post by Kaeru Gaman »

freak wrote:Fred and I discussed this once, and basically what he said was that this "Syntax check mode" would
not be significantly faster than a normal compilation as the compiler needs to do all the work anyway.
So basically all you could gain is the assembly and linking stages, and those are only reached when all
syntax was correct anyway. So unless you plan to check your syntax mostly when there are no errors at all,
you can just as well hit F5 to check your syntax.
would it be possible to add some "compile but don't run" feature? e.g. Shift-F5
perhaps I want to check if my syntax is correct, but not have a screen opened,
tons of grafix loaded and to click through five screens to exit my game again...
oh... and have a nice day.
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6166
Joined: Sat May 17, 2003 11:31 am
Contact:

Post by blueznl »

freak wrote: As for the on-the-fly syntax checks: This was something i had in mind since quite a while ago
Well, it would be my third license :-)
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
JCV
Enthusiast
Enthusiast
Posts: 580
Joined: Fri Jun 30, 2006 4:30 pm
Location: Philippines

Post by JCV »

Kaeru Gaman wrote:would it be possible to add some "compile but don't run" feature? e.g. Shift-F5
This is definitely helpful if you only intend to check syntax specially on large projects. I sometimes compile my project just to check if there are syntax errors and just imagine how long the compiled program will open and you will just terminate it. This will save time.

[Registered PB User since 2006]
[PureBasic 6.20][SpiderBasic 2.2]
[RP4 x64][Win 11 x64][Ubuntu x64]
User avatar
Raybarg
User
User
Posts: 54
Joined: Mon Apr 30, 2007 7:02 am

Post by Raybarg »

JCV wrote:
Kaeru Gaman wrote:would it be possible to add some "compile but don't run" feature? e.g. Shift-F5
This is definitely helpful if you only intend to check syntax specially on large projects. I sometimes compile my project just to check if there are syntax errors and just imagine how long the compiled program will open and you will just terminate it. This will save time.
Could you just add End in the beginning of your code? It still compiles everything, right?
User avatar
Blue
Addict
Addict
Posts: 964
Joined: Fri Oct 06, 2006 4:41 am
Location: Canada

Post by Blue »

Raybarg wrote:[...]Could you just add End in the beginning of your code? It still compiles everything, right?
eh, eh ! Not a bad half-ass solution. :wink: ...assuming. of course, thst everything gets compiled, indeed.

I'll try it right away.

Thanks for the idea, Raybarg.
Last edited by Blue on Tue Jun 17, 2008 8:53 am, edited 1 time in total.
PB Forums : Proof positive that 2 heads (or more...) are better than one :idea:
CSAUER
Enthusiast
Enthusiast
Posts: 188
Joined: Mon Oct 18, 2004 7:23 am
Location: Germany

Post by CSAUER »

That seems to work.

May be an idea for freak:
Could you please implement a menu item which temporary add's a "end" command to the compilation?
It should not really be in the code editor, just only temporary in memory before compilation.
This could be the easy way for a solution. Does not bring a time benefit on compilation, but keeps the program away from doing its stuff (like loading ressources, database access, etc.).
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
PB4.1 - Win: MacBook black 2008 2,4 GHz, 4 GB RAM, MacOSX 10.5/VMWare/WinXP
PB4.1 - Mac: MacMini G4 1,4 GHz, 512 MB RAM, MacOSX 10.4
Post Reply