PascalSyntax.wiki
author Wuzzy
Sun, 05 Jul 2020 21:15:29 +0200
changeset 2164 7b3c05ad3e46
parent 2019 12cc62c0ae38
permissions -rw-r--r--
TODO: drill strike complete

#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 [pas2CTutorial 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
 # Do not use Unicode characters anywhere (even in comments)

=== 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`