PascalSyntax.wiki
changeset 977 2269c95056fe
child 979 1455b4ad1ec3
equal deleted inserted replaced
976:e1ed13c13a4a 977:2269c95056fe
       
     1 #summary Pascal syntax rules
       
     2 
       
     3 When programming in Pascal for Hedgewars, we have two rules which must be
       
     4 always obeyed. This is because of our tool `pas2c` which doesn't fully
       
     5 understand Pascal yet. If these rules are broken, `pas2c` will fail to
       
     6 operate.
       
     7 
       
     8 == Two Pascal rules for pas2C ==
       
     9 
       
    10  # Never use `not` without brackets
       
    11  # Never use `in` with numerals
       
    12 
       
    13 === Examples ===
       
    14 
       
    15 Forbidden:
       
    16 
       
    17 `if a in [1, 2] then`
       
    18 
       
    19 Allowed:
       
    20 
       
    21 `if a in [sprBubble, sprAmGirder] then`
       
    22 
       
    23 Forbidden:
       
    24 
       
    25 `if not isExploded then`
       
    26 
       
    27 Allowed:
       
    28 
       
    29 `if not (isExploded) then`
       
    30 
       
    31 Allowed
       
    32 
       
    33 `if isExploded <> true then`