PascalSyntax.wiki
author nemo
Fri, 14 Dec 2018 09:22:41 -0500
changeset 1687 425eb8f784a9
parent 981 a18f350d00ff
child 2016 3e426e5979ec
permissions -rw-r--r--
Drop 0.9.22 reference to tidy up. - not much point in building anything that old anymore - if anyone wants ancient builds of server, eh, the wiki is versioned. Remove SDL 1.2 from dep list for similar reason.

#summary Hedgewars-specific Pascal syntax rules
= Hedgewars-specific Pascal syntax rules =

When programming in Pascal for Hedgewars, we have two rules which must be always obeyed. This is because of our tool `pas2c` which doesn't fully understand Pascal yet. If these rules are broken, `pas2c` will fail to operate.

== Pascal rules for `pas2c` ==

 # Never use `not` without brackets
 # Never use `in` with numerals

=== Examples ===

Forbidden:

 `if a in [1, 2] then`

Allowed:

 `if a in [sprBubble, sprAmGirder] then`

Forbidden:

 `if not isExploded then`

Allowed:

 `if (not isExploded) then`

Allowed

 `if isExploded <> true then`